All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jinpu Wang <jinpu.wang@ionos.com>
To: Zhen Lei <thunder.leizhen@huawei.com>
Cc: Jack Wang <jinpu.wang@cloud.ionos.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] scsi: pm8001: remove unnecessary oom message
Date: Thu, 10 Jun 2021 11:50:35 +0200	[thread overview]
Message-ID: <CAMGffE=BmTR4EXmGmbKTpRJ=M8tc3eW4qvH7qtQCP9Wi5NnKVA@mail.gmail.com> (raw)
In-Reply-To: <20210610094605.16672-2-thunder.leizhen@huawei.com>

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

  reply	other threads:[~2021-06-10  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-06-16  2:48   ` Martin K. Petersen
2021-06-16  3:11     ` Leizhen (ThunderTown)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMGffE=BmTR4EXmGmbKTpRJ=M8tc3eW4qvH7qtQCP9Wi5NnKVA@mail.gmail.com' \
    --to=jinpu.wang@ionos.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=thunder.leizhen@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.