Skip to contentSkip to conversation

scsi: pm8001: remove casting kcalloc

PATCH Applied Xu Wang 3 participants 4 messages Nov 20, 2020 – Dec 1, 2020

Subsystems (2)
lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 scsi: pm8001: remove casting kcalloc

Remove casting the values returned by kcalloc.

---
 drivers/scsi/pm8001/pm8001_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +2 -2
index 3cf3e58b6979..ac0e598b8ac2 100644
@@ -1187,8 +1187,8 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
 		goto err_out;
 
 	/* Memory region for ccb_info*/
-	pm8001_ha->ccb_info = (struct pm8001_ccb_info *)
-		kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
+	pm8001_ha->ccb_info =
+		kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
 	if (!pm8001_ha->ccb_info) {
 		PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
 			("Unable to allocate memory for ccb\n"));
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Xu Wang

Remove casting the values returned by kcalloc.

Thanks Xu!

Quoted 22 lines
---
 drivers/scsi/pm8001/pm8001_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +2 -3
index 3cf3e58b6979..ac0e598b8ac2 100644
@@ -1187,8 +1187,8 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
                goto err_out;
 
        /* Memory region for ccb_info*/
-       pm8001_ha->ccb_info = (struct pm8001_ccb_info *)
-               kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
+       pm8001_ha->ccb_info =
+               kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
        if (!pm8001_ha->ccb_info) {
                PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
                        ("Unable to allocate memory for ccb\n"));
--

2.17.1

#2 lore raw
In reply to Xu Wang

Xu,

Quoted 1 line

Remove casting the values returned by kcalloc.

Applied to 5.11/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering