From: Andy Shevchenko Date: Tue, 22 Sep 2020 11:58:47 +0000 (+0300) Subject: dmaengine: dmatest: Return boolean result directly in filter() X-Git-Tag: microblaze-v5.11~124^2~15 X-Git-Url: http://git.monstr.eu/?p=linux-2.6-microblaze.git;a=commitdiff_plain;h=da75ba2482658a0d9ea5245fadfea6b464fab7a3 dmaengine: dmatest: Return boolean result directly in filter() There is no need to have a conditional for boolean expression when function returns bool. Drop unnecessary code and return boolean result directly. While at it, drop unneeded casting from void *. Cc: Vladimir Murzin Signed-off-by: Andy Shevchenko Tested-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200922115847.30100-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 00f288bd377c..a3a172173e34 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -1058,13 +1058,7 @@ static int dmatest_add_channel(struct dmatest_info *info, static bool filter(struct dma_chan *chan, void *param) { - struct dmatest_params *params = param; - - if (!dmatest_match_channel(params, chan) || - !dmatest_match_device(params, chan->device)) - return false; - else - return true; + return dmatest_match_channel(param, chan) && dmatest_match_device(param, chan->device); } static void request_channels(struct dmatest_info *info,