From: John Garry Date: Tue, 6 Sep 2016 15:36:15 +0000 (+0800) Subject: scsi: hisi_sas: use safe BITS_PER_BYTE for slot tag size calculation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=433f569601402d6b1f0df17b75327aed082680a4;p=linux-beck.git scsi: hisi_sas: use safe BITS_PER_BYTE for slot tag size calculation The memory calculation for the tags bitmap should use BITS_PER_BYTE macro instead of coincidental same value of sizeof(unsigned long). Signed-off-by: John Garry Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 0e487517d08e..dcb17a3cbf3f 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1309,7 +1309,7 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost) memset(hisi_hba->breakpoint, 0, s); hisi_hba->slot_index_count = max_command_entries; - s = hisi_hba->slot_index_count / sizeof(unsigned long); + s = hisi_hba->slot_index_count / BITS_PER_BYTE; hisi_hba->slot_index_tags = devm_kzalloc(dev, s, GFP_KERNEL); if (!hisi_hba->slot_index_tags) goto err_out;