[lvc-project] [PATCH] scsi: megaraid: megaraid_sas: Remove unnecessary checks
Artem Chernyshev
artem.chernyshev at red-soft.ru
Mon Oct 9 18:10:16 MSK 2023
Since divisor checked before function call this if-statement
is never true
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Artem Chernyshev <artem.chernyshev at red-soft.ru>
---
drivers/scsi/megaraid/megaraid_sas_fp.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
index b8b388a4e28f..4cfa98ce3923 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
@@ -72,8 +72,6 @@ u32 mega_mod64(u64 dividend, u32 divisor)
u64 d;
u32 remainder;
- if (!divisor)
- printk(KERN_ERR "megasas : DIVISOR is zero, in div fn\n");
d = dividend;
remainder = do_div(d, divisor);
return remainder;
@@ -90,9 +88,6 @@ static u64 mega_div64_32(uint64_t dividend, uint32_t divisor)
{
u64 d = dividend;
- if (!divisor)
- printk(KERN_ERR "megasas : DIVISOR is zero in mod fn\n");
-
do_div(d, divisor);
return d;
--
2.37.3
More information about the lvc-project
mailing list