The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: lpfc: Cleanup some bitmap handling.
@ 2021-12-24  7:06 Christophe JAILLET
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-12-24  7:06 UTC (permalink / raw)
  To: james.smart, dick.kennedy, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, kernel-janitors, Christophe JAILLET

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-24  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-24  7:06 [PATCH 0/2] scsi: lpfc: Cleanup some bitmap handling Christophe JAILLET
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox