All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/media/pci/saa7134/saa7134-input.c: is variable b really uninitialized in line 136 ?
@ 2014-07-06 15:47 Toralf Förster
  0 siblings, 0 replies; only message in thread
From: Toralf Förster @ 2014-07-06 15:47 UTC (permalink / raw)
  To: linux-media

/me wonders if cppcheck is right here :

static int get_key_flydvb_trio(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
{
        int gpio;
        int attempt = 0;
        unsigned char b;

        /* We need this to access GPI Used by the saa_readl macro. */
        struct saa7134_dev *dev = ir->c->adapter->algo_data;

        if (dev == NULL) {
                i2cdprintk("get_key_flydvb_trio: "
                           "ir->c->adapter->algo_data is NULL!\n");
                return -EIO;
        }

        /* rising SAA7134_GPIGPRESCAN reads the status */
        saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);
        saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN);

        gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);

        if (0x40000 & ~gpio)
                return 0; /* No button press */

        /* No button press - only before first key pressed */
        if (b == 0xFF)                                                           <--- Uninitialized variable: b
                return 0;

        /* poll IR chip */
        /* weak up the IR chip */
        b = 0;

 
-- 
Toralf


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-06 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-06 15:47 drivers/media/pci/saa7134/saa7134-input.c: is variable b really uninitialized in line 136 ? Toralf Förster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.