build warning in radeon/atombios_crtc.c: pll' may be used uninitialized
Subsystems (2)
Hi,
seen with gcc 4.3.4 in current git (although 2.6.34 should show that too):
drivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this function
It seems to require a 'make CONFIG_DEBUG_SECTION_MISMATCH=y' to trigger this warning; don't know why.
Perhaps add a 'default:' case to the switch block?
Signature · 3 lines
Stefan Richter -=====-==-=- -=-= ==--= http://arcgraph.de/sr/
Quoted 5 lines · Stefan Richter
Hi,
seen with gcc 4.3.4 in current git (although 2.6.34 should show that too):
Quoted 7 lines
drivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this functionIt seems to require a 'make
CONFIG_DEBUG_SECTION_MISMATCH=y' to trigger this warning; don't know why.Perhaps add a 'default:' case to the switch block?
Adding a default to the last case should be fine.
Alex
Quoted 6 lines
--
Stefan Richter
-=====-==-=- -=-= ==--=
http://arcgraph.de/sr/
PATCH 1/1 drm/radeon/kms: suppress a build warning (unused variable)
At least 'make CONFIG_DEBUG_SECTION_MISMATCH=y' causes
drivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':
drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this function
which has the looks of a falso positive.
Add a default: case so that gcc rests assured that all possible pll_id's are covered. Keep the present cases that fall through to the default one for self-documentation.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +1 -0
@@ -707,6 +707,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_modebreak ;case ATOM_DCPLL :case ATOM_PPLL_INVALID : +default : pll = &rdev->clock.dcpll;break ; }
Signature · 3 lines
Stefan Richter -=====-==-=- -=-= ==--= http://arcgraph.de/sr/
Re: [PATCH] drm/radeon/kms: suppress a build warning (unused variable)
Quoted 9 lines · Stefan Richter
At least 'make
CONFIG_DEBUG_SECTION_MISMATCH=y' causesdrivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':
drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this function which has the looks of a falso positive.Add a default: case so that gcc rests assured that all possible pll_id's are covered. Keep the present cases that fall through to the default one for self-documentation.
Signed-off-by Stefan Richter <[email protected]>
looks good.
Quoted 22 lines
---
drivers/gpu/drm/radeon/atombios_crtc.c | 1 +1 files changed, 1 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/atombios_crtc.c +0
-0@@ -707,6 +707,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode break;case
ATOM_DCPLL:
caseATOM_PPLL_INVALID:
+ default:
pll =&rdev->clock.dcpll;
break;
}
--
Stefan Richter
-=====-==-=- -=-= ==--=
http://arcgraph.de/sr/