lkml.org 
[lkml]   [2022]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] gpiolib: cdev: compile out HTE unless CONFIG_HTE selected
On Wed, Jul 13, 2022 at 06:30:14PM +0800, Kent Gibson wrote:
> On Wed, Jul 13, 2022 at 12:03:07PM +0200, Andy Shevchenko wrote:
> > On Wed, Jul 13, 2022 at 3:39 AM Kent Gibson <warthog618@gmail.com> wrote:
> > >
> > > The majority of builds do not include HTE, so compile out hte
> > > functionality unless CONFIG_HTE is selected.
> >
> > ...
> >
> > > +#ifdef CONFIG_HTE
> > > /*
> > > * -- hte specific fields --
> > > */
> >
> > Now this comment seems useless to me and it takes 3 LoCs.
> >
> > ...
> >
> > > + else if (IS_ENABLED(CONFIG_HTE) &&
> > > + (test_bit(FLAG_EVENT_CLOCK_HTE, &line->desc->flags)))
> >
> > Too many parentheses.
> >
> > ...
> >
> > > + if (!IS_ENABLED(CONFIG_HTE) ||
> > > + !test_bit(FLAG_EVENT_CLOCK_HTE, &line->desc->flags)) {
> >
> > if (!(x && y)) ?
> >
> > ...
> >
> > > + if (!IS_ENABLED(CONFIG_HTE) &&
> > > + (flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE))
> > > + return -EOPNOTSUPP;
> >
> > Ditto for consistency?
> >

On second thought, that last one becomes:

if (!(IS_ENABLED(CONFIG_HTE) ||
!(flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE))
return -EOPNOTSUPP;

which is MUCH less readable, so I'll leave that one as is.

Cheers,
Kent.

\
 
 \ /
  Last update: 2022-07-14 03:09    [W:0.071 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site