diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-06-10 11:46:05 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-16 04:41:12 +0200 |
commit | 4ee8c40b1e1e1bb7db805bc11e376f547fb24ec2 (patch) | |
tree | 2402f47caedc7ec21f630da25d2aa5ab346d75f6 /drivers/scsi/pm8001/pm8001_sas.c | |
parent | scsi: qla2xxx: Use list_move_tail() instead of list_del()/list_add_tail() (diff) | |
download | linux-4ee8c40b1e1e1bb7db805bc11e376f547fb24ec2.tar.xz linux-4ee8c40b1e1e1bb7db805bc11e376f547fb24ec2.zip |
scsi: pm8001: Remove unnecessary OOM message
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message
Remove it can help us save a bit of memory.
Also change the return error code from "-1" to "-ENOMEM".
Link: https://lore.kernel.org/r/20210610094605.16672-2-thunder.leizhen@huawei.com
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_sas.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_sas.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index 01122993c943..d63c7d59ad34 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -118,10 +118,8 @@ int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr, align_offset = (dma_addr_t)align - 1; mem_virt_alloc = dma_alloc_coherent(&pdev->dev, mem_size + align, &mem_dma_handle, GFP_KERNEL); - if (!mem_virt_alloc) { - pr_err("pm80xx: memory allocation error\n"); - return -1; - } + if (!mem_virt_alloc) + return -ENOMEM; *pphys_addr = mem_dma_handle; phys_align = (*pphys_addr + align_offset) & ~align_offset; *virt_addr = (void *)mem_virt_alloc + phys_align - *pphys_addr; |