All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: linux-media@vger.kernel.org
Subject: drivers/media/pci/saa7134/saa7134-input.c: is variable b really uninitialized in line 136 ?
Date: Sun, 06 Jul 2014 17:47:13 +0200	[thread overview]
Message-ID: <53B96F81.2060203@gmx.de> (raw)

/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


                 reply	other threads:[~2014-07-06 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B96F81.2060203@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.