lkml.org 
[lkml]   [2022]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types
    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


    \
     
     \ /
      Last update: 2022-10-03 11:46    [W:4.165 / U:0.720 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site