All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Don.Brace@microchip.com>
To: <christophe.jaillet@wanadoo.fr>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>
Cc: <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	<storagedev@microchip.com>, <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 2/2] scsi: hpsa: Simplify {clear|set}_bit() parameters
Date: Tue, 2 Aug 2022 20:56:23 +0000	[thread overview]
Message-ID: <CY4PR11MB1238464CF07D61B134703EA7E19D9@CY4PR11MB1238.namprd11.prod.outlook.com> (raw)
In-Reply-To: <c3429a22023f58e5e5cc65d6cd7e83fb2bd9b870.1658340442.git.christophe.jaillet@wanadoo.fr>


From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Sent: Wednesday, July 20, 2022 1:14 PM
To: Don Brace - C33706 <Don.Brace@microchip.com>; James E.J. Bottomley <jejb@linux.ibm.com>; Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; kernel-janitors@vger.kernel.org <kernel-janitors@vger.kernel.org>; Christophe JAILLET <christophe.jaillet@wanadoo.fr>; storagedev <storagedev@microchip.com>; linux-scsi@vger.kernel.org <linux-scsi@vger.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@wanadoo.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@wanadoo.fr>

Acked-by: Don Brace <don.brace@microchip.com>
Tested-by: Don Brace <don.brace@microchip.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

  reply	other threads:[~2022-08-02 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 18:13 [PATCH 1/2] scsi: hpsa: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-20 18:14 ` [PATCH 2/2] scsi: hpsa: Simplify {clear|set}_bit() parameters Christophe JAILLET
2022-08-02 20:56   ` Don.Brace [this message]
2022-08-02 20:55 ` [PATCH 1/2] scsi: hpsa: Use the bitmap API to allocate bitmaps Don.Brace
2022-09-01  4:45 ` Martin K. Petersen

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=CY4PR11MB1238464CF07D61B134703EA7E19D9@CY4PR11MB1238.namprd11.prod.outlook.com \
    --to=don.brace@microchip.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=storagedev@microchip.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.