Skip to contentSkip to conversation

scsi: pm8001: remove unnecessary oom message

PATCH Applied Zhen Lei 3 participants 5 messages Jun 10, 2021 – Jun 16, 2021

Subsystems (2)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

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
author
#1 lore raw

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
index 6860d5a9ef83b44..6f33d821e5453d1 100644
@@ -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
Acked-by on v2 1/1
#2 lore raw
Quoted 9 lines · Zhen Lei

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".

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
index 6860d5a9ef83b44..6f33d821e5453d1 100644
@@ -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

#3 lore raw
In reply to Zhen Lei

Zhen,

Quoted 2 lines

Fixes scripts/checkpatch.pl warning:
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
#4 lore raw
Quoted 11 lines · Martin K. Petersen

Zhen,

Quoted 2 lines

Fixes scripts/checkpatch.pl warning:
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.

OK, I'll repost the other patches except this one as a series.

Quoted 3 lines

Same goes for the DEVICE_ATTR_RO changes. One series per logical change, one patch per driver.

OK

Quoted 3 lines

Thanks!