lkml.org 
[lkml]   [2019]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 7/8] thunderbolt: Add support for Intel Ice Lake
On Tue, Aug 13, 2019 at 07:49:35PM +0300, Mika Westerberg wrote:
> > If so, I'd suggest:
> >
> > /* Keep the domain powered while veto is in effect */
> > if (cmpxchg(&icm->veto, false, true))
> > pm_runtime_get(&tb->dev);
> >
> > You'll have to declare icm->veto unsigned int instead of bool
> > because thunderbolt.ko is compiled if CONFIG_COMPILE_TEST is
> > enabled and there are arches which do not support cmpxchg for
> > a size of 1 byte.
> >
> > The other bools in struct icm should likewise be unsigned int
> > per Linus' dictum:
> > https://lkml.org/lkml/2017/11/21/384
>
> Yeah, it probably wastes some space but I like them because IMHO they
> are more readable than bitfields. We have a bunch of other bools in the
> driver structures so if we are going to convert struct icm we should do
> the same for others to keep things consistent. Probably should be a
> separate cleanup patch.

Then again assigning to bool looks more "correct" than with bitfield:

icm->veto = false;

vs.

icm->veto = 0;

It is possible to use false/true with bitfield but it does not feel
right. Maybe it's just me ;-)

\
 
 \ /
  Last update: 2019-08-13 19:02    [W:0.025 / U:3.620 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site