[PATCH 2/13] drivers/media/tuners/mxl5007t.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 each case, a length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible. A simplified version of the semantic patch that makes this change

[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

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 9/13] drivers/media/tuners/fc0011.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. A length expressed as an explicit constant is also re-expressed as the size of the buffer in each case

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

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

2012-10-07 Thread Julia Lawall
On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible

Re: [PATCH 5/13] drivers/media/tuners: use macros for i2c_msg initialization

2012-10-07 Thread Julia Lawall
in question is a pointer, so sizeof would give the wrong result. If it is preferred, I could not use sizeof for the other structure in the same code, but it seems just a little safer to use it. thanks, julia On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia

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

2012-10-07 Thread Julia Lawall
On Mon, 8 Oct 2012, Ryan Mallon wrote: On 08/10/12 02:38, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer, when this is possible

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

2012-10-07 Thread Julia Lawall
Sorry, I mean either: I2C_MSG_WRITE(priv-cfg-i2c_address, reg, sizeof(reg)), I2C_MSG_READ(priv-cfg-i2c_address, val, sizeof(*val)), Of course. Sorry for not having seen that. I can do that. julia -- To unsubscribe from this list: send the line unsubscribe linux-media in the

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 2/13] drivers/media/tuners/mxl5007t.c: use macros for i2c_msg initialization

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Sun, 7 Oct 2012 17:38:33 +0200, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. Next time you send this patch set, please Cc me on every post so that I don't have

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

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Mon, 8 Oct 2012 07:24:11 +0200 (CEST), Julia Lawall wrote: Sorry, I mean either: I2C_MSG_WRITE(priv-cfg-i2c_address, reg, sizeof(reg)), I2C_MSG_READ(priv-cfg-i2c_address, val, sizeof(*val)), Of course. Sorry

Re: [PATCH 0/11] introduce macros for i2c_msg initialization

2012-10-09 Thread Julia Lawall
On Tue, 9 Oct 2012, Jean Delvare wrote: Hi Julia, On Sun, 7 Oct 2012 17:38:30 +0200, Julia Lawall wrote: This patch set introduces some macros for describing how an i2c_msg is being initialized. There are three macros: I2C_MSG_READ, for a read message, I2C_MSG_WRITE, for a write

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 0/11] introduce macros for i2c_msg initialization

2012-10-22 Thread Julia Lawall
I have been looking at this again, with the macros #define I2C_MSG_OP(_addr, _buf, _len, _flags) \ { .addr = _addr, .buf = _buf, .len = _len, .flags = _flags } #define I2C_MSG_WRITE(addr, buf, len) \ I2C_MSG_OP(addr, buf, len, 0) #define I2C_MSG_READ(addr, buf, len) \

Re: [PATCH] trivial: adjust code alignment

2013-08-05 Thread Julia Lawall
On Mon, 5 Aug 2013, walter harms wrote: Hello Julia, IMHO keep the patch as it is. It does not change any code that is good. Suspicious code that comes up here can be addressed in a separate patch. OK, thanks! julia -- To unsubscribe from this list: send the line unsubscribe linux-media in

Re: [PATCH] trivial: adjust code alignment

2013-08-05 Thread Julia Lawall
On Mon, 5 Aug 2013, Dan Carpenter wrote: On Mon, Aug 05, 2013 at 04:47:39PM +0200, Julia Lawall wrote: diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index e8a1ce2..4a5a5dc 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -1369,8 +1369,8

[PATCH 26/29] drivers/media/platform/coda.c: simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 11/29] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 0/29] simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
devm_ioremap_resource often uses the result of a call to platform_get_resource as its last argument. devm_ioremap_resource does appropriate error handling on this argument, so error handling can be removed from the call site. To make the connection between the call to platform_get_resource and

question about drivers/media/usb/gspca/kinect.c

2013-12-25 Thread Julia Lawall
The following code, in the function send_cmd, looks too concise: do { actual_len = kinect_read(udev, ibuf, 0x200); } while (actual_len == 0); PDEBUG(D_USBO, Control reply: %d, res); if (actual_len sizeof(*rhdr)) { pr_err(send_cmd:

[PATCH 20/25] fix error return code

2013-12-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Set the return variable to an error code as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl ( if@p1 (\(ret 0\|ret != 0\)) { ... return ret; } | ret@p1

[PATCH 0/25] fix error return code

2013-12-29 Thread Julia Lawall
These patches fix cases where the return variable is not set to an error code in an error case. -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 3/25] fix error return code

2013-12-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The rest of the function uses ret to store the return value, even setting ret to i a few lines before this, so return ret instead of i. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl

[PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in sizeof

2014-07-29 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Correct typo in the name of the type given to sizeof. Because it is the size of a pointer that is wanted, the typo has no impact on compilation or execution. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The semantic patch used

[PATCH 0/9] use correct structure type name in sizeof

2014-07-29 Thread Julia Lawall
These patches fix typos in the name of a type referenced in a sizeof command. These problems are not caught by the compiler, because they have no impact on execution - the size of a pointer is independent of the size of the pointed value. The semantic patch that finds these problems is shown

[PATCH 0/9] use c99 initializers in structures

2014-08-23 Thread Julia Lawall
These patches add labels in the initializations of structure fields (c99 initializers). The complete semantic patch thta makes this change is shown below. This rule ignores cases where the initialization is just 0 or NULL, where some of the fields already use labels, and where there are nested

[PATCH 1/9] [media] v4l: ti-vpe: use c99 initializers in structures

2014-08-23 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use c99 initializers for structures. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @decl@ identifier i1,fld; type T; field list[n] fs; @@ struct i1 { fs T fld; ...}; @bad

Re: [linuxtv-media:devel 497/499] drivers/media/platform/s5p-mfc/s5p_mfc.c:454:2-5: WARNING: Use BUG_ON

2014-08-27 Thread Julia Lawall
The bug_on one doesn't look like a good idea, but the returnvar one would make the code a little simpler. julia On Thu, 28 Aug 2014, kbuild test robot wrote: TO: Mauro Carvalho Chehab m.che...@samsung.com CC: linux-media@vger.kernel.org Hi Mauro, First bad commit (maybe != root cause):

Re: [patch] [media] em28xx-input: NULL dereference on error

2014-09-25 Thread Julia Lawall
On Thu, 25 Sep 2014, Frank Schäfer wrote: Hi Dan, Am 25.09.2014 um 13:39 schrieb Dan Carpenter: We call kfree(ir-i2c_client); in the error handling and that doesn't work if ir is NULL. Fixes: 78e719a5f30b ('[media] em28xx-input: i2c IR decoders: improve i2c_client handling')

Re: [linuxtv-media:master 489/499] drivers/media/usb/cx231xx/cx231xx-audio.c:445:16-20: ERROR: dev is NULL but dereferenced.

2014-11-03 Thread Julia Lawall
Clearly a bug. On Tue, 4 Nov 2014, kbuild test robot wrote: TO: Mauro Carvalho Chehab m.che...@samsung.com CC: linux-media@vger.kernel.org tree: git://linuxtv.org/media_tree.git master head: ed3da2bf2e1800e7c6e31e7d31917dacce599458 commit: b7085c08647598aafbf8f6223ebcdd413745449c

[PATCH 5/27] [media] usbvision: Use setup_timer

2014-12-26 Thread Julia Lawall
); +setup_timer(t,f,d); -t.data = d; -t.function = f; // /smpl The semantic patch also changes the cast to long to a cast to unsigned long in the data initializer, as unsigned long is the type of the data field. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/usb/usbvision/usbvision

[PATCH 0/27] Use setup_timer

2014-12-26 Thread Julia Lawall
These patches group a call to init_timer and initialization of the function and data fields into a call to setup_timer. Is there is no initialization of the data field before add_timer is called, the the data value is set to 0UL. If the data value has a cast to something other than unsigned

[PATCH 19/27] [media] pvrusb2: Use setup_timer

2014-12-26 Thread Julia Lawall
); +setup_timer(t,f,d); -t.data = d; -t.function = f; // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers

[PATCH 1/27] [media] s2255drv: Use setup_timer

2014-12-26 Thread Julia Lawall
); +setup_timer(t,f,d); -t.function = f; -t.data = d; // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/usb/s2255/s2255drv.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index

[PATCH 2/27] [media] au0828: Use setup_timer

2014-12-26 Thread Julia Lawall
= d; -init_timer(t); +setup_timer(t,f,d); // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/usb/au0828/au0828-video.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828

[PATCH 7/15] media: pci: cx23885: don't export static symbol

2015-03-11 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL; @@ -EXPORT_SYMBOL(f); // /smpl Signed-off-by: Julia

[PATCH 0/15] don't export static symbol

2015-03-11 Thread Julia Lawall
These patches remove EXPORT_SYMBOL or EXPORT_SYMBOL_GPL declarations on static functions. This was done using the following semantic patch: (http://coccinelle.lip6.fr/) // smpl @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL; @@

Re: drivers/media/usb/au0828/au0828-video.c:1741:1-3: WARNING: end returns can be simpified if negative or 0 value

2015-03-25 Thread Julia Lawall
The function does only return 0 or a negative constant, but it seems like a matter of personal prefernce - shorter vs more explicit. julia On Wed, 25 Mar 2015, kbuild test robot wrote: TO: Shuah Khan shua...@osg.samsung.com CC: Mauro Carvalho Chehab m.che...@samsung.com CC:

[PATCH 4/16] [media] as102: fix error return code

2015-04-05 Thread Julia Lawall
!= ret *if(...) { ... when != ret = e2 when forall return ret; } // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/usb/as102/as102_drv.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/usb/as102/as102_drv.c b/drivers/media/usb/as102/as102_drv.c

[PATCH 2/16] [media] si4713: fix error return code

2015-04-05 Thread Julia Lawall
!= ret *if(...) { ... when != ret = e2 when forall return ret; } // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/radio/si4713/si4713.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media

[PATCH 0/16] fix error return code

2015-04-05 Thread Julia Lawall
The complate semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @ok exists@ identifier f,ret,i; expression e; constant c; @@ // identify a function that returns a negative return value at least once. f(...) { ... when any ( return -c@i; | ret = -c@i; ...

[PATCH 3/16] [media] radio: fix error return code

2015-04-05 Thread Julia Lawall
!= ret *if(...) { ... when != ret = e2 when forall return ret; } // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/media/radio/radio-timb.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio

[PATCH 0/9] drop unneeded goto

2015-05-28 Thread Julia Lawall
These patches drop gotos that jump to a label that is at the next instruction, in the case that the label is not used elsewhere in the function. The complete semantic patch that performs this transformation is as follows: // smpl @r@ position p; identifier l; @@ if (...) goto l@p; l:

[PATCH 1/9] drivers/media/usb/airspy/airspy.c: drop unneeded goto

2015-05-28 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete jump to a label on the next line, when that label is not used elsewhere. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @r@ identifier l; @@ -if (...) goto l; -l: // /smpl

[PATCH 7/9] drivers/media/tuners/e4000.c: drop unneeded goto

2015-05-28 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Delete jump to a label on the next line, when that label is not used elsewhere. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @r@ identifier l; @@ -if (...) goto l; -l: // /smpl

[PATCH 5/8] [media] v4l: xilinx-vipp: add missing of_node_put

2015-10-25 Thread Julia Lawall
; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/platform/xilinx/xilinx-vipp.c |4 +++- 1 file chan

[PATCH 0/8] add missing of_node_put

2015-10-25 Thread Julia Lawall
The various for_each device_node iterators performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. The complete semantic patch that fixes this problem is (http://coccinelle.lip6.fr): // @r@ local idexpression n; expression e1,e2; iterator name

[PATCH 6/8] [media] v4l: xilinx-tpg: add missing of_node_put

2015-10-25 Thread Julia Lawall
; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/platform/xilinx/xilinx-tpg.c |2 ++ 1 file chan

[PATCH] [media] radio-shark2: constify radio_tea5777_ops structures

2015-11-13 Thread Julia Lawall
The radio_tea5777_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/radio/radio-shark2.c |2 +- drivers/media/radio/radio-tea5777.h |2 +- 2 files changed, 2 insertions

[PATCH] [media] ttusb-dec: constify ttusbdecfe_config structure

2015-11-13 Thread Julia Lawall
The ttusbdecfe_config structure is never modified, so declare it as const. Other references to this structure type were already declared as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/usb/ttusb-dec/ttusb_dec.c |2 +-

[PATCH] [media] i2c: constify v4l2_ctrl_ops structures

2015-11-13 Thread Julia Lawall
These v4l2_ctrl_ops structures are never modified, like all the other v4l2_ctrl_ops structures, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/i2c/mt9m032.c |2 +- drivers/media/i2c/mt9p031.c

[PATCH] drivers/media/platform/s5p-tv: constify mxr_layer_ops structures

2015-11-15 Thread Julia Lawall
The mxr_layer_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/platform/s5p-tv/mixer.h |2 +- drivers/media/platform/s5p-tv/mixer_grp_layer.c |2 +- d

[PATCH 2/2] [media] netup_unidvb: delete null dereference

2015-10-17 Thread Julia Lawall
The calls to dev_dbg will not work properly when spi is NULL. Just use pr_debug instead. Problem found using scripts/coccinelle/null/deref_null.cocci Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c |6 ++ 1 file chan

[PATCH 0/2] delete null dereference

2015-10-17 Thread Julia Lawall
These patches delete NULL dereferences, as detected by scripts/coccinelle/null/deref_null.cocci. --- drivers/media/pci/netup_unidvb/netup_unidvb_spi.c |6 ++ net/nfc/netlink.c |6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) -- To

[PATCH] [media] mt9t001: constify v4l2_subdev_internal_ops structure

2015-10-11 Thread Julia Lawall
This v4l2_subdev_internal_ops structure is never modified. All other v4l2_subdev_internal_ops structures are declared as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/i2c/mt9t001.c |2 +- 1 file changed, 1 insertion

[PATCH] [media] media: videobuf2: fix compare_const_fl.cocci warnings

2015-11-13 Thread Julia Lawall
Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci CC: Junghak Sung <jh1009.s...@samsung.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- !b-&g

[PATCH] drivers/media/usb/dvb-usb-v2: constify mxl111sf_demod_config structure

2015-11-13 Thread Julia Lawall
The mxl111sf_demod_config structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c |4 ++-- drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h |4 ++-- d

[PATCH] drivers/media/usb/as102: constify as102_priv_ops_t structure

2015-12-06 Thread Julia Lawall
The as102_priv_ops_t structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/usb/as102/as102_drv.h |2 +- drivers/media/usb/as102/as102_usb_drv.c |2 +- 2 files changed, 2 inse

[PATCH] [media] constify stv6110x_devctl structure

2015-12-06 Thread Julia Lawall
The stv6110x_devctl structure is never modified, so declare is as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/dvb-frontends/stv6110x.c |4 ++-- drivers/media/dvb-frontends/stv6110x.h

[PATCH] [media] go7007: constify go7007_hpi_ops structures

2015-12-11 Thread Julia Lawall
The go7007_hpi_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/saa7134/saa7134-go7007.c |2 +- drivers/media/usb/go7007/go7007-priv.h |2 +- drivers/med

[PATCH] av7110: constify sp8870_config structure

2016-01-03 Thread Julia Lawall
This sp8870_config structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/ttpci/av7110.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci

[PATCH] media: bt8xx: constify sp887x_config structure

2016-01-03 Thread Julia Lawall
This sp887x_config structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- This patch and the previous one on the same file can be applied in any order. drivers/media/pci/bt8xx/dvb-bt8xx.c |2 +-

[PATCH] media: bt8xx: constify or51211_config structure

2016-01-03 Thread Julia Lawall
The or51211_config structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/bt8xx/dvb-bt8xx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci

[PATCH] drivers/media/usb/dvb-usb-v2: constify mxl111sf_tuner_config structure

2016-01-03 Thread Julia Lawall
This mxl111sf_tuner_config structure is never modified, so declare it as const. There are some indentation changes to remain within 80 columns. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c

[PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-26 Thread Julia Lawall
The error return value of platform_get_irq seems to often get dropped. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- v2: Check for the direct return case also. Added some mailing lists of common offenders. diff --git a/scripts/coccinelle/api/platform_get_irq_return.cocci b/s

Re: [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-26 Thread Julia Lawall
On Sun, 27 Dec 2015, Sergei Shtylyov wrote: > On 12/26/2015 11:58 PM, Julia Lawall wrote: > > > The error return value of platform_get_irq seems to often get dropped. > > > > Signed-off-by: Julia Lawall <julia.law...@lip6.fr> > > > > --- > >

Re: [Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread Julia Lawall
On Sun, 27 Dec 2015, SF Markus Elfring wrote: > > The error return value of platform_get_irq seems to often get dropped. > > How do you think about any more fine-tuning here? > > Commit message: > * … of the platform_get_irq() function seems to get dropped too often. > > * Why do you

Re: [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-26 Thread Julia Lawall
>Well, looking again, the patch should be good. I just thought its goal was > to fix the code as well... I could do that for the irq < 0 case, but I think that in that case, kbuild will only run the patch version, and the <= cases will not be reported on. I don't have a general fix for the <=

Re: [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread Julia Lawall
On Mon, 28 Dec 2015, SF Markus Elfring wrote: > >> Move the jump label directly before the desired log statement > >> so that the variable "ret" will not be checked once more > >> after it was determined that a function call failed. > > > > Why not avoid both unnecessary ifs > > I would find

Re: [PATCH] [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread Julia Lawall
On Mon, 28 Dec 2015, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 28 Dec 2015 10:10:34 +0100 > > This issue was detected by using the Coccinelle software. > > Move the jump label directly before the desired log statement > so that the variable "ret"

Re: [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread Julia Lawall
On Mon, 28 Dec 2015, SF Markus Elfring wrote: > >> Move the jump label directly before the desired log statement > >> so that the variable "ret" will not be checked once more > >> after a function call. > > > > This commit message fits with the previous change. > > Do you prefer an other wording?

Re: [PATCH 1/2] [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread Julia Lawall
t > so that the variable "ret" will not be checked once more > after a function call. This commit message fits with the previous change. It could be nice to put a blank line before the error handling code. See what is done elsewhere in the file. julia > > Suggested-by: Ju

Re: On Lindent shortcomings and massive style fixing

2015-12-29 Thread Julia Lawall
On Tue, 29 Dec 2015, Andrey Utkin wrote: > On Tue, Dec 29, 2015 at 9:32 AM, Mauro Carvalho Chehab > wrote: > > IMHO, there are two problems by letting indent breaking long > > lines: > > > > 1) indent would break strings on printks. This is something that we don't > >

[PATCH] [media] s5p-mfc: constify s5p_mfc_codec_ops structures

2015-11-21 Thread Julia Lawall
The s5p_mfc_codec_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/platform/s5p-mfc/s5p_mfc_common.h |2 +- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c

[PATCH] media, sound: tea575x: constify snd_tea575x_ops structures

2015-11-22 Thread Julia Lawall
The snd_tea575x_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/bt8xx/bttv-cards.c |2 +- drivers/media/radio/radio-maxiradio.c |2 +- drivers/media/radio

[PATCH] [media] soc_camera: constify v4l2_subdev_sensor_ops structures

2015-11-22 Thread Julia Lawall
The v4l2_subdev_sensor_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/i2c/soc_camera/mt9m001.c |2 +- drivers/media/i2c/soc_camera/mt9t031.c |2 +- drivers/med

[PATCH] [media] cx231xx: constify cx2341x_handler_ops structures

2015-11-22 Thread Julia Lawall
The cx2341x_handler_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/pci/cx18/cx18-controls.c |2 +- drivers/media/pci/cx18/cx18-controls.h |2 +- drivers/media/pc

[PATCH] atmel-isc: fix platform_no_drv_owner.cocci warnings

2016-04-13 Thread Julia Lawall
Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Songjun Wu <songjun...@atmel.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr>

[PATCH] atmel-isc: fix compare_const_fl.cocci warnings

2016-04-13 Thread Julia Lawall
Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci CC: Songjun Wu <songjun...@atmel.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- Up to you. See

[PATCH] VPU: mediatek: fix platform_no_drv_owner.cocci warnings

2016-04-22 Thread Julia Lawall
Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Andrew-CT Chen <andrew-ct.c...@mediatek.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Julia Lawall <julia.law...@lip

[PATCH] VPU: mediatek: fix simple_open.cocci warnings

2016-04-22 Thread Julia Lawall
; Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- I'm just passing this along. Simple_open additionally has a check that inode->i_private is not NULL, before doing the assignment. I don't know if that difference is important in this case. base: git://linuxtv.org/media_tree.g

Re: [PATCH 0/7] fix typo

2016-05-17 Thread Julia Lawall
On Tue, 17 May 2016, Kalle Valo wrote: > Julia Lawall <julia.law...@lip6.fr> writes: > > > firmare -> firmware > > > > --- > > > > drivers/media/dvb-frontends/mn88473.c |2 +- > > drivers/net/wireless/ath/ath6kl/core.h |2

[PATCH 0/7] fix typo

2016-05-17 Thread Julia Lawall
firmare -> firmware --- drivers/media/dvb-frontends/mn88473.c |2 +- drivers/net/wireless/ath/ath6kl/core.h |2 +- drivers/net/wireless/marvell/mwifiex/pcie.c |2 +- drivers/scsi/pm8001/pm8001_init.c |2 +- drivers/scsi/snic/snic_fwint.h |2

[PATCH 3/7] [media] mn88472: fix typo

2016-05-17 Thread Julia Lawall
firmare -> firmware Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/staging/media/mn88472/mn88472.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index 7ea749c

[PATCH 2/7] [media] mn88473: fix typo

2016-05-17 Thread Julia Lawall
firmare -> firmware Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/dvb-frontends/mn88473.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c index 6c5d5921..8f7b6

[PATCH] [media] mtk-vcodec: constify venc_common_if structures

2016-08-09 Thread Julia Lawall
The venc_common_if structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h|2 +- drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c

[PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings

2016-09-06 Thread Julia Lawall
PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Tiffany Lin <tiffany@mediatek.com> Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- mtk_vcode

[PATCH] [media] pci: constify snd_pcm_ops structures

2016-09-07 Thread Julia Lawall
; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, @p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // Signed-off-by: Julia Lawall

[PATCH] [media] usb: constify snd_pcm_ops structures

2016-09-07 Thread Julia Lawall
; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, @p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // Signed-off-by: Julia Lawall

Re: [PATCH] [media] pci: constify snd_pcm_ops structures

2016-09-07 Thread Julia Lawall
On Thu, 8 Sep 2016, Andrey Utkin wrote: > Thanks for looking into this. > I have tested that it compiles and passes checks (C=2) cleanly after > this patch. > > Acked-by: Andrey Utkin > > While we're at it, what about constification of > *-core.c:static struct

Re: [PATCH] [media] pci: constify vb2_ops structures

2016-09-09 Thread Julia Lawall
On Fri, 9 Sep 2016, Andrey Utkin wrote: > On Fri, Sep 09, 2016 at 01:59:18AM +0200, Julia Lawall wrote: > > Check for vb2_ops structures that are only stored in the ops field of a > > vb2_queue structure. That field is declared const, so vb2_ops structures > > that h

Re: [PATCH] [media] pci: constify vb2_ops structures

2016-09-09 Thread Julia Lawall
On Fri, 9 Sep 2016, Andrey Utkin wrote: > On Fri, Sep 09, 2016 at 10:31:30PM +0800, Julia Lawall wrote: > > Will this soon reach linux-next? > > No idea. Indeed it's simpler if you leave your patch as is, and then > later we patch this new driver separately.

[PATCH 3/3] [media] mxl111sf-tuner: constify dvb_tuner_ops structures

2016-09-11 Thread Julia Lawall
dvb_tuner_ops i = { ... }; // Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-t

[PATCH 2/3] [media] tuners: constify dvb_tuner_ops structures

2016-09-11 Thread Julia Lawall
dvb_tuner_ops i = { ... }; // Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- drivers/media/tuners/mt2063.c |2 +- drivers/media/tuners/mt20xx.c |4 ++-- drivers/media/tuners/mxl5007t.c |2 +- drivers/media/tuners/tda827x.c |4 ++-- drivers/media/

[PATCH 0/3] constify dvb_tuner_ops structures

2016-09-11 Thread Julia Lawall
Constify dvb_tuner_ops structures --- drivers/media/dvb-frontends/ascot2e.c |2 +- drivers/media/dvb-frontends/dvb-pll.c |2 +- drivers/media/dvb-frontends/helene.c |4 ++-- drivers/media/dvb-frontends/horus3a.c |2 +-

Re: [PATCH 00/26] constify local structures

2016-09-11 Thread Julia Lawall
On Sun, 11 Sep 2016, Joe Perches wrote: > On Sun, 2016-09-11 at 15:05 +0200, Julia Lawall wrote: > > Constify local structures. > > Thanks Julia. > > A few suggestions & questions: > > Perhaps the script should go into scripts/coccinelle/ > so that future

<    1   2   3   4   >