Skip to content

Commit

Permalink
[media] r820t: quiet gcc warning on n_ring
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Fengguang Wu authored and Mauro Carvalho Chehab committed Apr 25, 2013
1 parent ef0c870 commit 619ab8f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/media/tuners/r820t.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,15 +1854,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);
Expand Down

0 comments on commit 619ab8f

Please sign in to comment.