All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi: pm8001: remove unnecessary oom message
@ 2021-06-10  8:20 Zhen Lei
  2021-06-10  8:59 ` Jinpu Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2021-06-10  8:20 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.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/scsi/pm8001/pm8001_sas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 6860d5a9ef83b44..fff01a6effc4dab 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");
+	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;
-- 
2.26.0.106.g9fadedd



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] scsi: pm8001: remove unnecessary oom message
  2021-06-10  8:20 [PATCH 1/1] scsi: pm8001: remove unnecessary oom message Zhen Lei
@ 2021-06-10  8:59 ` Jinpu Wang
  2021-06-10  9:18   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 3+ messages in thread
From: Jinpu Wang @ 2021-06-10  8:59 UTC (permalink / raw)
  To: Zhen Lei
  Cc: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi

On Thu, Jun 10, 2021 at 10:20 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.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/scsi/pm8001/pm8001_sas.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index 6860d5a9ef83b44..fff01a6effc4dab 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");
> +       if (!mem_virt_alloc)
>                 return -1;
> -       }
while you are at it, can you also fix the return code to -ENOMEM


Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] scsi: pm8001: remove unnecessary oom message
  2021-06-10  8:59 ` Jinpu Wang
@ 2021-06-10  9:18   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2021-06-10  9:18 UTC (permalink / raw)
  To: Jinpu Wang
  Cc: Jack Wang, James E . J . Bottomley, Martin K . Petersen, linux-scsi



On 2021/6/10 16:59, Jinpu Wang wrote:
> On Thu, Jun 10, 2021 at 10:20 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.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  drivers/scsi/pm8001/pm8001_sas.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
>> index 6860d5a9ef83b44..fff01a6effc4dab 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");
>> +       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.

> 
> 
> Thanks.
> 
> .
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-10  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  8:20 [PATCH 1/1] scsi: pm8001: remove unnecessary oom message Zhen Lei
2021-06-10  8:59 ` Jinpu Wang
2021-06-10  9:18   ` 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.