lkml.org 
[lkml]   [2022]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/1] i2c: Set pinctrl recovery info to device pinctrl
On Tue, Dec 20, 2022 at 07:07:51PM +0200, Hawa, Hanna wrote:
> On 12/20/2022 12:53 PM, Andy Shevchenko wrote:

...


> > > +static inline struct pinctrl *dev_pinctrl(struct device *dev)
> > > +{
> > > + return dev->pins && dev->pins->p ? dev->pins->p : NULL;
> >
> > GCC supports Elvis, you can use it to simplify the above.
>
> How you suggest to simplify this?

Using Elvis operator, which is ?:.

> I can use 'return dev->pins ? dev->pins->p ?: dev->pins->p : NULL;'

Have you even try to compile this?

> > > +}

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-03-26 23:16    [W:0.054 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site