Re: [alsa-devel] [PATCH 5/7] ASoC: wm5100: remove bitwise operations involving GPIO level value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Trent,

On 04.06.2015 00:51, Trent Piepho wrote:
> On Wed, Jun 3, 2015 at 12:13 PM, Vladimir Zapolskiy <vz@xxxxxxxxx> wrote:
>>>
>>> BTW, with a little C algebra:
>>> const unsigned int val = value ?  0x1 << WM5100_GP1_LVL_SHIFT : 0;
>>> const unsigned int val = (value ?  0x1 : 0) << WM5100_GP1_LVL_SHIFT;
>>> const unsigned int val = (!!value) << WM5100_GP1_LVL_SHIFT;  //
>>> definition of ! operator
>>>
>>> And now we're back to where we started, so I don't really see why this
>>> is even necessary.  The semantics of the ! operator will be changed in a
>>> future C version?
>>
>> I don't think it makes sense to discuss technical aspects of the
>> proposed change, as I mentioned in the discussion yesterday I see no
>> technical issues at this point, and my changes are described as
>> nonfunctional.
>>
>> The _nontechnical_ problem I see (well, may be I'm just blowing it up)
>> is a Linux kernel code style policy problem, to my knowledge the policy
>> of using bitwise and arithmetic operations on bool type variables and
>> constants is not defined, and since the policy is not yet defined I'm
>> glad to take part in its discussion now.
> 
> I don't believe this is the case.

please excuse me for possible misunderstanding, you don't believe that
I'm interested in discussing a _nontechnical_ problem stated above?

>  From C99, section 6.5.3.3, paragraph 5:

C99 is a strict superset over Linux coding style (e.g. remember //
comments or "register" specifier), so let's forget about.

--
With best wishes,
Vladimir
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux