[media] budget-av: only use t_state if initialized
authorPaul Bolle <pebolle@tiscali.nl>
Thu, 1 Nov 2012 19:24:30 +0000 (16:24 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 20:25:11 +0000 (18:25 -0200)
Building budget-av.o triggers this GCC warning:
    In file included from drivers/media/pci/ttpci/budget-av.c:44:0:
    drivers/media/dvb-frontends/tda8261_cfg.h: In function ‘tda8261_get_bandwidth’:
    drivers/media/dvb-frontends/tda8261_cfg.h:68:21: warning: ‘t_state.bandwidth’ may be used uninitialized in this function [-Wuninitialized]
Move the printk() that uses t_state.bandwith to the location where it
should be initialized to fix this.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb-frontends/tda8261_cfg.h

index 1af1ee49b5421d07bef42a59fe19fffefb4722b0..46710744173beac68dc7998608876c8801c2e4d6 100644 (file)
@@ -78,7 +78,7 @@ static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
                        return err;
                }
                *bandwidth = t_state.bandwidth;
+               printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
        }
-       printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
        return 0;
 }