Skip to contentSkip to conversation

scsi: pm8001: remove unnecessary oom message

PATCH In review Zhen Lei 2 participants 3 messages Jun 10, 2021

Subsystems (2)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

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

---
 drivers/scsi/pm8001/pm8001_sas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/pm8001/pm8001_sas.c +1 -3
index 6860d5a9ef83b44..fff01a6effc4dab 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");
+	if (!mem_virt_alloc)
 		return -1;
-	}
 	*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
#1 lore raw
Quoted 16 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.

---
 drivers/scsi/pm8001/pm8001_sas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/pm8001/pm8001_sas.c +0 -0
index 6860d5a9ef83b44..fff01a6effc4dab 100644

drivers/scsi/pm8001/pm8001_sas.c int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr, · line 124

Quoted 8 lines
drivers/scsi/pm8001/pm8001_sas.c +1 -3
@@ -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");
+       if (!mem_virt_alloc)
                return -1;
-       }

while you are at it, can you also fix the return code to -ENOMEM

Thanks.

#2 lore raw
Quoted 12 lines · Jinpu Wang
Quoted 11 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.

---
 drivers/scsi/pm8001/pm8001_sas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 14 lines

drivers/scsi/pm8001/pm8001_sas.c int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr, · line 124

Quoted 13 lines
drivers/scsi/pm8001/pm8001_sas.c +1 -3
index 6860d5a9ef83b44..fff01a6effc4dab 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");
+       if (!mem_virt_alloc)
                return -1;
-       }

while you are at it, can you also fix the return code to -ENOMEM

OK, I will update it.

Quoted 6 lines

Thanks.

.