Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-12-18 Thread Wolfram Sang
> > Please note that I resigned from my position of i2c subsystem > > maintainer, so I will not handle this. If you think this is important, > > you'll have to resubmit and Wolfram will decide what he wants to do > > about it. > > OK, I had the impression that the conclusion was that the danger wa

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-12-18 Thread Julia Lawall
On Tue, 18 Dec 2012, Jean Delvare wrote: > Hi Julia, > > On Thu, 11 Oct 2012 08:45:43 +0200 (CEST), Julia Lawall wrote: > > I found 6 cases where there are more than 2 messages in the array. I > > didn't check how many cases where there are two messages but there is > > something other than one

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-12-18 Thread Jean Delvare
Hi Julia, On Thu, 11 Oct 2012 08:45:43 +0200 (CEST), Julia Lawall wrote: > I found 6 cases where there are more than 2 messages in the array. I > didn't check how many cases where there are two messages but there is > something other than one read and one write. > > Perhaps a reasonable option w

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-10 Thread Julia Lawall
I found 6 cases where there are more than 2 messages in the array. I didn't check how many cases where there are two messages but there is something other than one read and one write. Perhaps a reasonable option would be to use I2C_MSG_READ I2C_MSG_WRITE I2C_MSG_READ_OP I2C_MSG_WRITE_OP The las

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-09 Thread Mauro Carvalho Chehab
Hi Julia, Em Mon, 8 Oct 2012 10:31:33 +0200 (CEST) Julia Lawall escreveu: > I found only 15 uses of I2C_MSG_OP, out of 653 uses of one of the three > macros. Since I2C_MSG_OP has the complete set of flags, I think it should > be OK? > > One of the uses, in drivers/media/i2c/adv7604.c, is as fo

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-09 Thread Mauro Carvalho Chehab
Em Mon, 8 Oct 2012 10:31:33 +0200 (CEST) Julia Lawall escreveu: > I found only 15 uses of I2C_MSG_OP, out of 653 uses of one of the three > macros. Since I2C_MSG_OP has the complete set of flags, I think it should > be OK? > > One of the uses, in drivers/media/i2c/adv7604.c, is as follows: > >

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-08 Thread Julia Lawall
I found only 15 uses of I2C_MSG_OP, out of 653 uses of one of the three macros. Since I2C_MSG_OP has the complete set of flags, I think it should be OK? One of the uses, in drivers/media/i2c/adv7604.c, is as follows: struct i2c_msg msg[2] = { { client->addr, 0, 1, msgbuf0 },

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-08 Thread Antti Palosaari
On 10/08/2012 05:11 AM, Ryan Mallon wrote: On 08/10/12 12:56, Mauro Carvalho Chehab wrote: Em Sun, 07 Oct 2012 14:51:58 -0700 Joe Perches escreveu: On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: On Sun, 7 Oct 2012, Joe Perches wrote: Are READ and WRITE the action names? They are re

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, Joe Perches wrote: On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: On Sun, 7 Oct 2012, Joe Perches wrote: Are READ and WRITE the action names? They are really the important information in this case. Yes, most (all?) uses of _READ and _WRITE macros actually perform

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Ryan Mallon
On 08/10/12 12:56, Mauro Carvalho Chehab wrote: > Em Sun, 07 Oct 2012 14:51:58 -0700 > Joe Perches escreveu: > >> On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: >>> On Sun, 7 Oct 2012, Joe Perches wrote: > Are READ and WRITE the action names? They are really the important > infor

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Mauro Carvalho Chehab
Em Sun, 07 Oct 2012 14:51:58 -0700 Joe Perches escreveu: > On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: > > On Sun, 7 Oct 2012, Joe Perches wrote: > > >> Are READ and WRITE the action names? They are really the important > > >> information in this case. > > > > > > Yes, most (all?) use

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Ryan Mallon
On 08/10/12 03:44, Julia Lawall wrote: > On Sun, 7 Oct 2012, walter harms wrote: > >> >> >> Am 07.10.2012 17:38, schrieb Julia Lawall: >>> From: Julia Lawall >>> >>> Introduce use of I2c_MSG_READ/WRITE/OP, for readability. >>> >>> In the second i2c_msg structure, a length expressed as an explicit

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Joe Perches
On Sun, 2012-10-07 at 23:43 +0200, Julia Lawall wrote: > On Sun, 7 Oct 2012, Joe Perches wrote: > >> Are READ and WRITE the action names? They are really the important > >> information in this case. > > > > Yes, most (all?) uses of _READ and _WRITE macros actually > > perform some I/O. > > I2C_MS

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Ryan Mallon
On 08/10/12 08:39, Joe Perches wrote: > On Sun, 2012-10-07 at 20:56 +0200, Julia Lawall wrote: Some people thought that it would be nice to have the macros rather than the inlined field initializations, especially since there is no flag for write. A separate question is whether an a

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, Joe Perches wrote: On Sun, 2012-10-07 at 20:56 +0200, Julia Lawall wrote: Some people thought that it would be nice to have the macros rather than the inlined field initializations, especially since there is no flag for write. A separate question is whether an array of one

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Joe Perches
On Sun, 2012-10-07 at 20:56 +0200, Julia Lawall wrote: > >> Some people thought that it would be nice to have the macros rather than > >> the inlined field initializations, especially since there is no flag for > >> write. A separate question is whether an array of one element is useful, > >> or w

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
Some people thought that it would be nice to have the macros rather than the inlined field initializations, especially since there is no flag for write. A separate question is whether an array of one element is useful, or whether one should systematically use & on a simple variable of the structu

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Joe Perches
On Sun, 2012-10-07 at 19:18 +0200, Julia Lawall wrote: > On Sun, 7 Oct 2012, walter harms wrote: > > Am 07.10.2012 18:44, schrieb Julia Lawall: > >> On Sun, 7 Oct 2012, walter harms wrote: > >>> Am 07.10.2012 17:38, schrieb Julia Lawall: > Introduce use of I2c_MSG_READ/WRITE/OP, for readabilit

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 18:44, schrieb Julia Lawall: On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length e

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 18:44, schrieb Julia Lawall: > On Sun, 7 Oct 2012, walter harms wrote: > >> >> >> Am 07.10.2012 17:38, schrieb Julia Lawall: >>> From: Julia Lawall >>> >>> Introduce use of I2c_MSG_READ/WRITE/OP, for readability. >>> >>> In the second i2c_msg structure, a length expressed as an ex

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an explicit constant is also re-expressed as the size of the buffer, reg. A

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 17:38, schrieb Julia Lawall: > From: Julia Lawall > > Introduce use of I2c_MSG_READ/WRITE/OP, for readability. > > In the second i2c_msg structure, a length expressed as an explicit constant > is also re-expressed as the size of the buffer, reg. > > A simplified version of the s

[PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
From: Julia Lawall Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an explicit constant is also re-expressed as the size of the buffer, reg. A simplified version of the semantic patch that makes this change is as follows: (http://c