RE: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-29 Thread David Laight
From: Joe Perches > On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: > > On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer wrote: > > > On Wed, May 28, 2014 at 3:45 AM, David Laight > > > wrote: > > >> From: Cody P Schafer > > >>> Rather manually specifying the size of the integer to be

RE: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-29 Thread David Laight
From: Joe Perches On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer d...@codyps.com wrote: On Wed, May 28, 2014 at 3:45 AM, David Laight david.lai...@aculab.com wrote: From: Cody P Schafer Rather manually specifying the size of

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 6:00 PM, Joe Perches wrote: > On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: >> On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer wrote: >> > On Wed, May 28, 2014 at 3:45 AM, David Laight >> > wrote: >> >> From: Cody P Schafer >> >>> Rather manually specifying

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Joe Perches
On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: > On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer wrote: > > On Wed, May 28, 2014 at 3:45 AM, David Laight > > wrote: > >> From: Cody P Schafer > >>> Rather manually specifying the size of the integer to be converted, key > >>> off of the

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer wrote: > On Wed, May 28, 2014 at 3:45 AM, David Laight wrote: >> From: Cody P Schafer >>> Rather manually specifying the size of the integer to be converted, key >>> off of the type size. Reduces duplicate size info and the occurance of >>> certain

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-28 Thread Cody P Schafer
On Tue, May 27, 2014 at 7:44 PM, Joe Perches wrote: > On Tue, 2014-05-27 at 17:22 -0700, Cody P Schafer wrote: >> Rather manually specifying the size of the integer to be converted, key >> off of the type size. Reduces duplicate size info and the occurance of >> certain types of bugs (using the

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 3:45 AM, David Laight wrote: > From: Cody P Schafer >> Rather manually specifying the size of the integer to be converted, key >> off of the type size. Reduces duplicate size info and the occurance of >> certain types of bugs (using the wrong sized conversion). > ... >>

RE: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread David Laight
From: Cody P Schafer > Rather manually specifying the size of the integer to be converted, key > off of the type size. Reduces duplicate size info and the occurance of > certain types of bugs (using the wrong sized conversion). ... > +#define be_to_cpu(v) \ > + __builtin_choose_expr(sizeof(v)

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 3:45 AM, David Laight david.lai...@aculab.com wrote: From: Cody P Schafer Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs (using the wrong sized

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-28 Thread Cody P Schafer
On Tue, May 27, 2014 at 7:44 PM, Joe Perches j...@perches.com wrote: On Tue, 2014-05-27 at 17:22 -0700, Cody P Schafer wrote: Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer d...@codyps.com wrote: On Wed, May 28, 2014 at 3:45 AM, David Laight david.lai...@aculab.com wrote: From: Cody P Schafer Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Joe Perches
On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer d...@codyps.com wrote: On Wed, May 28, 2014 at 3:45 AM, David Laight david.lai...@aculab.com wrote: From: Cody P Schafer Rather manually specifying the size of the integer to be

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread Cody P Schafer
On Wed, May 28, 2014 at 6:00 PM, Joe Perches j...@perches.com wrote: On Wed, 2014-05-28 at 17:11 -0500, Cody P Schafer wrote: On Wed, May 28, 2014 at 5:05 PM, Cody P Schafer d...@codyps.com wrote: On Wed, May 28, 2014 at 3:45 AM, David Laight david.lai...@aculab.com wrote: From: Cody P

RE: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be, le}_to_cpu() and cpu_to_{be, le}() macros

2014-05-28 Thread David Laight
From: Cody P Schafer Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs (using the wrong sized conversion). ... +#define be_to_cpu(v) \ + __builtin_choose_expr(sizeof(v) ==

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-27 Thread Joe Perches
On Tue, 2014-05-27 at 17:22 -0700, Cody P Schafer wrote: > Rather manually specifying the size of the integer to be converted, key > off of the type size. Reduces duplicate size info and the occurance of > certain types of bugs (using the wrong sized conversion). [] > diff --git

[PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-27 Thread Cody P Schafer
Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs (using the wrong sized conversion). CC: Sukadev Bhattiprolu Signed-off-by: Cody P Schafer --- include/linux/byteorder.h | 34

[PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-27 Thread Cody P Schafer
Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs (using the wrong sized conversion). CC: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Signed-off-by: Cody P Schafer d...@codyps.com

Re: [PATCH 11/16] byteorder: provide a linux/byteorder.h with {be,le}_to_cpu() and cpu_to_{be,le}() macros

2014-05-27 Thread Joe Perches
On Tue, 2014-05-27 at 17:22 -0700, Cody P Schafer wrote: Rather manually specifying the size of the integer to be converted, key off of the type size. Reduces duplicate size info and the occurance of certain types of bugs (using the wrong sized conversion). [] diff --git