* [PATCH] si2168: Fix unknown chip version message
@ 2014-07-22 19:14 Mauro Carvalho Chehab
2014-07-23 8:22 ` Antti Palosaari
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2014-07-22 19:14 UTC (permalink / raw)
To: Antti Palosaari
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Mauro Carvalho Chehab
At least here with my PCTV 292e, it is printing this error:
si2168 10-0064: si2168: unkown chip version Si21170-
without a \n at the end. Probably because it is doing something
weird or firmware didn't load well. Anyway, better to print it
in hex, instead of using %c.
While here, fix the typo.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
drivers/media/dvb-frontends/si2168.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 41bdbc4d9f6c..842c4a555d01 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -414,9 +414,8 @@ static int si2168_init(struct dvb_frontend *fe)
break;
default:
dev_err(&s->client->dev,
- "%s: unkown chip version Si21%d-%c%c%c\n",
- KBUILD_MODNAME, cmd.args[2], cmd.args[1],
- cmd.args[3], cmd.args[4]);
+ "%s: unknown chip version: 0x%04x\n",
+ KBUILD_MODNAME, chip_id);
ret = -EINVAL;
goto err;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] si2168: Fix unknown chip version message
2014-07-22 19:14 [PATCH] si2168: Fix unknown chip version message Mauro Carvalho Chehab
@ 2014-07-23 8:22 ` Antti Palosaari
2014-07-23 13:18 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 3+ messages in thread
From: Antti Palosaari @ 2014-07-23 8:22 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
Moikka!
It is single character formatter, not string, => no need to terminate,
so that patch is not valid.
regards
Antti
On 07/22/2014 10:14 PM, Mauro Carvalho Chehab wrote:
> At least here with my PCTV 292e, it is printing this error:
>
> si2168 10-0064: si2168: unkown chip version Si21170-
>
> without a \n at the end. Probably because it is doing something
> weird or firmware didn't load well. Anyway, better to print it
> in hex, instead of using %c.
>
> While here, fix the typo.
>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
> drivers/media/dvb-frontends/si2168.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> index 41bdbc4d9f6c..842c4a555d01 100644
> --- a/drivers/media/dvb-frontends/si2168.c
> +++ b/drivers/media/dvb-frontends/si2168.c
> @@ -414,9 +414,8 @@ static int si2168_init(struct dvb_frontend *fe)
> break;
> default:
> dev_err(&s->client->dev,
> - "%s: unkown chip version Si21%d-%c%c%c\n",
> - KBUILD_MODNAME, cmd.args[2], cmd.args[1],
> - cmd.args[3], cmd.args[4]);
> + "%s: unknown chip version: 0x%04x\n",
> + KBUILD_MODNAME, chip_id);
> ret = -EINVAL;
> goto err;
> }
>
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] si2168: Fix unknown chip version message
2014-07-23 8:22 ` Antti Palosaari
@ 2014-07-23 13:18 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2014-07-23 13:18 UTC (permalink / raw)
To: Antti Palosaari; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
Em Wed, 23 Jul 2014 11:22:40 +0300
Antti Palosaari <crope@iki.fi> escreveu:
> Moikka!
> It is single character formatter, not string, => no need to terminate,
> so that patch is not valid.
Well, what happened with an invalid firmware is that the first %c was
a 0x00 character, causing that the \n at the end and the others %c
to be discarded.
In other words, if you want to print the data with %c, you should be
validating that it is a printable character before using %c.
On a separate issue, it is not "unkown" but "unknown".
Regards,
Mauro
>
> regards
> Antti
>
>
> On 07/22/2014 10:14 PM, Mauro Carvalho Chehab wrote:
> > At least here with my PCTV 292e, it is printing this error:
> >
> > si2168 10-0064: si2168: unkown chip version Si21170-
> >
> > without a \n at the end. Probably because it is doing something
> > weird or firmware didn't load well. Anyway, better to print it
> > in hex, instead of using %c.
> >
> > While here, fix the typo.
> >
> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> > ---
> > drivers/media/dvb-frontends/si2168.c | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> > index 41bdbc4d9f6c..842c4a555d01 100644
> > --- a/drivers/media/dvb-frontends/si2168.c
> > +++ b/drivers/media/dvb-frontends/si2168.c
> > @@ -414,9 +414,8 @@ static int si2168_init(struct dvb_frontend *fe)
> > break;
> > default:
> > dev_err(&s->client->dev,
> > - "%s: unkown chip version Si21%d-%c%c%c\n",
> > - KBUILD_MODNAME, cmd.args[2], cmd.args[1],
> > - cmd.args[3], cmd.args[4]);
> > + "%s: unknown chip version: 0x%04x\n",
> > + KBUILD_MODNAME, chip_id);
> > ret = -EINVAL;
> > goto err;
> > }
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-23 13:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22 19:14 [PATCH] si2168: Fix unknown chip version message Mauro Carvalho Chehab
2014-07-23 8:22 ` Antti Palosaari
2014-07-23 13:18 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).