Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
On Tuesday, February 23rd, 2021 at 6:42 PM, Alex Deucher wrote: > yeah, fdo ran out of disk space so I moved to gitlab: > > https://gitlab.freedesktop.org/agd5f/linux/-/commits/drm-next Ah, thanks for the info, my bad! ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
I think Alex moved to gitlab for his branches On Tue, Feb 23, 2021, 12:50 AM Simon Ser wrote: > On Tuesday, February 23rd, 2021 at 12:44 AM, Nathan Chancellor < > nat...@kernel.org> wrote: > > > On Mon, Feb 22, 2021 at 11:05:17PM +, Simon Ser wrote: > > > On Monday, February 22nd, 2021 at 8:25 PM, Souptick Joarder < > jrdr.li...@gmail.com> wrote: > > > > > > > >> > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: > > > > >> warning: variable 'i' is uninitialized when used here > > > > >> [-Wuninitialized] > > > >timing = >detailed_timings[i]; > > > > ^ > > > > > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: > > > > note: initialize the variable 'i' to silence this warning > > > >int i; > > > > ^ > > > > = 0 > > > >1 warning generated. > > > > > > > > Initialize the variable 'i'. > > > > > > Hm, I see this variable already initialized in the loop: > > > > > > for (i = 0; i < 4; i++) { > > > > > > This is the branch agd5f/drm-next. > > > > That is in the > > > > if (amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_DISPLAY_PORT > > || amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_EDP) { > > > > branch not the > > > > } else if (edid && amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_HDMI_TYPE_A) { > > > > branch, where i is indeed used uninitialized like clang complains about. > > > > I am not at all familiar with the code so I cannot say if this fix is > > the proper one but it is definitely a legitimate issue. > > I think you have an outdated branch. In my checkout, i is not used in the > first > branch, and is initialized in the second one. > > > https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c?h=drm-next#n9700 > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
On Mon, Feb 22, 2021 at 11:50:06PM +, Simon Ser wrote: > On Tuesday, February 23rd, 2021 at 12:44 AM, Nathan Chancellor > wrote: > > > On Mon, Feb 22, 2021 at 11:05:17PM +, Simon Ser wrote: > > > On Monday, February 22nd, 2021 at 8:25 PM, Souptick Joarder > > > wrote: > > > > > > > >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: > > > > >> warning: variable 'i' is uninitialized when used here > > > > >> [-Wuninitialized] > > > >timing = >detailed_timings[i]; > > > > ^ > > > >drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: > > > > note: initialize the variable 'i' to silence this warning > > > >int i; > > > > ^ > > > > = 0 > > > >1 warning generated. > > > > > > > > Initialize the variable 'i'. > > > > > > Hm, I see this variable already initialized in the loop: > > > > > > for (i = 0; i < 4; i++) { > > > > > > This is the branch agd5f/drm-next. > > > > That is in the > > > > if (amdgpu_dm_connector->dc_sink->sink_signal == > > SIGNAL_TYPE_DISPLAY_PORT > > || amdgpu_dm_connector->dc_sink->sink_signal == > > SIGNAL_TYPE_EDP) { > > > > branch not the > > > > } else if (edid && amdgpu_dm_connector->dc_sink->sink_signal == > > SIGNAL_TYPE_HDMI_TYPE_A) { > > > > branch, where i is indeed used uninitialized like clang complains about. > > > > I am not at all familiar with the code so I cannot say if this fix is > > the proper one but it is definitely a legitimate issue. > > I think you have an outdated branch. In my checkout, i is not used in the > first > branch, and is initialized in the second one. > > https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c?h=drm-next#n9700 That branch is the outdated one: https://git.kernel.org/linus/a897913a819191550ab2fa2784d3c3ada3a096d3 Please see: https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c#L9854 It was introduced by commit f9b4f20c4777 ("drm/amd/display: Add Freesync HDMI support to DM"). Cheers, Nathan ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
On Tuesday, February 23rd, 2021 at 12:44 AM, Nathan Chancellor wrote: > On Mon, Feb 22, 2021 at 11:05:17PM +, Simon Ser wrote: > > On Monday, February 22nd, 2021 at 8:25 PM, Souptick Joarder > > wrote: > > > > > >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: > > > >> warning: variable 'i' is uninitialized when used here > > > >> [-Wuninitialized] > > >timing = >detailed_timings[i]; > > > ^ > > >drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: > > > note: initialize the variable 'i' to silence this warning > > >int i; > > > ^ > > > = 0 > > >1 warning generated. > > > > > > Initialize the variable 'i'. > > > > Hm, I see this variable already initialized in the loop: > > > > for (i = 0; i < 4; i++) { > > > > This is the branch agd5f/drm-next. > > That is in the > > if (amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_DISPLAY_PORT > || amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_EDP) { > > branch not the > > } else if (edid && amdgpu_dm_connector->dc_sink->sink_signal == > SIGNAL_TYPE_HDMI_TYPE_A) { > > branch, where i is indeed used uninitialized like clang complains about. > > I am not at all familiar with the code so I cannot say if this fix is > the proper one but it is definitely a legitimate issue. I think you have an outdated branch. In my checkout, i is not used in the first branch, and is initialized in the second one. https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c?h=drm-next#n9700 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
On Mon, Feb 22, 2021 at 11:05:17PM +, Simon Ser wrote: > On Monday, February 22nd, 2021 at 8:25 PM, Souptick Joarder > wrote: > > > >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: > > >> warning: variable 'i' is uninitialized when used here > > >> [-Wuninitialized] > >timing = >detailed_timings[i]; > > ^ > >drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: > > note: initialize the variable 'i' to silence this warning > >int i; > > ^ > > = 0 > >1 warning generated. > > > > Initialize the variable 'i'. > > Hm, I see this variable already initialized in the loop: > > for (i = 0; i < 4; i++) { > > This is the branch agd5f/drm-next. That is in the if (amdgpu_dm_connector->dc_sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT || amdgpu_dm_connector->dc_sink->sink_signal == SIGNAL_TYPE_EDP) { branch not the } else if (edid && amdgpu_dm_connector->dc_sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) { branch, where i is indeed used uninitialized like clang complains about. I am not at all familiar with the code so I cannot say if this fix is the proper one but it is definitely a legitimate issue. Cheers, Nathan > > Reported-by: kernel test robot > > Signed-off-by: Souptick Joarder > > --- > > 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 a22a53d..e96d3d9 100644 > > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > > @@ -9717,7 +9717,7 @@ static bool parse_hdmi_amd_vsdb(struct > > amdgpu_dm_connector *aconnector, > > void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, > > struct edid *edid) > > { > > - int i; > > + int i = 0; > > struct detailed_timing *timing; > > struct detailed_non_pixel *data; > > struct detailed_data_monitor_range *range; > > -- > > 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/display: initialize the variable 'i'
On Monday, February 22nd, 2021 at 8:25 PM, Souptick Joarder wrote: > >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: > >> warning: variable 'i' is uninitialized when used here > >> [-Wuninitialized] >timing = >detailed_timings[i]; > ^ >drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: > note: initialize the variable 'i' to silence this warning >int i; > ^ > = 0 >1 warning generated. > > Initialize the variable 'i'. Hm, I see this variable already initialized in the loop: for (i = 0; i < 4; i++) { This is the branch agd5f/drm-next. > Reported-by: kernel test robot > Signed-off-by: Souptick Joarder > --- > 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 a22a53d..e96d3d9 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -9717,7 +9717,7 @@ static bool parse_hdmi_amd_vsdb(struct > amdgpu_dm_connector *aconnector, > void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, > struct edid *edid) > { > - int i; > + int i = 0; > struct detailed_timing *timing; > struct detailed_non_pixel *data; > struct detailed_data_monitor_range *range; > -- > 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amdgpu/display: initialize the variable 'i'
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9804:38: >> warning: variable 'i' is uninitialized when used here >> [-Wuninitialized] timing = >detailed_timings[i]; ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9714:7: note: initialize the variable 'i' to silence this warning int i; ^ = 0 1 warning generated. Initialize the variable 'i'. Reported-by: kernel test robot Signed-off-by: Souptick Joarder --- 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 a22a53d..e96d3d9 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9717,7 +9717,7 @@ static bool parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector, void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, struct edid *edid) { - int i; + int i = 0; struct detailed_timing *timing; struct detailed_non_pixel *data; struct detailed_data_monitor_range *range; -- 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx