lkml.org 
[lkml]   [2022]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: iio: meter: use min() for comparison and assignment
On Mon, Nov 07, 2022 at 07:22:24AM -0800, Joe Perches wrote:
> > In terms of run time, this patch is fine but in terms of reading the
> > code using min() makes it less readable.
>
> It's not a runtime question, either should compile to the same object
> code. It's definitely a readabiity and standardization issue.
>
> In this case, IMO it'd be better to use the much more common
>
> if (ret < 0)
> return ret;
>
> return 0;

I also prefer this format.

But at the same time, I can't advise Deepak to go around changing
existing code where the author like ternaries.

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-11-07 16:39    [W:0.132 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site