Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Zhen Lei and committed by
Martin K. Petersen
4ee8c40b b6e7fba0

+2 -4
+2 -4
drivers/scsi/pm8001/pm8001_sas.c
··· 118 118 align_offset = (dma_addr_t)align - 1; 119 119 mem_virt_alloc = dma_alloc_coherent(&pdev->dev, mem_size + align, 120 120 &mem_dma_handle, GFP_KERNEL); 121 - if (!mem_virt_alloc) { 122 - pr_err("pm80xx: memory allocation error\n"); 123 - return -1; 124 - } 121 + if (!mem_virt_alloc) 122 + return -ENOMEM; 125 123 *pphys_addr = mem_dma_handle; 126 124 phys_align = (*pphys_addr + align_offset) & ~align_offset; 127 125 *virt_addr = (void *)mem_virt_alloc + phys_align - *pphys_addr;