From: Todd Poynor Date: Fri, 20 Jul 2018 03:49:05 +0000 (-0700) Subject: staging: gasket: remove unnecessary code in coherent allocator X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ed6e96c7951b85bb5c6a50503baa2fd9bfbb0510;p=openwrt%2Fstaging%2Fblogic.git staging: gasket: remove unnecessary code in coherent allocator Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gasket/gasket_ioctl.c b/drivers/staging/gasket/gasket_ioctl.c index 0c2f85cf5448..d0142ed048a6 100644 --- a/drivers/staging/gasket/gasket_ioctl.c +++ b/drivers/staging/gasket/gasket_ioctl.c @@ -420,10 +420,8 @@ static int gasket_config_coherent_allocator( if (ibuf.page_table_index >= gasket_dev->num_page_tables) return -EFAULT; - if (ibuf.size > PAGE_SIZE * MAX_NUM_COHERENT_PAGES) { - ibuf.size = PAGE_SIZE * MAX_NUM_COHERENT_PAGES; + if (ibuf.size > PAGE_SIZE * MAX_NUM_COHERENT_PAGES) return -ENOMEM; - } if (ibuf.enable == 0) { ret = gasket_free_coherent_memory(