Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-05 Thread Julia Lawall
Anotherpattern that occurred to me is, eg info-MS_Status = *(struct MS_STATUS *)buf[0]; where buf is an array. I find this in 11 files. julia -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Julia Lawall
On Wed, 1 Jul 2015, Dan Carpenter wrote: On Wed, Jul 01, 2015 at 01:54:29PM +0200, Clemens Ladisch wrote: Joe Perches wrote: It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is simpler to read than array[0]. Exceptions exists when

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Clemens Ladisch
Joe Perches wrote: It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is simpler to read than array[0]. Exceptions exists when addresses for consecutive members are used like func(array[0], array[1]); I use 'array[0]' when I want to get a pointer

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Dan Carpenter
On Wed, Jul 01, 2015 at 01:54:29PM +0200, Clemens Ladisch wrote: Joe Perches wrote: It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is simpler to read than array[0]. Exceptions exists when addresses for consecutive members are used like

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Joe Perches
On Wed, 2015-07-01 at 14:26 +0200, Julia Lawall wrote: On Wed, 1 Jul 2015, Dan Carpenter wrote: On Wed, Jul 01, 2015 at 01:54:29PM +0200, Clemens Ladisch wrote: Joe Perches wrote: It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Joe Perches
On Wed, 2015-07-01 at 15:33 -0700, Dmitry Torokhov wrote: On Wed, Jul 01, 2015 at 07:53:44AM -0700, Joe Perches wrote: On Wed, 2015-07-01 at 14:26 +0200, Julia Lawall wrote: On Wed, 1 Jul 2015, Dan Carpenter wrote: On Wed, Jul 01, 2015 at 01:54:29PM +0200, Clemens Ladisch wrote: Joe

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Dmitry Torokhov
On Wed, Jul 01, 2015 at 07:53:44AM -0700, Joe Perches wrote: On Wed, 2015-07-01 at 14:26 +0200, Julia Lawall wrote: On Wed, 1 Jul 2015, Dan Carpenter wrote: On Wed, Jul 01, 2015 at 01:54:29PM +0200, Clemens Ladisch wrote: Joe Perches wrote: It seems most in-kernel uses are 'array'

Re: RFC: kernel coding style: prefer array to array[0] ?

2015-07-01 Thread Julia Lawall
On Tue, 30 Jun 2015, Joe Perches wrote: It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is simpler to read than array[0]. Exceptions exists when addresses for consecutive members are used like func(array[0], array[1]); Should this

RFC: kernel coding style: prefer array to array[0] ?

2015-06-30 Thread Joe Perches
It seems most in-kernel uses are 'array' rather than 'array[0]' Most of the time, using array is simpler to read than array[0]. Exceptions exists when addresses for consecutive members are used like func(array[0], array[1]); Should this preference be put into checkpatch and/or CodingStyle?