drivers/ata: remove redundant val variable
PATCH 1/1 drivers/ata: remove redundant val variable
From: Minghao Chi <[email protected]>
Return value from DIV_ROUND_UP() directly instead of taking this in another redundant variable.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Minghao Chi <[email protected]>
Signed-off-by CGEL ZTE <[email protected]>
--- drivers/ata/pata_octeon_cf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/ata/pata_octeon_cf.c +1 -5
@@ -73,16 +73,12 @@ MODULE_PARM_DESC(enable_dma,*/ static unsigned int ns_to_tim_reg (unsigned int tim_mult,unsigned int nsecs) { -unsigned int val; -/* * Compute # of eclock periods to get desired duration in * nanoseconds. */ - val =DIV_ROUND_UP (nsecs * (octeon_get_io_clock_rate () /1000000 ), +return DIV_ROUND_UP (nsecs * (octeon_get_io_clock_rate () /1000000 ),1000 * tim_mult); - -return val; }static void octeon_cf_set_boot_reg_cfg (int cs,unsigned int multiplier)
Signature · 1 line
2.25.1
Damien Le Moal
AppliedQuoted 24 lines · On 1/4/22 20:25, [email protected] wrote:
From: Minghao Chi <[email protected]>
Return value from
DIV_ROUND_UP()directly instead of taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>Signed-off-by CGEL ZTE <[email protected]>--- drivers/ata/pata_octeon_cf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/ata/pata_octeon_cf.c +0
-2@@ -73,16 +73,12 @@ MODULE_PARM_DESC(enable_dma,*/ static unsigned int ns_to_tim_reg (unsigned int tim_mult,unsigned int nsecs) { -unsigned int val; -/* * Compute # of eclock periods to get desired duration in
drivers/ata/pata_octeon_cf.c MODULE_PARM_DESC(enable_dma, · line 84
Quoted 10 lines
drivers/ata/pata_octeon_cf.c +1
-3* nanoseconds. */ - val =DIV_ROUND_UP (nsecs * (octeon_get_io_clock_rate () /1000000 ), +return DIV_ROUND_UP (nsecs * (octeon_get_io_clock_rate () /1000000 ),1000 * tim_mult); - -return val; }static void octeon_cf_set_boot_reg_cfg (int cs,unsigned int multiplier)
Applied to for-5.17. Thanks.
Signature · 2 lines
Damien Le Moal Western Digital Research