lkml.org 
[lkml]   [2015]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/1] i2c: taos-evm: replace simple_strtoul by kstrtou8
Hi Andy,

On Wed, 18 Nov 2015 18:26:25 +0200, Andy Shevchenko wrote:
> On Wed, Nov 18, 2015 at 2:55 PM, LABBE Corentin
> <clabbe.montjoie@gmail.com> wrote:
> > The simple_strtoul function is marked as obsolete.
> > This patch replace it by kstrtou8.
> >
>
> Only one concern. simple_strto* goes through the string until it has
> an invalid character or \0. In your case kstrtou8 will fail the
> transfer. So, is there possible cases when HW returns such data?

It's not supposed to happen.

> And just a style nitpicks below.
>
> > if (p[0] == 'x') {
> > - data->byte = simple_strtol(p + 1, NULL, 16);
> > + /*
> > + * voluntarily dropping error code of kstrtou8 since all
>
> -> Voluntarily…
>
> > + * error code that it could return are invalid according
> > + * to Documentation/i2c/fault-codes
>
> -> …codes.
>
> > + */
> > + if (kstrtou8(p + 1, 16, &data->byte))
> > + return -EPROTO;
>


--
Jean Delvare
SUSE L3 Support


\
 
 \ /
  Last update: 2015-11-21 21:21    [W:0.070 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site