CC: [email protected] BCC: [email protected] CC: [email protected] TO: Denis Efremov <[email protected]> CC: Julia Lawall <[email protected]> CC: Vinod Koul <[email protected]> CC: Orson Zhai <[email protected]> CC: Baolin Wang <[email protected]> CC: Chunyan Zhang <[email protected]> CC: [email protected] CC: [email protected]
From: kernel test robot <[email protected]> drivers/dma/sprd-dma.c:685:23-24: WARNING opportunity for max() Check for opencoded min(), max() implementations. Generated patches sometimes require adding a cast to fix compile warning. Warnings/patches scope intentionally limited to a function body. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 8f4dd16603ce834d1c5c4da67803ea82dd282511 commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script :::::: branch date: 19 hours ago :::::: commit date: 12 months ago Please take the patch only if it's a positive warning. Thanks! drivers/dma/sprd-dma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -682,10 +682,7 @@ static enum dma_status sprd_dma_tx_statu pos = hw->trsc_len; else if (hw->blk_len > 0) pos = hw->blk_len; - else if (hw->frg_len > 0) - pos = hw->frg_len; - else - pos = 0; + else pos = max(hw->frg_len, 0); } else if (schan->cur_desc && schan->cur_desc->vd.tx.cookie == cookie) { struct sprd_dma_desc *sdesc = schan->cur_desc; _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
