All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Ye Bin" <yebin10@huawei.com>, "Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	"Hulk Robot" <hulkci@huawei.com>,
	kernel-janitors@vger.kernel.org,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 14:12:06 -0400	[thread overview]
Message-ID: <CADnq5_Os1fKouKSkfmmiWgjLxkX3FQ1Ny5Wcno7VQcheG4-26Q@mail.gmail.com> (raw)
In-Reply-To: <20210524133548.2361943-1-weiyongjun1@huawei.com>

On Mon, May 24, 2021 at 9:25 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

I don't see any other cases in this function where we return an error.
It could arguably be made a void.  All of these APCI methods are
optional.

Alex

>
> Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 49563ff87f1a..9564690b21b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
>  atcs:
>         /* Probe for ATCS, and initialize it if found */
>         atcs_handle = amdgpu_atcs_probe_handle(handle);
> -       if (!atcs_handle)
> +       if (!atcs_handle) {
> +               ret = -ENODEV;
>                 goto out;
> +       }
>
>         atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
>         if (!atcs) {
>                 DRM_WARN("Not enough memory to initialize ATCS\n");
> +               ret = -ENOMEM;
>                 goto out;
>         }
>         atcs->handle = atcs_handle;
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: "Lijo Lazar" <lijo.lazar@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	kernel-janitors@vger.kernel.org,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Hulk Robot" <hulkci@huawei.com>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Ye Bin" <yebin10@huawei.com>
Subject: Re: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 14:12:06 -0400	[thread overview]
Message-ID: <CADnq5_Os1fKouKSkfmmiWgjLxkX3FQ1Ny5Wcno7VQcheG4-26Q@mail.gmail.com> (raw)
In-Reply-To: <20210524133548.2361943-1-weiyongjun1@huawei.com>

On Mon, May 24, 2021 at 9:25 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

I don't see any other cases in this function where we return an error.
It could arguably be made a void.  All of these APCI methods are
optional.

Alex

>
> Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 49563ff87f1a..9564690b21b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
>  atcs:
>         /* Probe for ATCS, and initialize it if found */
>         atcs_handle = amdgpu_atcs_probe_handle(handle);
> -       if (!atcs_handle)
> +       if (!atcs_handle) {
> +               ret = -ENODEV;
>                 goto out;
> +       }
>
>         atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
>         if (!atcs) {
>                 DRM_WARN("Not enough memory to initialize ATCS\n");
> +               ret = -ENOMEM;
>                 goto out;
>         }
>         atcs->handle = atcs_handle;
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: "Lijo Lazar" <lijo.lazar@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	kernel-janitors@vger.kernel.org,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Hulk Robot" <hulkci@huawei.com>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Ye Bin" <yebin10@huawei.com>
Subject: Re: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 14:12:06 -0400	[thread overview]
Message-ID: <CADnq5_Os1fKouKSkfmmiWgjLxkX3FQ1Ny5Wcno7VQcheG4-26Q@mail.gmail.com> (raw)
In-Reply-To: <20210524133548.2361943-1-weiyongjun1@huawei.com>

On Mon, May 24, 2021 at 9:25 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

I don't see any other cases in this function where we return an error.
It could arguably be made a void.  All of these APCI methods are
optional.

Alex

>
> Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 49563ff87f1a..9564690b21b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
>  atcs:
>         /* Probe for ATCS, and initialize it if found */
>         atcs_handle = amdgpu_atcs_probe_handle(handle);
> -       if (!atcs_handle)
> +       if (!atcs_handle) {
> +               ret = -ENODEV;
>                 goto out;
> +       }
>
>         atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
>         if (!atcs) {
>                 DRM_WARN("Not enough memory to initialize ATCS\n");
> +               ret = -ENOMEM;
>                 goto out;
>         }
>         atcs->handle = atcs_handle;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-05-24 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 13:35 [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init() Wei Yongjun
2021-05-24 13:35 ` Wei Yongjun
2021-05-24 13:35 ` Wei Yongjun
2021-05-24 18:12 ` Alex Deucher [this message]
2021-05-24 18:12   ` Alex Deucher
2021-05-24 18:12   ` Alex Deucher

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=CADnq5_Os1fKouKSkfmmiWgjLxkX3FQ1Ny5Wcno7VQcheG4-26Q@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=Likun.Gao@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fmdefrancesco@gmail.com \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajneesh.bhardwaj@amd.com \
    --cc=weiyongjun1@huawei.com \
    --cc=yebin10@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.