From patchwork Mon Oct 9 15:10:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Chernyshev X-Patchwork-Id: 13413889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8493E95A95 for ; Mon, 9 Oct 2023 15:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376389AbjJIPKZ (ORCPT ); Mon, 9 Oct 2023 11:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346469AbjJIPKY (ORCPT ); Mon, 9 Oct 2023 11:10:24 -0400 Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 457F6B7; Mon, 9 Oct 2023 08:10:22 -0700 (PDT) Received: from localhost.biz (unknown [10.81.81.211]) by gw.red-soft.ru (Postfix) with ESMTPA id 278B83E1B08; Mon, 9 Oct 2023 18:10:20 +0300 (MSK) From: Artem Chernyshev To: "James E . J . Bottomley" , Kashyap Desai Cc: Artem Chernyshev , Sumit Saxena , Shivasharan S , "Martin K . Petersen" , megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] scsi: megaraid: megaraid_sas: Remove unnecessary checks Date: Mon, 9 Oct 2023 18:10:16 +0300 Message-Id: <20231009151016.154039-1-artem.chernyshev@red-soft.ru> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 180482 [Oct 09 2023] X-KLMS-AntiSpam-Version: 5.9.59.0 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 536 536 1ae19c7800f69da91432b5e67ed4a00b9ade0d03, {Tracking_from_domain_doesnt_match_to}, localhost.biz:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;red-soft.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/10/09 07:46:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/10/09 13:47:00 #22102018 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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;