Commit 4ee8c40b authored by Zhen Lei's avatar Zhen Lei Committed by Martin K. Petersen

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.comAcked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b6e7fba0
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment