From: Fengguang Wu <fengguang.wu@intel.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: kbuild-all@01.org, linux-media <linux-media@vger.kernel.org>
Subject: [PATCH] r820t: quiet gcc warning on n_ring
Date: Sat, 20 Apr 2013 18:02:16 +0800 [thread overview]
Message-ID: <20130420100216.GB24551@localhost> (raw)
In-Reply-To: <20130418105241.5e1dcea6@redhat.com>
drivers/media/tuners/r820t.c: In function 'r820t_imr':
drivers/media/tuners/r820t.c:1871:8: warning: 'n_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
Mauro: This is a FALSE POSITIVE: the loop will always return a value
for n_ring, as the last test will fill it with 15, if the loop fails.
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
drivers/media/tuners/r820t.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index fa2e9ae..a975ffe 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -1852,15 +1852,12 @@ static int r820t_imr(struct r820t_priv *priv, unsigned imr_mem, bool im_flag)
else
ring_ref = priv->cfg->xtal;
+ n_ring = 15;
for (n = 0; n < 16; n++) {
if ((16 + n) * 8 * ring_ref >= 3100000) {
n_ring = n;
break;
}
-
- /* n_ring not found */
- if (n == 15)
- n_ring = n;
}
reg18 = r820t_read_cache_reg(priv, 0x18);
--
1.7.10.4
parent reply other threads:[~2013-04-20 10:02 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20130418105241.5e1dcea6@redhat.com>]
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=20130420100216.GB24551@localhost \
--to=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/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.