On Sun, Dec 20, 2009 at 09:03:27AM +0200, Marin Mitov wrote: > Hello all, > > Silancing a false positive: > warning: 'width' may be used uninitialized in this function > drivers/gpu/drm/drm_edid.c
Is it guaranteed that the switch will always see a value covered by the four cases it has? If not width would be used without having been initialised. Perhaps adding default: BUG(); would be worthwhile? > > Signed-off-by: Marin Mitov <mi...@issp.bas.bg> > ========================================================================== > --- a/drivers/gpu/drm/drm_edid.c 2009-12-20 07:43:57.000000000 +0200 > +++ b/drivers/gpu/drm/drm_edid.c 2009-12-20 07:45:49.000000000 +0200 > @@ -913,7 +913,7 @@ > const int rates[] = { 60, 85, 75, 60, 50 }; > > for (i = 0; i < 4; i++) { > - int width, height; > + int uninitialized_var(width), height; > cvt = &(timing->data.other_data.data.cvt[i]); > > height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 8) + 1) * 2; > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel