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]

 



On Wed, Jun 03, 2015 at 03:50:04AM -0700, Trent Piepho 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?

Yes, this is exactly the point I was trying to make.

Attachment: signature.asc
Description: Digital signature


[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