* [PATCH v2 0/1] scsi: pm8001: remove unnecessary oom message
@ 2021-06-10 9:46 Zhen Lei
2021-06-10 9:46 ` [PATCH v2 1/1] " Zhen Lei
0 siblings, 1 reply; 5+ messages in thread
From: Zhen Lei @ 2021-06-10 9:46 UTC (permalink / raw)
To: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi
Cc: Zhen Lei
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(-)
--
2.26.0.106.g9fadedd
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/1] scsi: pm8001: remove unnecessary oom message
2021-06-10 9:46 [PATCH v2 0/1] scsi: pm8001: remove unnecessary oom message Zhen Lei
@ 2021-06-10 9:46 ` Zhen Lei
2021-06-10 9:50 ` Jinpu Wang
2021-06-16 2:48 ` Martin K. Petersen
0 siblings, 2 replies; 5+ messages in thread
From: Zhen Lei @ 2021-06-10 9:46 UTC (permalink / raw)
To: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi
Cc: 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".
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/scsi/pm8001/pm8001_sas.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 6860d5a9ef83b44..6f33d821e5453d1 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] scsi: pm8001: remove unnecessary oom message
2021-06-10 9:46 ` [PATCH v2 1/1] " Zhen Lei
@ 2021-06-10 9:50 ` Jinpu Wang
2021-06-16 2:48 ` Martin K. Petersen
1 sibling, 0 replies; 5+ messages in thread
From: Jinpu Wang @ 2021-06-10 9:50 UTC (permalink / raw)
To: Zhen Lei
Cc: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi
On Thu, Jun 10, 2021 at 11:46 AM Zhen Lei <thunder.leizhen@huawei.com> wrote:
>
> 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".
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Thx.
> ---
> drivers/scsi/pm8001/pm8001_sas.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index 6860d5a9ef83b44..6f33d821e5453d1 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] scsi: pm8001: remove unnecessary oom message
2021-06-10 9:46 ` [PATCH v2 1/1] " Zhen Lei
2021-06-10 9:50 ` Jinpu Wang
@ 2021-06-16 2:48 ` Martin K. Petersen
2021-06-16 3:11 ` Leizhen (ThunderTown)
1 sibling, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2021-06-16 2:48 UTC (permalink / raw)
To: Zhen Lei
Cc: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi
Zhen,
> 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!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] scsi: pm8001: remove unnecessary oom message
2021-06-16 2:48 ` Martin K. Petersen
@ 2021-06-16 3:11 ` Leizhen (ThunderTown)
0 siblings, 0 replies; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-06-16 3:11 UTC (permalink / raw)
To: Martin K. Petersen; +Cc: Jack Wang, James E . J . Bottomley, linux-scsi
On 2021/6/16 10:48, Martin K. Petersen wrote:
>
> Zhen,
>
>> 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.
>
> Same goes for the DEVICE_ATTR_RO changes. One series per logical change,
> one patch per driver.
OK
>
> Thanks!
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-16 3:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 9:46 [PATCH v2 0/1] scsi: pm8001: remove unnecessary oom message Zhen Lei
2021-06-10 9:46 ` [PATCH v2 1/1] " Zhen Lei
2021-06-10 9:50 ` Jinpu Wang
2021-06-16 2:48 ` Martin K. Petersen
2021-06-16 3:11 ` Leizhen (ThunderTown)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.