From: "Christian König" <christian.koenig@amd.com>
To: Furquan Shaikh <furquan@google.com>,
Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Alex Deucher <alexander.deucher@amd.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
Stylon Wang <stylon.wang@amd.com>, Roman Li <roman.li@amd.com>,
Mikita Lipski <mikita.lipski@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, adurbin@google.com,
deepak.sharma@amd.com
Subject: Re: [PATCH] drivers: gpu: amd: Initialize amdgpu_dm_backlight_caps object to 0 in amdgpu_dm_update_backlight_caps
Date: Thu, 20 Aug 2020 09:16:42 +0200 [thread overview]
Message-ID: <4ec56556-299b-31e0-e639-b96e1666b215@amd.com> (raw)
In-Reply-To: <20200820052600.3069895-1-furquan@google.com>
Am 20.08.20 um 07:26 schrieb Furquan Shaikh:
> In `amdgpu_dm_update_backlight_caps()`, there is a local
> `amdgpu_dm_backlight_caps` object that is filled in by
> `amdgpu_acpi_get_backlight_caps()`. However, this object is
> uninitialized before the call and hence the subsequent check for
> aux_support can fail since it is not initialized by
> `amdgpu_acpi_get_backlight_caps()` as well. This change initializes
> this local `amdgpu_dm_backlight_caps` object to 0.
>
> Signed-off-by: Furquan Shaikh <furquan@google.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e4b33c67b634..725d8af634ee 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2853,7 +2853,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
> static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm)
> {
> #if defined(CONFIG_ACPI)
> - struct amdgpu_dm_backlight_caps caps;
> + struct amdgpu_dm_backlight_caps caps = { 0 };
Please use memset instead of "{ 0 }" for initialization.
Christian.
>
> if (dm->backlight_caps.caps_valid)
> return;
next prev parent reply other threads:[~2020-08-20 7:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 5:26 [PATCH] drivers: gpu: amd: Initialize amdgpu_dm_backlight_caps object to 0 in amdgpu_dm_update_backlight_caps Furquan Shaikh
2020-08-20 7:16 ` Christian König [this message]
2020-08-20 7:52 ` [PATCH v2] " Furquan Shaikh
2020-08-20 9:01 ` Christian König
2020-08-20 18:20 ` 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=4ec56556-299b-31e0-e639-b96e1666b215@amd.com \
--to=christian.koenig@amd.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=adurbin@google.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=deepak.sharma@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=furquan@google.com \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikita.lipski@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=roman.li@amd.com \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).