lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vepu9=DjsV2JdR2pRMQw+0GJTJktudg44GnCgbms0B7mw@mail.gmail.com>
Date:	Wed, 18 Nov 2015 18:26:25 +0200
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	LABBE Corentin <clabbe.montjoie@...il.com>
Cc:	jdelvare@...e.com, Wolfram Sang <wsa@...-dreams.de>,
	linux-i2c@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/1] i2c: taos-evm: replace simple_strtoul by kstrtou8

On Wed, Nov 18, 2015 at 2:55 PM, LABBE Corentin
<clabbe.montjoie@...il.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?

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;

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ