From 15db12d5558c76070a0c3298c0888b10f62e5ce8 Mon Sep 17 00:00:00 2001 From: chenxiang Date: Thu, 18 Jul 2019 17:01:46 +0800 Subject: [PATCH] scsi: hisi_sas: remove redundant codes related to dmam_alloc_coherent() driver inclusion category: bugfix bugzilla: NA CVE: NA Since commit "518a2f19 dma-mapping: zero memory returned from dma_alloc_*", the allocated memory are zeroed. So it is not necessary to zero them or allocate them with flag __GFP_ZERO. Signed-off-by: Xiang Chen Signed-off-by: John Garry Feature or Bugfix:Bugfix Reviewed-by: John Garry Signed-off-by: chenxiang (M) Reviewed-by: tanxiaofei Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 8dee55b5bf65..ace762f6659c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2390,7 +2390,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) GFP_KERNEL); if (!hisi_hba->itct) goto err_out; - memset(hisi_hba->itct, 0, s); hisi_hba->slot_info = devm_kcalloc(dev, max_command_entries, sizeof(struct hisi_sas_slot), @@ -2417,8 +2416,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) dma_addr_t buf_dma; int slot_index = i * slots_per_blk; - buf = dmam_alloc_coherent(dev, s, &buf_dma, GFP_KERNEL | - __GFP_ZERO); + buf = dmam_alloc_coherent(dev, s, &buf_dma, GFP_KERNEL); if (!buf) goto err_out; @@ -2467,7 +2465,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) GFP_KERNEL); if (!hisi_hba->sata_breakpoint) goto err_out; - hisi_sas_init_mem(hisi_hba); hisi_sas_slot_index_init(hisi_hba); hisi_hba->last_slot_index = hisi_hba->hw->max_command_entries - -- GitLab