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 would

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 read

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 was

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

2012-10-11 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

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 julia.law...@lip6.fr 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

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 julia.law...@lip6.fr 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

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 },

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

2012-10-07 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr 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

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 julia.law...@lip6.fr 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

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 julia.law...@lip6.fr 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

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 julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an

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 julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg

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 readability. struct

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

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 whether one

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 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 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 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_MSG_READ_DATA?

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 julia.law...@lip6.fr 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 Mauro Carvalho Chehab
Em Sun, 07 Oct 2012 14:51:58 -0700 Joe Perches j...@perches.com 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?)

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 j...@perches.com 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

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