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
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
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
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
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
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
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
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
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
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
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
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
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 },
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
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
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
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
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) \
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
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
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
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
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
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:
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
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
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
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
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
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
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
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):
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')
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
);
+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
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
);
+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
);
+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
= 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
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
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;
@@
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:
!= 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
!= 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
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;
...
!= 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
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:
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
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
;
@@
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
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
;
@@
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
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
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 +-
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
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
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
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
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
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
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
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
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
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
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
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 +-
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
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
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
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>
> >
> > ---
> >
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
>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 <=
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
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"
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?
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
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
> >
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
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
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
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
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>
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
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
;
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
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
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
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
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
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
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
;
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
;
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
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
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
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.
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
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/
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 +-
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
101 - 200 of 307 matches
Mail list logo