Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk, Nikolai Artemiev.
Patch set 8:Code-Review +2
2 comments:
File hwaccess.h:
/* swap bytes */
static inline uint8_t swap8(const uint8_t value)
{
return (value & (uint8_t)0xffU);
}
static inline uint16_t swap16(const uint16_t value)
{
return ((value & (uint16_t)0x00ffU) << 8) |
((value & (uint16_t)0xff00U) >> 8);
}
static inline uint32_t swap32(const uint32_t value)
{
return ((value & (uint32_t)0x000000ffUL) << 24) |
((value & (uint32_t)0x0000ff00UL) << 8) |
((value & (uint32_t)0x00ff0000UL) >> 8) |
((value & (uint32_t)0xff000000UL) >> 24);
}
static inline uint64_t swap64(const uint64_t value)
{
return ((value & (uint64_t)0x00000000000000ffULL) << 56) |
((value & (uint64_t)0x000000000000ff00ULL) << 40) |
((value & (uint64_t)0x0000000000ff0000ULL) << 24) |
((value & (uint64_t)0x00000000ff000000ULL) << 8) |
((value & (uint64_t)0x000000ff00000000ULL) >> 8) |
((value & (uint64_t)0x0000ff0000000000ULL) >> 24) |
((value & (uint64_t)0x00ff000000000000ULL) >> 40) |
((value & (uint64_t)0xff00000000000000ULL) >> 56);
}
In case somebody wants to, we could get rid of the spurious parentheses,
casting and L's in a follow-up.
File hwaccess.h:
#define be_to_cpu8 cpu_to_be8
#define be_to_cpu16 cpu_to_be16
#define be_to_cpu32 cpu_to_be32
#define be_to_cpu64 cpu_to_be64
#define le_to_cpu8 cpu_to_le8
#define le_to_cpu16 cpu_to_le16
#define le_to_cpu32 cpu_to_le32
#define le_to_cpu64 cpu_to_le64
The duplications in the .c files are replaced by macros. […]
Ack
To view, visit change 62898. To unsubscribe, or for help writing mail filters, visit settings.