On 22/07/13 11:45, Chen Gang wrote: > Need add related 'default' processing contents for 'switch', or may > report 'wm' uninitialized warning. > > The related warning: > > drivers/video/i740fb.c:662:26: warning: ‘wm’ may be used uninitialized in this function [-Wmaybe-uninitialized] > > > Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx> > --- > drivers/video/i740fb.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c > index 6c48388..e82e767 100644 > --- a/drivers/video/i740fb.c > +++ b/drivers/video/i740fb.c > @@ -336,6 +336,9 @@ static u32 i740_calc_fifo(struct i740fb_par *par, u32 freq, int bpp) > wm = 0x16110000; > } > break; > + default: > + wm = 0; > + BUG(); > } I don't think you should use BUG there. BUG should be used when there's not really a good way to continue. Here you could have just a WARN, and return some default FIFO watermark value. Tomi
Attachment:
signature.asc
Description: OpenPGP digital signature