Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605689 > unrolled thread

Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

Started byChristophe LEROY <christophe.leroy@c-s.fr>
First post2017-03-21 16:10 +0100
Last post2017-03-21 16:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation Christophe LEROY <christophe.leroy@c-s.fr> - 2017-03-21 16:10 +0100

#1605689 — Re: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

FromChristophe LEROY <christophe.leroy@c-s.fr>
Date2017-03-21 16:10 +0100
SubjectRe: [PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation
Message-ID<tntA6-4ZS-11@gated-at.bofh.it>

Le 10/03/2017 à 16:41, Segher Boessenkool a écrit :
> On Fri, Mar 10, 2017 at 03:41:23PM +0100, Christophe LEROY wrote:
>>>>>> gpio_get() and gpio_set() are used extensively by some GPIO based
>>>>>> drivers like SPI, NAND, so it may be worth it as it doesn't impair
>>>>>> readability (if anyone prefers, we could write  (1 << 31) >> i  instead
>>>>>> of  0x80000000 >> i )
>>>>> 1 << 31 is undefined behaviour, of course.
>>>> Shall it be 1U << 31 ?
>>> Sure, that works.  "1 << (31 - i)" is most readable (but it doesn't yet
>>> generate the code you want).
>> Euh .... I'm a bit lost. Do you mean the form we have today is the
>> driver is wrong ?
> Heh, yes.  But is't okay with GCC, so don't worry about it.
>
> The point is that "0x80000000 >> i" is less readable.
>
>
FYI, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80131

Christophe

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web