scsi: pm8001: remove unnecessary oom message
Subsystems (2)
v2 cover scsi: pm8001: remove unnecessary oom message
v1 --> v2:
Change the return error code from "-1" to "-ENOMEM".
Zhen Lei (1):
scsi: pm8001: remove unnecessary oom message
drivers/scsi/pm8001/pm8001_sas.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.0.106.g9fadedd
PATCH v2 1/1 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.
By the way, change the return error code from "-1" to "-ENOMEM".
--- drivers/scsi/pm8001/pm8001_sas.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/pm8001/pm8001_sas.c +2 -4
@@ -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;
Signature · 1 line
2.26.0.106.g9fadedd
Quoted 9 lines · Zhen Lei
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageRemove it can help us save a bit of memory.
By the way, change the return error code from "-1" to "
-ENOMEM".Signed-off-by Zhen Lei <[email protected]>
Thx.
Quoted 25 lines
--- drivers/scsi/pm8001/pm8001_sas.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/scsi/pm8001/pm8001_sas.c +2
-5@@ -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; --2.26.0.106.g9fadedd
Martin K. Petersen
AppliedZhen,
Quoted 2 lines
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' message
Applied to 5.14/scsi-staging.
Instead of sending 20 individual patches to address OOM messages, please submit a series. That makes things much easier to track in patchwork and b4.
Same goes for the DEVICE_ATTR_RO changes. One series per logical change, one patch per driver.
Thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 11 lines · Martin K. Petersen
Zhen,
Quoted 2 lines
Fixes
scripts/checkpatch.plwarning:
WARNING: Possible unnecessary 'out of memory' messageApplied to 5.14/scsi-staging.
Instead of sending 20 individual patches to address OOM messages, please submit a series. That makes things much easier to track in patchwork and b4.
OK, I'll repost the other patches except this one as a series.
Quoted 3 lines
Same goes for the
DEVICE_ATTR_ROchanges. One series per logical change, one patch per driver.
OK
Quoted 3 lines
Thanks!