lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 Aug 2022 20:56:23 +0000
From:   <Don.Brace@...rochip.com>
To:     <christophe.jaillet@...adoo.fr>, <jejb@...ux.ibm.com>,
        <martin.petersen@...cle.com>
CC:     <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        <storagedev@...rochip.com>, <linux-scsi@...r.kernel.org>
Subject: Re: [PATCH 2/2] scsi: hpsa: Simplify {clear|set}_bit() parameters


From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Sent: Wednesday, July 20, 2022 1:14 PM
To: Don Brace - C33706 <Don.Brace@...rochip.com>; James E.J. Bottomley <jejb@...ux.ibm.com>; Martin K. Petersen <martin.petersen@...cle.com>
Cc: linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>; kernel-janitors@...r.kernel.org <kernel-janitors@...r.kernel.org>; Christophe JAILLET <christophe.jaillet@...adoo.fr>; storagedev <storagedev@...rochip.com>; linux-scsi@...r.kernel.org <linux-scsi@...r.kernel.org>
Subject: [PATCH 2/2] scsi: hpsa: Simplify {clear|set}_bit() parameters 
 
[Some people who received this message don't often get email from christophe.jaillet@...adoo.fr. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

{clear|set}_bit() can take an almost arbitrarily large bit number, so there
is no need to manually compute addresses. This is just redundant.

Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>

Acked-by: Don Brace <don.brace@...rochip.com>
Tested-by: Don Brace <don.brace@...rochip.com>

We normally do not make changes to this driver anymore. But the change looks good.
Thanks for your patch. No cover letter to Ack both at the same time.

Don
---
 drivers/scsi/hpsa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 0612ca681200..f8e832b1bc46 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6233,8 +6233,7 @@ static struct CommandList *cmd_alloc(struct ctlr_info *h)
                        offset = (i + 1) % HPSA_NRESERVED_CMDS;
                        continue;
                }
-               set_bit(i & (BITS_PER_LONG - 1),
-                       h->cmd_pool_bits + (i / BITS_PER_LONG));
+               set_bit(i, h->cmd_pool_bits);
                break; /* it's ours now. */
        }
        hpsa_cmd_partial_init(h, i, c);
@@ -6261,8 +6260,7 @@ static void cmd_free(struct ctlr_info *h, struct CommandList *c)
                int i;

                i = c - h->cmd_pool;
-               clear_bit(i & (BITS_PER_LONG - 1),
-                         h->cmd_pool_bits + (i / BITS_PER_LONG));
+               clear_bit(i, h->cmd_pool_bits);
        }
 }

--
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ