lkml.org 
[lkml]   [2021]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: most: dim2: force fcnt=3 on Renesas GEN3
On Mon, Sep 27, 2021 at 06:40:13PM +0300, Nikita Yushchenko wrote:
> > > + dev_fcnt = pdata && pdata->fcnt ? pdata->fcnt : fcnt;
> >
> > Please use a real if () statement here and do not bury real logic in a
> > crazy line like this one, as that is all but impossible to maintain over
> > time.
>
> The same source file already uses the same form of conditional expressions several lines above:
>
> > ret = pdata && pdata->enable ? pdata->enable(pdev) : 0;

It's not good there either.

There is a reason this code is still in drivers/staging/ and that is one
of them. Let's not duplicate bad code for no real reason please.

> > dev->disable_platform = pdata ? pdata->disable : NULL;
>
> Shall I use real if statement for my expression while keeping those as-is? This looks ... strange.
> Or shall I convert all conditional expressions to if statements?

Do not add additional ? : statements in this patch. I would be glad to
take an add-on patch after this that fixes up the other uses in the
driver, but that should be separate as that is a separate issue here.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-09-27 17:51    [W:0.054 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site