]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: only zero slot memory when reused
authorJohn Garry <john.garry@huawei.com>
Tue, 6 Sep 2016 15:36:14 +0000 (23:36 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 14 Sep 2016 16:54:17 +0000 (12:54 -0400)
Currently the slot memory is zeroed when it is freed and also when it is
reused, like in hisi_sas_task_prep(). Optimise by avoiding the redundant
zeroing in the free.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 5d5657670d4c1b1edeac076a4e85dd83b7dce91a..0e487517d08efc2e6598794eb8059ef0f55fc972 100644 (file)
@@ -97,7 +97,7 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task,
        slot->task = NULL;
        slot->port = NULL;
        hisi_sas_slot_index_free(hisi_hba, slot->idx);
-       memset(slot, 0, sizeof(*slot));
+       /* slot memory is fully zeroed when it is reused */
 }
 EXPORT_SYMBOL_GPL(hisi_sas_slot_task_free);