All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Srinivasa.Deevi@conexant.com
Cc: linux-media@vger.kernel.org
Subject: smatch report: cx231xx: incorrect check in cx231xx_write_i2c_data()
Date: Thu, 23 Dec 2010 19:43:47 +0300	[thread overview]
Message-ID: <20101223164347.GA16612@bicker> (raw)

Hi,

I was doing an audit and I came across this.

drivers/media/video/cx231xx/cx231xx-core.c +1644 cx231xx_write_i2c_data(14)
	warn: 'saddr_len' is non-zero. Did you mean 'saddr'

  1642          if (saddr_len == 0)
  1643                  saddr = 0;
  1644          else if (saddr_len == 0)
  1645                  saddr &= 0xff;

We check "saddr_len == 0" twice which doesn't make sense.  I'm not sure
what the correct fix is though.  It's been this way since the driver was
merged.

regards,
dan carpenter

             reply	other threads:[~2010-12-23 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23 16:43 Dan Carpenter [this message]
2010-12-23 18:34 ` smatch report: cx231xx: incorrect check in cx231xx_write_i2c_data() Andy Walls
2010-12-23 18:55   ` Dan Carpenter
     [not found]   ` <34B38BE41EDBA046A4AFBB591FA311320249B057C6@NBMBX01.bbnet.ad>
2010-12-23 19:38     ` [patch] [media] cx231xxx: fix typo in saddr_len check Dan Carpenter
2010-12-23 19:40       ` Sri Deevi

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=20101223164347.GA16612@bicker \
    --to=error27@gmail.com \
    --cc=Srinivasa.Deevi@conexant.com \
    --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.