Skip to content

Commit da75ba2

Browse files
andy-shevvinodkoul
authored andcommitted
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 <vladimir.murzin@arm.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200922115847.30100-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent b28de38 commit da75ba2

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/dma/dmatest.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,13 +1058,7 @@ static int dmatest_add_channel(struct dmatest_info *info,
10581058

10591059
static bool filter(struct dma_chan *chan, void *param)
10601060
{
1061-
struct dmatest_params *params = param;
1062-
1063-
if (!dmatest_match_channel(params, chan) ||
1064-
!dmatest_match_device(params, chan->device))
1065-
return false;
1066-
else
1067-
return true;
1061+
return dmatest_match_channel(param, chan) && dmatest_match_device(param, chan->device);
10681062
}
10691063

10701064
static void request_channels(struct dmatest_info *info,

0 commit comments

Comments
 (0)