i2c: busses: remove unneeded conversion to bool
Subsystems (2)
PATCH 1/1 i2c: busses: remove unneeded conversion to bool
The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:
drivers/i2c/busses/i2c-qup.c:960:48-53: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:962:47-52: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1531:29-34: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1533:29-34: WARNING: conversion to bool not needed here
--- drivers/i2c/busses/i2c-qup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-qup.c +4 -6
@@ -956,10 +956,8 @@ static void qup_i2c_conf_v1(struct qup_i2c_dev *qup)u32 qup_config =I2C_MINI_CORE |I2C_N_VAL ;u32 io_mode =QUP_REPACK_EN ; - blk->is_tx_blk_mode = - blk->total_tx_len > qup->out_fifo_sz ? true : false; - blk->is_rx_blk_mode = - blk->total_rx_len > qup->in_fifo_sz ? true : false; + blk->is_tx_blk_mode = blk->total_tx_len > qup->out_fifo_sz; + blk->is_rx_blk_mode = blk->total_rx_len > qup->in_fifo_sz;if (blk->is_tx_blk_mode) { io_mode |=QUP_OUTPUT_BLK_MODE ;
@@ -1528,9 +1526,9 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup, qup->use_dma = true; }else { qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz - -QUP_MAX_TAGS_LEN ? true : false; +QUP_MAX_TAGS_LEN ; qup->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz - -READ_RX_TAGS_LEN ? true : false; +READ_RX_TAGS_LEN ; }return 0 ;
Signature · 1 line
2.21.1
Quoted 9 lines · Jason Yan
The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:
drivers/i2c/busses/i2c-qup.c:960:48-53: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:962:47-52: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1531:29-34: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1533:29-34: WARNING: conversion to bool not needed here
Signed-off-by Jason Yan <[email protected]>
Quoted 36 lines
--- drivers/i2c/busses/i2c-qup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)drivers/i2c/busses/i2c-qup.c +4
-6@@ -956,10 +956,8 @@ static void qup_i2c_conf_v1(struct qup_i2c_dev *qup)u32 qup_config =I2C_MINI_CORE |I2C_N_VAL ;u32 io_mode =QUP_REPACK_EN ; - blk->is_tx_blk_mode = - blk->total_tx_len > qup->out_fifo_sz ? true : false; - blk->is_rx_blk_mode = - blk->total_rx_len > qup->in_fifo_sz ? true : false; + blk->is_tx_blk_mode = blk->total_tx_len > qup->out_fifo_sz; + blk->is_rx_blk_mode = blk->total_rx_len > qup->in_fifo_sz;if (blk->is_tx_blk_mode) { io_mode |=QUP_OUTPUT_BLK_MODE ;@@ -1528,9 +1526,9 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup, qup->use_dma = true; }else { qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz - -QUP_MAX_TAGS_LEN ? true : false; +QUP_MAX_TAGS_LEN ; qup->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz - -READ_RX_TAGS_LEN ? true : false; +READ_RX_TAGS_LEN ; }return 0 ;Signature · 1 line
2.21.1
Wolfram Sang
AppliedQuoted 9 lines · Jason Yan
The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:
drivers/i2c/busses/i2c-qup.c:960:48-53: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:962:47-52: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1531:29-34: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1533:29-34: WARNING: conversion to bool not needed here
Signed-off-by Jason Yan <[email protected]>
Applied to for-next, thanks! But please fix $subject to have the driver name "qup" next time.
Quoted 9 lines · Wolfram Sang
Quoted 8 lines · Jason Yan
The '>' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:
drivers/i2c/busses/i2c-qup.c:960:48-53: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:962:47-52: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1531:29-34: WARNING: conversion to bool not needed here drivers/i2c/busses/i2c-qup.c:1533:29-34: WARNING: conversion to bool not needed here
Quoted 5 lines
Quoted 1 line
Signed-off-by Jason Yan <[email protected]>Applied to for-next, thanks! But please fix $subject to have the driver name "qup" next time.
OK, get it.
Thanks,
Jason