[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YVHoXyULqXsWktMN@kroah.com>
Date: Mon, 27 Sep 2021 17:50:55 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Nikita Yushchenko <nikita.yoush@...entembedded.com>
Cc: Lee Jones <lee.jones@...aro.org>, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists