Re: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 03, 2022 at 11:58:35AM +0300, Matti Vaittinen wrote:
> On 10/3/22 11:43, Andy Shevchenko wrote:
> > On Mon, Oct 03, 2022 at 11:13:53AM +0300, Matti Vaittinen wrote:

...

> > > +		for (i = 0, id_attr = buffer->attrs[i];
> > > +		     (id_attr = buffer->attrs[i]); i++)
> > 
> > Not sure why we have additional parentheses...
> 
> Because gcc warns about the assignment and suggests adding parenthesis if we
> don't.

Ah, this is a condition, so that's why compiler wants to have a _result_ of
the assignment and not the ambiguous thingy.

Btw, have you considered to switch to in-loop iterator definitions as we do
in many other places? Also, it might make sense to introduce for_each_...
type of macro helper if the loop is used more than once.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux