From: "Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com> To: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>, "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Cc: "Wentland, Harry" <Harry.Wentland@amd.com>, "Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>, "Deucher, Alexander" <Alexander.Deucher@amd.com>, "Koenig, Christian" <Christian.Koenig@amd.com>, "Zhou, David(ChunMing)" <David1.Zhou@amd.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com> Subject: [PATCH] drm/amdgpu: Initialize variable before use Date: Mon, 30 Sep 2019 20:09:13 +0000 [thread overview] Message-ID: <20190930200902.inmjn264l6pxcdsq@outlook.office365.com> (raw) [-- Attachment #1: Type: text/plain, Size: 1445 bytes --] The 'debug_data' variable gets printed in debug statements without a prior initialization in the function hubbub1_verify_allow_pstate_change_high, as reported when building with gcc 9.1.0: warning: ‘debug_data’ may be used uninitialized in this function [-Wmaybe-uninitialized] 290 | printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) | ^~~~~~ dc/dcn10/dcn10_hubbub.c:134:15: note: ‘debug_data’ was declared here 134 | unsigned int debug_data; Note that initialize debug_data with 0, in this case, is safe because we have a loop in a few lines below that will initialize this variable with the proper value. Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c index a780057e2dbc..b6967a7e6c7b 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c @@ -133,7 +133,7 @@ bool hubbub1_verify_allow_pstate_change_high( static unsigned int max_sampled_pstate_wait_us; /* data collection */ static bool forced_pstate_allow; /* help with revert wa */ - unsigned int debug_data; + unsigned int debug_data = 0; unsigned int i; if (forced_pstate_allow) { -- 2.23.0 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: "Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com> To: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>, "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Cc: "Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>, "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>, David Airlie <airlied@linux.ie>, "Deucher, Alexander" <Alexander.Deucher@amd.com>, "Koenig, Christian" <Christian.Koenig@amd.com> Subject: [PATCH] drm/amdgpu: Initialize variable before use Date: Mon, 30 Sep 2019 20:09:13 +0000 [thread overview] Message-ID: <20190930200902.inmjn264l6pxcdsq@outlook.office365.com> (raw) [-- Attachment #1.1: Type: text/plain, Size: 1445 bytes --] The 'debug_data' variable gets printed in debug statements without a prior initialization in the function hubbub1_verify_allow_pstate_change_high, as reported when building with gcc 9.1.0: warning: ‘debug_data’ may be used uninitialized in this function [-Wmaybe-uninitialized] 290 | printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) | ^~~~~~ dc/dcn10/dcn10_hubbub.c:134:15: note: ‘debug_data’ was declared here 134 | unsigned int debug_data; Note that initialize debug_data with 0, in this case, is safe because we have a loop in a few lines below that will initialize this variable with the proper value. Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c index a780057e2dbc..b6967a7e6c7b 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c @@ -133,7 +133,7 @@ bool hubbub1_verify_allow_pstate_change_high( static unsigned int max_sampled_pstate_wait_us; /* data collection */ static bool forced_pstate_allow; /* help with revert wa */ - unsigned int debug_data; + unsigned int debug_data = 0; unsigned int i; if (forced_pstate_allow) { -- 2.23.0 [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2019-09-30 20:38 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-30 20:09 Siqueira, Rodrigo [this message] 2019-09-30 20:09 ` [PATCH] drm/amdgpu: Initialize variable before use Siqueira, Rodrigo 2019-10-02 13:41 ` 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=20190930200902.inmjn264l6pxcdsq@outlook.office365.com \ --to=rodrigo.siqueira@amd.com \ --cc=Alexander.Deucher@amd.com \ --cc=Christian.Koenig@amd.com \ --cc=David1.Zhou@amd.com \ --cc=Harry.Wentland@amd.com \ --cc=Nicholas.Kazlauskas@amd.com \ --cc=Sunpeng.Li@amd.com \ --cc=airlied@linux.ie \ --cc=amd-gfx@lists.freedesktop.org \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe 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.