All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Pylypiv <ipylypiv@google.com>
To: Jack Wang <jinpu.wang@cloud.ionos.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Vishakha Channapattan <vishakhavc@google.com>,
	Changyuan Lyu <changyuanl@google.com>,
	linux-scsi@vger.kernel.org, Igor Pylypiv <ipylypiv@google.com>
Subject: [PATCH 4/4] scsi: pm80xx: Use bitmap_zalloc() for tags bitmap allocation
Date: Mon,  1 Nov 2021 16:28:25 -0700	[thread overview]
Message-ID: <20211101232825.2350233-5-ipylypiv@google.com> (raw)
In-Reply-To: <20211101232825.2350233-1-ipylypiv@google.com>

We used to allocate X bytes while we only need X bits.

Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
---
 drivers/scsi/pm8001/pm8001_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 47db7e0beae6..9935cf20b93d 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -178,7 +178,7 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha)
 	}
 	PM8001_CHIP_DISP->chip_iounmap(pm8001_ha);
 	flush_workqueue(pm8001_wq);
-	kfree(pm8001_ha->tags);
+	bitmap_free(pm8001_ha->tags);
 	kfree(pm8001_ha);
 }
 
@@ -1193,7 +1193,7 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
 	can_queue = ccb_count - PM8001_RESERVE_SLOT;
 	shost->can_queue = can_queue;
 
-	pm8001_ha->tags = kzalloc(ccb_count, GFP_KERNEL);
+	pm8001_ha->tags = bitmap_zalloc(ccb_count, GFP_KERNEL);
 	if (!pm8001_ha->tags)
 		goto err_out;
 
-- 
2.33.1.1089.g2158813163f-goog


  parent reply	other threads:[~2021-11-01 23:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 23:28 [PATCH 0/4] small pm80xx cleanups and fixes Igor Pylypiv
2021-11-01 23:28 ` [PATCH 1/4] scsi: pm80xx: Apply byte mask for phy id in mpi_phy_start_resp() Igor Pylypiv
2021-11-02  7:04   ` Jinpu Wang
2021-11-01 23:28 ` [PATCH 2/4] scsi: pm80xx: Do not check the address-of value for NULL Igor Pylypiv
2021-11-02  7:06   ` Jinpu Wang
2021-11-01 23:28 ` [PATCH 3/4] scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd() Igor Pylypiv
2021-11-02  7:07   ` Jinpu Wang
2021-11-01 23:28 ` Igor Pylypiv [this message]
2021-11-02  7:08   ` [PATCH 4/4] scsi: pm80xx: Use bitmap_zalloc() for tags bitmap allocation Jinpu Wang
2021-11-19  2:50 ` [PATCH 0/4] small pm80xx cleanups and fixes Martin K. Petersen
2021-11-23  3:49 ` 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=20211101232825.2350233-5-ipylypiv@google.com \
    --to=ipylypiv@google.com \
    --cc=changyuanl@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vishakhavc@google.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.