Re: [RFC v2 3/4] i2c: mux: demux-pinctrl: add driver

From: Geert Uytterhoeven
Date: Wed Jan 13 2016 - 11:16:15 EST


Hi Wolfram,

On Wed, Jan 13, 2016 at 1:55 PM, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
>> > +struct i2c_demux_pinctrl_priv {
>> > + int cur_chan;
>> > + int num_chan;
>>
>> This is always positive, so you can make num_chan and a few loop counters
>> unsigned.
>
> Nope, sadly not. cur_chan can get a -ERRNO, and the type of num_chan is

Sorry for the bad quoting, my comment applied to num_chan only.

> defined by the return type of of_count_phandle_with_args().

But you will never store negative error codes returned by that function, as you
won't get to the storing part...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds