Re: [PATCH 03/22] s390: introduce little endian bitops

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

 



2010/10/15 Arnd Bergmann <arnd@xxxxxxxx>:
> On Friday 15 October 2010, Akinobu Mita wrote:
>> +#define __set_le_bit(nr, addr) \
>> +       __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __clear_le_bit(nr, addr)       \
>> +       __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __test_and_set_le_bit(nr, addr)        \
>> +       __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_and_set_le_bit(lock, nr, addr)    \
>> +       test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define __test_and_clear_le_bit(nr, addr)      \
>> +       __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_and_clear_le_bit(lock, nr, addr)  \
>> +       test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>> +#define test_le_bit(nr, addr)  \
>> +       test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>
> The test_and_clear_le_bit and test_and_set_le_bit calling conventions
> are a little surprising here. I would not pass the lock argument
> here but leave that to the ext2 wrapper:
>
> #define test_and_set_le_bit(nr, addr)    \
>       test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> #define test_and_clear_le_bit(nr, addr)  \
>       test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
>
> #define ext2_set_bit_atomic(lock, nr, addr)       \
>       test_and_set_le_bit((nr), (unsigned long *)(addr))
> #define ext2_clear_bit_atomic(lock, nr, addr)     \
>       test_and_clear_le_bit((nr), (unsigned long *)(addr))
>
> Same thing on arm and m68k.

Oops,
test_and_{set,clear}_le_bit() is only used by ext2_{set,clear}_bit_atomic
and I had one additional patch that cleans up these definisions across
the architectures. So I didn't realize that mistake when I did cross
compile.
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux