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 06:38:35PM +0300, Dan Carpenter wrote:
> 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.

Thank you Joe, Dan. Just to conclude, I will leave the line untouched as it is
no big advantage and the current format is more readable.

./drv

>
> regards,
> dan carpenter
>


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