The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: james.smart@broadcom.com, dick.kennedy@broadcom.com,
	jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 0/2] scsi: lpfc: Cleanup some bitmap handling.
Date: Fri, 24 Dec 2021 08:06:56 +0100	[thread overview]
Message-ID: <cover.1640328930.git.christophe.jaillet@wanadoo.fr> (raw)

The 1st patch of this serie uses bitmap_zalloc() to simplify code.
The 2nd patch makes sure that the whole bitmap is cleared, should it need more
than 1 long.

However, this 'fcf_rr_bmask' is small (LPFC_SLI4_FCF_TBL_INDX_MAX = 32 bits), so
another option could be to use DECLARE_BITMAP instead of dynamic allocation.

This would simplify code (no more allocation and associated error handling) and
be slighly more efficient (1 less indirection when accessing the bitmap).
In the case the 2nd patch could also be removed (using bitmap_zero() would still
be cleaner (IMHO), but the actual memset+sizeof would work as expected)

Let me know if I should send a v2 with this other approach.

Christophe JAILLET (2):
  scsi: lpfc: Use bitmap_zalloc() when applicable
  scsi: lpfc: Make sure to completely clear some bitmaps

 drivers/scsi/lpfc/lpfc_hbadisc.c |  7 ++++---
 drivers/scsi/lpfc/lpfc_init.c    | 10 ++++------
 drivers/scsi/lpfc/lpfc_sli.c     |  3 +--
 3 files changed, 9 insertions(+), 11 deletions(-)

-- 
2.32.0


             reply	other threads:[~2021-12-24  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  7:06 Christophe JAILLET [this message]
2021-12-24  7:07 ` [PATCH 1/2] scsi: lpfc: Use bitmap_zalloc() when applicable Christophe JAILLET
2021-12-24  7:07 ` [PATCH 2/2] scsi: lpfc: Make sure to completely clear some bitmaps Christophe JAILLET

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=cover.1640328930.git.christophe.jaillet@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=dick.kennedy@broadcom.com \
    --cc=james.smart@broadcom.com \
    --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 \
    /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