Message ID | 1406056450-16031-1-git-send-email-m.chehab@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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; > } >
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; > > } > > > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; }
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(-)