Re: [PATCH v8 01/12] bswap: add 64 bit endianness helper get_be64

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

 



Ben Peart <Ben.Peart@xxxxxxxxxxxxx> writes:

>> @@ -183,8 +183,8 @@ static inline uint32_t get_be32(const void *ptr)  static
>> inline uint64_t get_be64(const void *ptr)  {
>>  	const unsigned char *p = ptr;
>> -	return	(uint64_t)get_be32(p[0]) << 32 |
>> -		(uint64_t)get_be32(p[4]) <<  0;
>> +	return	(uint64_t)get_be32(p + 0) << 32 |
>> +		(uint64_t)get_be32(p + 4) <<  0;
>
> This is surprising.  Every other function in the file uses the p[x] syntax.  Just for
> consistency, is there a way to stick to that syntax but still make it work correctly?
> Is there a typecast that can make it work?

I'll do "get_be32(&p[0])" etc. while queueing for now.

Thanks, both of you.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux