public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rand Deeb <rand.sec96@gmail.com>
To: Hannes Reinecke <hare@suse.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: deeb.rand@confident.ru, lvc-project@linuxtesting.org,
	voskresenski.stanislav@confident.ru,
	Rand Deeb <rand.sec96@gmail.com>
Subject: [PATCH] ahd: Remove Redundant Comparison in ahd_intr()
Date: Mon, 18 Dec 2023 17:09:02 +0300	[thread overview]
Message-ID: <20231218140902.36774-1-rand.sec96@gmail.com> (raw)

The 'ahd_intr()' function contained a redundant comparisonthat was
always false. The comparison in question was:

if ((intstat == 0xFF) && (ahd->features & AHD_REMOVABLE) != 0)

The 'AHD_REMOVABLE' constant had a value of '0x00000'. Therefore, the
condition 'ahd->features & AHD_REMOVABLE' was always '0', making the
comparison unnecessary.

This patch removes the redundant comparison, making the code clearer
and more efficient.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
---
 drivers/scsi/aic7xxx/aic79xx_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 98b02e7d38bb..4c790fe28f73 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -1008,9 +1008,7 @@ ahd_intr(struct ahd_softc *ahd)
 	 * Handle statuses that may invalidate our cached
 	 * copy of INTSTAT separately.
 	 */
-	if (intstat == 0xFF && (ahd->features & AHD_REMOVABLE) != 0) {
-		/* Hot eject.  Do nothing */
-	} else if (intstat & HWERRINT) {
+	if (intstat & HWERRINT) {
 		ahd_handle_hwerrint(ahd);
 	} else if ((intstat & (PCIINT|SPLTINT)) != 0) {
 		ahd->bus_intr(ahd);
-- 
2.34.1


                 reply	other threads:[~2023-12-18 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231218140902.36774-1-rand.sec96@gmail.com \
    --to=rand.sec96@gmail.com \
    --cc=deeb.rand@confident.ru \
    --cc=hare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=martin.petersen@oracle.com \
    --cc=voskresenski.stanislav@confident.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox