drm/edid: Fix uninitialized variable in drm_cvt_modes()
Subsystems (3)
PATCH v3 1/1 drm/edid: Fix uninitialized variable in drm_cvt_modes()
Noticed this when trying to compile with -Wall on a kernel fork. We potentially don't set width here, which causes the compiler to complain about width potentially being uninitialized in drm_cvt_modes(). So, let's fix that.
Changes since v1:
* Don't emit an error as this code isn't reachable, just mark it as such Changes since v2:
* Remove now unused variable
--- drivers/gpu/drm/drm_edid.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_edid.c +2 -0
@@ -3114,6 +3114,8 @@ static int drm_cvt_modes(struct drm_connector *connector,case 0x0c : width = height *15 /9 ;break ; +default : +unreachable (); }for (j =1 ; j <5 ; j++) {
Signature · 1 line
2.28.0
Quoted 10 lines · Lyude Paul
Noticed this when trying to compile with -Wall on a kernel fork. We potentially don't set width here, which causes the compiler to complain about width potentially being uninitialized in
drm_cvt_modes(). So, let's fix that.Changes since v1:
* Don't emit an error as this code isn't reachable, just mark it as such Changes since v2:
* Remove now unused variable
Quoted 5 lines
Signed-off-by Lyude Paul <[email protected]>Cc <[email protected]> # v5.9+Fixes 3f649ab728cd ("treewide: Remove uninitialized_var() usage")Signed-off-by Lyude Paul <[email protected]>
For the very little it's worth,
Quoted 18 lines
--- drivers/gpu/drm/drm_edid.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/drm_edid.c +2
-1@@ -3114,6 +3114,8 @@ static int drm_cvt_modes(struct drm_connector *connector,case 0x0c : width = height *15 /9 ;break ; +default : +unreachable (); }for (j =1 ; j <5 ; j++) { --
Quoted 2 lines
2.28.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel