All of lore.kernel.org
 help / color / mirror / Atom feed
* dib7000p_get_stats: ‘i’ is used uninitialized (was: Re: [media] dib7000p: Add DVBv5 stats support)
@ 2014-08-06 19:31 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2014-08-06 19:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Kernel Mailing List, Linux Media Mailing List

Hi Mauro,

On Wed, Aug 6, 2014 at 2:03 AM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=041ad449683bb2d54a7f082d78ec15bbc958a175
> Commit:     041ad449683bb2d54a7f082d78ec15bbc958a175
> Parent:     d44913c1e547df19b2dc0b527f92a4b4354be23a
> Refname:    refs/heads/master
> Author:     Mauro Carvalho Chehab <m.chehab@samsung.com>
> AuthorDate: Thu May 29 14:44:56 2014 -0300
> Committer:  Mauro Carvalho Chehab <m.chehab@samsung.com>
> CommitDate: Tue Jun 17 12:04:50 2014 -0300
>
>     [media] dib7000p: Add DVBv5 stats support
>
>     Adds DVBv5 stats support. For now, just mimic whatever dib8000
>     does, as they're very similar, with regards to statistics.
>
>     However, dib7000p_get_time_us() likely require some
>     adjustments, as I didn't actually reviewed the formula
>     for it to work with DVB-T. Still, better than nothing,
>     as latter patches can improve it.

Yes, it does, as its "layer" parameter is not used....

> diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c
> index d36fa0d..c41f90d 100644
> --- a/drivers/media/dvb-frontends/dib7000p.c
> +++ b/drivers/media/dvb-frontends/dib7000p.c

> +/* FIXME: may require changes - this one was borrowed from dib8000 */
> +static u32 dib7000p_get_time_us(struct dvb_frontend *demod, int layer)
> +{

[...]

> +}

> +static int dib7000p_get_stats(struct dvb_frontend *demod, fe_status_t stat)
> +{
> +       struct dib7000p_state *state = demod->demodulator_priv;
> +       struct dtv_frontend_properties *c = &demod->dtv_property_cache;
> +       int i;

[...]

> +       /* Get PER measures */
> +       if (show_per_stats) {
> +               dib7000p_read_unc_blocks(demod, &val);
> +
> +               c->block_error.stat[0].scale = FE_SCALE_COUNTER;
> +               c->block_error.stat[0].uvalue += val;
> +
> +               time_us = dib7000p_get_time_us(demod, i);

drivers/media/dvb-frontends/dib7000p.c: In function ‘dib7000p_get_stats’:
drivers/media/dvb-frontends/dib7000p.c:1972: warning: ‘i’ is used
uninitialized in this function

So far this is harmless, as the "layer" parameter isn't used, but this
deserves some cleanup.

> +               if (time_us) {
> +                       blocks = 1250000ULL * 1000000ULL;
> +                       do_div(blocks, time_us * 8 * 204);
> +                       c->block_count.stat[0].scale = FE_SCALE_COUNTER;
> +                       c->block_count.stat[0].uvalue += blocks;
> +               }
> +       }
> +       return 0;
> +}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

only message in thread, other threads:[~2014-08-06 19:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06 19:31 dib7000p_get_stats: ‘i’ is used uninitialized (was: Re: [media] dib7000p: Add DVBv5 stats support) Geert Uytterhoeven

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.