[PATCH 1/2] commands: i2c: do not restrict i2c_write's data to be hex-formatted

Ulrich Ölmann u.oelmann at pengutronix.de
Wed Oct 18 23:55:26 PDT 2017


Hi Uwe and list,

On Tue, Oct 17, 2017 at 03:51:37PM +0200, Uwe Kleine-König wrote:
> On Tue, Oct 17, 2017 at 03:16:24PM +0200, Ulrich Ölmann wrote:
> > The price to pay is needing the usual prefix "0x" for each hex-formatted number.
> > 
> > Signed-off-by: Ulrich Ölmann <u.oelmann at pengutronix.de>
> 
> ack for the change. I'd like to see the motivation (i.e. consistency with
> the other commands in barebox as mentioned in the cover letter) in the
> commit log, though.

just sent a v2.

> [...]
> > -		*(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 16);
> > +		*(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 0);
> 
> Maybe change that to:
> 
> 		buf[i] = simple_strtol(...);
> 
> which is a bit easier to read and drops an unnecessary cast? (Or should
> that better go in a separate change?)

Fully agreed. Will you prepare a patch?

Best regards
Ulrich
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list