[PATCH 13/15] drivers/usb/musb/omap2430.c: adjust duplicate test

2013-01-21 Thread Julia Lawall
From: Julia Lawall Delete successive tests to the same location. Data is the just previously allocated and tested value. Test the result of the allocation made here instead. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @s

[PATCH 2/15] drivers/usb/chipidea/core.c: adjust duplicate test

2013-01-21 Thread Julia Lawall
From: Julia Lawall Delete successive tests to the same location. In this case res has already been tested for being NULL, and calling devm_request_and_ioremap will not make it NULL. On the other hand, devm_request_and_ioremap can return NULL on failure. A simplified version of the semantic

[PATCH 00/26] constify local structures

2016-09-11 Thread Julia Lawall
Constify local structures. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // // The first rule ignores some cases that posed problems @r disable optional_qualifier@ identifier s != {peri_clk_data,threshold_attr,tracer_flags,tracer}; identifier i != {s5k5baf

[PATCH 16/26] ezusb: constify local structures

2016-09-11 Thread Julia Lawall
in a variable. Declare structures having all of these properties as const. Done using Coccinelle. Based on a suggestion by Joe Perches . Signed-off-by: Julia Lawall --- The semantic patch seems too long for a commit log, but is in the cover letter. drivers/usb/misc/ezusb.c |2 +- 1 file

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 cases

Re: [PATCH 00/26] constify local structures

2016-09-12 Thread Julia Lawall
On Sun, 11 Sep 2016, Jarkko Sakkinen wrote: > On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote: > > Constify local structures. > > > > The semantic patch that makes this change is as follows: > > (http://coccinelle.lip6.fr/) > > Just my two cents b

Re: [PATCH 00/26] constify local structures

2016-09-12 Thread Julia Lawall
On Mon, 12 Sep 2016, Jarkko Sakkinen wrote: > On Mon, Sep 12, 2016 at 10:54:07AM +0200, Julia Lawall wrote: > > > > > > On Sun, 11 Sep 2016, Jarkko Sakkinen wrote: > > > > > On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote: > > > >

Re: [PATCH 00/26] constify local structures

2016-09-12 Thread Julia Lawall
On Mon, 12 Sep 2016, Felipe Balbi wrote: > > Hi, > > Jarkko Sakkinen writes: > > On Mon, Sep 12, 2016 at 10:54:07AM +0200, Julia Lawall wrote: > >> > >> > >> On Sun, 11 Sep 2016, Jarkko Sakkinen wrote: > >> > >> > On Sun, Sep 1

Re: [PATCH 00/26] constify local structures

2016-09-12 Thread Julia Lawall
On Mon, 12 Sep 2016, Jarkko Sakkinen wrote: > On Mon, Sep 12, 2016 at 04:43:58PM +0300, Felipe Balbi wrote: > > > > Hi, > > > > Jarkko Sakkinen writes: > > > On Mon, Sep 12, 2016 at 10:54:07AM +0200, Julia Lawall wrote: > > >> > >

Re: [Outreachy kernel] [PATCH 5/6] staging: lustre: Remove unnecessary 'return'

2016-09-15 Thread Julia Lawall
On Thu, 15 Sep 2016, Rehas Sachdeva wrote: > Fixes checkpatch.pl warning: > WARNING: void function return statements are not generally useful. It would be better to say what you did, rather than saying fix. Here you could say: Remove unnecessary void return at the end of a function. Issue dete

question about drivers/usb/musb/musb_core.c

2016-10-28 Thread Julia Lawall
The file drivers/usb/musb/musb_core.c contains the code: static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); Is it correct to have NULL in the third argument for an attribute that can be read? Should the permission be 0444 instead? thanks, julia -- To unsubscribe from this list: send the line

Re: question about drivers/usb/musb/musb_core.c

2016-10-28 Thread Julia Lawall
On Fri, 28 Oct 2016, Julia Lawall wrote: > The file drivers/usb/musb/musb_core.c contains the code: > > static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); > > Is it correct to have NULL in the third argument for an attribute that can > be read? Should the permission be 04

Re: question about drivers/usb/musb/musb_core.c

2016-10-28 Thread Julia Lawall
[Corrected email for Felipe] On Fri, 28 Oct 2016, Greg Kroah-Hartman wrote: > On Fri, Oct 28, 2016 at 10:33:19PM +0200, Julia Lawall wrote: > > > > > > On Fri, 28 Oct 2016, Julia Lawall wrote: > > > > > The file drivers/usb/musb/musb_core.c contains the code

Re: question about drivers/usb/musb/musb_core.c

2016-10-28 Thread Julia Lawall
On Fri, 28 Oct 2016, Greg Kroah-Hartman wrote: > On Fri, Oct 28, 2016 at 10:33:19PM +0200, Julia Lawall wrote: > > > > > > On Fri, 28 Oct 2016, Julia Lawall wrote: > > > > > The file drivers/usb/musb/musb_core.c contains the code: > > > > > &

Re: question about drivers/usb/musb/musb_core.c

2016-10-28 Thread Julia Lawall
On Fri, 28 Oct 2016, Bin Liu wrote: > On Fri, Oct 28, 2016 at 04:53:03PM -0400, Greg Kroah-Hartman wrote: > > On Fri, Oct 28, 2016 at 10:33:19PM +0200, Julia Lawall wrote: > > > > > > > > > On Fri, 28 Oct 2016, Julia Lawall wrote: > > > > > >

[PATCH 00/15] use permission-specific DEVICE_ATTR variants

2016-10-29 Thread Julia Lawall
Use DEVICE_ATTR_RO etc. for read only attributes etc. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The complete semantic patch is as follows: (http://coccinelle.lip6.fr/) // @ro@ declarer name DEVICE_ATTR; identifier x,x_show; @@ DEVICE_ATTR

[PATCH 02/15] wusbcore: wusbhc: use permission-specific DEVICE_ATTR variants

2016-10-29 Thread Julia Lawall
_ATTR_RW; identifier rw.x,rw.x_show,rw.x_store; @@ - DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store); + DEVICE_ATTR_RW(x); // Signed-off-by: Julia Lawall --- drivers/usb/wusbcore/wusbhc.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/usb/wus

[PATCH 01/15] wusbcore: dev-sysfs: use permission-specific DEVICE_ATTR variants

2016-10-29 Thread Julia Lawall
TTR(x, \(0444\|S_IRUGO\), x_show, NULL); + DEVICE_ATTR_RO(x); // Signed-off-by: Julia Lawall --- drivers/usb/wusbcore/dev-sysfs.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/wusbcore/dev-sysfs.c b/drivers/usb/wusbcore/dev-sysfs.c index 415b140..d4de56b 10

Re: [PATCH 2/9] usb: host: max3421-hcd: use list_for_each_entry*

2015-12-18 Thread Julia Lawall
Geliang, Please check whether line 762 can be reached in the case where the list_for_each_entry reaches the end of the list. If that can happen, max3421_ep should not be dereferenced. julia On Sat, 19 Dec 2015, kbuild test robot wrote: > CC: kbuild-...@01.org > In-Reply-To: > <45e8397e370ed99

Re: [PATCH 5/9] usb: xhci: use list_for_each_entry

2015-12-18 Thread Julia Lawall
Geliang, Please check whether it is acceptable that last_unlinked_td point to the dummy entry at th beginning of the list, in the case where the list_for_each_entry loop runs out normally. It seems that you have sent a bunch of these patches. Please recheck them all to see if they really follow

[PATCH] usb: gadget: rndis: fix itnull.cocci warnings

2015-12-18 Thread Julia Lawall
The index variable of list_for_each_entry_safe is never NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Geliang Tang Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- rndis.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget

Re: [PATCH 7/9] usb: dwc2: host: use list_for_each_entry_safe

2015-12-18 Thread Julia Lawall
The call on line 1120 looks suspicious, because qtd could be non-null but also not a valid element, if the loop has exited normally. julia On Sat, 19 Dec 2015, kbuild test robot wrote: > CC: kbuild-...@01.org > In-Reply-To: > > TO: Geliang Tang > CC: John Youn , Greg Kroah-Hartman > > CC:

Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings

2015-12-22 Thread Julia Lawall
On Tue, 22 Dec 2015, Felipe Balbi wrote: > Julia Lawall writes: > > > The index variable of list_for_each_entry_safe is never NULL. > > > > Generated by: scripts/coccinelle/iterators/itnull.cocci > > > > CC: Geliang Tang > > Signed-off-by: Fen

[PATCH 4/7] usb: gadget: legacy: fix error return code

2015-12-26 Thread Julia Lawall
amp;ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall --- drivers/usb/gadget/legacy/acm_ms.c |4 +++- drivers/usb/gadget/legacy/audio.c|4 +++- drivers/usb/gadget/legacy/cdc2.c |4 +++- drivers/usb/gadget

[PATCH 0/7] fix error return code

2015-12-26 Thread Julia Lawall
The complate semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @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; ... when !

[PATCH 0/2] remove assignment from IS_ERR argument

2015-12-26 Thread Julia Lawall
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; statement S1,S2; @@ +e1 = e2; if (IS_ERR( e1 - = e2 )) S1 else S2 // --- drivers/usb/mon/mon_text.c |6 -- ipc/mqueue.c |3 ++- 2 files changed, 6

[PATCH 2/2] USB: usbmon: remove assignment from IS_ERR argument

2015-12-26 Thread Julia Lawall
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; statement S1,S2; @@ +e1 = e2; if (IS_ERR( e1 - = e2 )) S1 else S2 // Signed-off-by: Julia Lawall --- drivers/usb/mon/mon_text.c |6 -- 1 file changed, 4 insertions

[PATCH] usb: renesas_usbhs: constify usbhs_pkt_handle structures

2015-12-27 Thread Julia Lawall
The usbhs_pkt_handle structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/usb/renesas_usbhs/fifo.c | 20 ++-- drivers/usb/renesas_usbhs/fifo.h | 20 ++-- drivers/usb/renesas_usbhs

[PATCH] usbip: fix odd_ptr_err.cocci warnings

2015-12-30 Thread Julia Lawall
PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Nobuo Iwata Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- I haven't checked the complete context, but the code looks suspicious. usbip_ux.c |2 +- 1

Re: [patch v2] usb: gadget: f_midi: missing unlock on error path

2016-01-05 Thread Julia Lawall
On Tue, 5 Jan 2016, kbuild test robot wrote: > Hi Dan, > > [auto build test WARNING on balbi-usb/next] > [also build test WARNING on v4.4-rc8 next-20160105] > [if your patch is applied to the wrong git tree, please drop us a note to > help improving the system] > > url: > https://github.com

Re: [patch v2] usb: gadget: f_midi: missing unlock on error path

2016-01-05 Thread Julia Lawall
On Tue, 5 Jan 2016, Felipe Ferreri Tonello wrote: > Hi Dan, > > On 05/01/16 12:44, Dan Carpenter wrote: > > On Tue, Jan 05, 2016 at 01:28:11PM +0100, Julia Lawall wrote: > >> > >> > >> On Tue, 5 Jan 2016, kbuild test robot wrote: > >> > >

[PATCH] usb: gadget: rndis: fix itnull.cocci warnings

2016-01-25 Thread Julia Lawall
The index variable of list_for_each_entry_safe is an offset from a list pointer, and thus should not be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Geliang Tang Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux

Re: [PATCH v6 10/12] usb: dbc: add handshake between debug target and host

2016-01-26 Thread Julia Lawall
Please check. As far as I can see, the call to early_xdbc_read ends up at xdbc_bulk_transfer, which return negative error codes on failure. julia On Tue, 26 Jan 2016, kbuild test robot wrote: > CC: kbuild-...@01.org > In-Reply-To: <1453781665-4714-11-git-send-email-baolu...@linux.intel.com> > T

Re: [PATCH 0982/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Julia Lawall
On Tue, 2 Aug 2016, Baole Ni wrote: > I find that the developers often just specified the numeric value > when calling a macro which is defined with a parameter for access permission. > As we know, these numeric value for access permission have had the > corresponding macro, > and that using ma

[PATCH 00/11] use of_property_read_bool

2016-08-05 Thread Julia Lawall
Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; statement S2,S1; @@ - if (of_get_property(e1,e2,NULL)) + if (of_property_read_bool(e1,e2)) S1 else

[PATCH 02/11] usb: host: fsl-mph-dr-of: use of_property_read_bool

2016-08-05 Thread Julia Lawall
else S2 // Signed-off-by: Julia Lawall --- drivers/usb/host/fsl-mph-dr-of.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 1044b0f..8bbca74 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b

[PATCH 02/11 v2] usb: host: fsl-mph-dr-of: use of_property_read_bool

2016-08-05 Thread Julia Lawall
; + x = of_property_read_bool(e1,e2); // Signed-off-by: Julia Lawall --- v2: special case for propagating true and false drivers/usb/host/fsl-mph-dr-of.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host

Re: [PATCH 10/11] soc: ti: knav_qmss_queue: use of_property_read_bool

2016-08-05 Thread Julia Lawall
On Fri, 5 Aug 2016, Robin Murphy wrote: > Hi Julia, > > On 05/08/16 09:56, Julia Lawall wrote: > > Use of_property_read_bool to check for the existence of a property. > > This caught my eye since Rob told me off for doing the same recently[1]. > > > The semantic p

[PATCH 4/5] r8152: constify ethtool_ops structures

2016-08-31 Thread Julia Lawall
r.i; expression e; position p; @@ netdev_set_default_ethtool_ops(e, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct ethtool_ops i = { ... }; // Suggested-by: Stephen Hemminger Signed-off-b

[PATCH 0/5] constify ethtool_ops structures

2016-08-31 Thread Julia Lawall
Constify ethtool_ops structures. --- drivers/net/ethernet/mediatek/mtk_eth_soc.c |2 +- drivers/net/ethernet/synopsys/dwc_eth_qos.c |2 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c |2 +- drivers/net/usb/r8152.c |2 +- drivers/staging

[PATCH] USB: ftdi_sio: constify ftdi_sio_quirk structures

2016-04-09 Thread Julia Lawall
The ftdi_sio_quirk structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/usb/serial/ftdi_sio.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b

[PATCH 2/2] drivers/mmc/host/vub300.c: add missing usb_free_urb

2012-07-24 Thread Julia Lawall
From: Julia Lawall Add missing usb_free_urb on failure path after usb_alloc_urb. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @km exists@ local idexpression e; expression e1,e2,e3; type T,T1; identifier f; @@ * e

[PATCH 1/9] drivers/usb/host/ehci-atmel.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH] use devm_ functions

2012-07-29 Thread Julia Lawall
The semantic patch (http://coccinelle.lip6.fr/) used in generating this patch is as follows. Some manual cleanup may be required. This improves on the previous version in that more devm functions are treated. virtual after_start virtual returned virtual returnedDup virtual arg virtual all_args v

[PATCH 2/9] drivers/usb/host/ehci-au1xxx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 6/9] drivers/usb/host/ehci-ls1x.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 7/9] drivers/usb/host/ehci-msm.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. The original code was also missing a call to

[PATCH 8/9] drivers/usb/host/ehci-mv.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. A new label name is created in one case to

[PATCH 9/9] drivers/usb/host/ehci-mxc.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 3/9] drivers/usb/host/ehci-cns3xxx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 5/9] drivers/usb/host/ehci-ixp4xx.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 4/9] drivers/usb/host/ehci-grlib.c: use devm_ functions

2012-07-29 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 7/7] drivers/usb/host/ehci-xilinx-of.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 5/7] drivers/usb/host/ehci-tegra.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 1/7] drivers/usb/host/ehci-ppc-of.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 2/7] drivers/usb/host/ehci-s5p.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 3/7] drivers/usb/host/ehci-sead3.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 4/7] drivers/usb/host/ehci-sh.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 6/7] drivers/usb/host/ehci-vt8500.c: use devm_ functions

2012-07-30 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall --- Not compiled

[PATCH 3/5] drivers/usb/wusbcore/wa-hc.c: fix error return code

2012-08-13 Thread Julia Lawall
From: Julia Lawall Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret

[PATCH 5/5] drivers/usb/host/ehci-platform.c: fix error return code

2012-08-13 Thread Julia Lawall
From: Julia Lawall Convert a possibly 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret

[PATCH 1/5] drivers/usb/gadget/s3c-hsotg.c: fix error return code

2012-08-13 Thread Julia Lawall
From: Julia Lawall Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret

[PATCH 4/5] drivers/usb/host/ohci-platform.c: fix error return code

2012-08-13 Thread Julia Lawall
From: Julia Lawall Convert a possibly 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret

[PATCH 3/6] drivers/usb/gadget/lpc32xx_udc.c: adjust inconsistent IS_ERR and PTR_ERR

2012-08-25 Thread Julia Lawall
From: Julia Lawall Change the call to PTR_ERR to access the value just tested by IS_ERR. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; @@ ( if (IS_ERR(e)) { ... PTR_ERR(e) ... } | if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... } | *if

[PATCH 4/6] drivers/usb/host/ohci-nxp.c: adjust inconsistent IS_ERR and PTR_ERR

2012-08-25 Thread Julia Lawall
From: Julia Lawall Change the call to PTR_ERR to access the value just tested by IS_ERR. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; @@ ( if (IS_ERR(e)) { ... PTR_ERR(e) ... } | if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... } | *if

Re: [PATCH] backports: backport drvdata = NULL core driver fixes

2013-07-19 Thread Julia Lawall
On Fri, 19 Jul 2013, Luis R. Rodriguez wrote: > On Fri, Jul 19, 2013 at 2:07 PM, Luis R. Rodriguez > wrote: > >> This is not a very good idea. Although setting drvdata to NULL allowed > >> a lot of code to be removed, it also exposed a bunch of hidden bugs -- > >> drivers were using the drvdata

Re: [PATCH] USBIP:stub_dev.c fixing string splitted into multiple line issue

2013-07-31 Thread Julia Lawall
On Wed, 31 Jul 2013, Kumar Gaurav wrote: > Fixed String splitted into multiple line issue using macro I'm not an expert on this kind of style issue, but I prefer strings that look like strings. julia > Signed-off-by: Kumar Gaurav > --- > drivers/staging/usbip/stub_dev.c | 17 ++---

Re: [PATCH] USBIP:stub_dev.c fixing string splitted into multiple line issue

2013-08-01 Thread Julia Lawall
> Thanks you all for suggestions. I'll try finding some other way. If the strings don't fit, you can just go over 80 characters. julia -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.

[PATCH 29/29] usb: dwc3: omap: simplify use of devm_ioremap_resource

2013-08-14 Thread Julia Lawall
From: Julia Lawall 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/) // @@ expression pdev,res,n,e,e1

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

Re: [PATCH 1/6] drivers:usb:host:xhci.h Removing xhci_hcd from argument

2013-08-16 Thread Julia Lawall
On Sat, 17 Aug 2013, Kumar Gaurav wrote: > On Saturday 17 August 2013 12:30 AM, Greg KH wrote: > > On Sat, Aug 17, 2013 at 12:18:42AM +0530, Kumar Gaurav wrote: > > > Removed struct xhci_hcd from xhci_readl fucntion as it's no more in use. > > > --- > > > drivers/usb/host/xhci.h |3 +-- > > >

Re: [PATCH 5/6] for fixing xhci_readl call in xhci_hub.c after removing xhci_hcd from function definition

2013-08-17 Thread Julia Lawall
On Sat, 17 Aug 2013, Dan Carpenter wrote: > Wait what? Why did we break the build in the first place? Kumar didn't understand the relation between "one issue one patch" and "thou shalt not break the build". I believe he either has sent or will send a new patch set that makes both changes at o

[PATCH 0/6] simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
devm_ioremap_resource often uses the result of a call to platform_get_resource_byname as its last argument. devm_ioremap_resource does appropriate error handling on this argument, so error handling can be removed from the call to platform_get_resource_byname. The semantic patch that makes this ch

[PATCH 4/6] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall Remove unneeded error handling on the result of a call to platform_get_resource_byname 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/) // @@ expression pdev,res

Re: [PATCH 4/6] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, Svenning Sørensen wrote: > On 19-08-2013 10:51, Julia Lawall wrote: > > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c > > index 4ffbaac..f2f9710 100644 > > --- a/drivers/usb/musb/musb_dsps.c > > +++ b/drivers/usb/mus

[PATCH 4/6 v2] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
From: Julia Lawall Remove unneeded error handling on the result of a call to platform_get_resource_byname 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/) // @@ expression pdev,res

Re: [PATCH 4/6] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, Svenning Sørensen wrote: > > On 19-08-2013 13:35, Julia Lawall wrote: > > reg_base = devm_ioremap_resource(dev, r); > > if (!musb->ctrl_base) > > return -EINVAL; > > > Not really related to Julia's patch, apa

Re: [PATCH 4/6 v2] usb: musb: dsps: simplify platform_get_resource_byname/devm_ioremap_resource

2013-08-19 Thread Julia Lawall
On Mon, 19 Aug 2013, Sergei Shtylyov wrote: > Hello. > > On 08/19/2013 03:47 PM, Julia Lawall wrote: > > > From: Julia Lawall > > > Remove unneeded error handling on the result of a call to > > platform_get_resource_byname when the value is passed to &

[PATCH] usb: musb: dsps: fix devm_ioremap_resource error detection code

2013-08-19 Thread Julia Lawall
From: Julia Lawall devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. Furthermore, the value returned by devm_ioremap_resource should be tested. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e

[PATCH 4/16] drivers/usb/wusbcore: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by

merging printk and WARN

2012-11-04 Thread Julia Lawall
It looks like these patches were not a good idea, because in each case the printk provides an error level, and WARN then provides another one. Sorry for the noise. julia -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org

[PATCH 10/25] usb: gadget: fix error return code

2013-12-29 Thread Julia Lawall
From: Julia Lawall 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when !=

[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-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 3/4] : More use DIV_ROUND_UP

2008-02-16 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #i

[PATCH 6/7] host: ehci-w90x900: fix error return code

2014-11-20 Thread Julia Lawall
From: Julia Lawall Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when !=

[PATCH 0/7] fix error return code

2014-11-20 Thread Julia Lawall
The complate semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @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; ... when !

[PATCH 3/7] dwc3: dwc3-keystone: fix error return code

2014-11-20 Thread Julia Lawall
From: Julia Lawall Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when !=

Re: [PATCH 1/1] USB: serial: Deletion of an unnecessary check before the function call "release_firmware"

2014-11-21 Thread Julia Lawall
On Fri, 21 Nov 2014, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 21 Nov 2014 16:15:34 +0100 > > The release_firmware() function tests whether its argument is NULL > and then returns immediately. Thus the test around the call is not needed. > > This issue was detected by using t

Re: USB: serial: Deletion of an unnecessary check before the function call "release_firmware"

2014-11-21 Thread Julia Lawall
On Fri, 21 Nov 2014, SF Markus Elfring wrote: > >> diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c > >> index ab1d690..3653ec1 100644 > >> --- a/drivers/usb/serial/mxuport.c > >> +++ b/drivers/usb/serial/mxuport.c > >> @@ -1101,8 +1101,7 @@ static int mxuport_probe(struc

[PATCH] usb: dwc3: return error code from the most recent call

2014-11-22 Thread Julia Lawall
From: Julia Lawall Copy-paste error from the previous block of error handling code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1; @@ if (IS_ERR(e)) { ... ( ret = PTR_ERR(e); | * ret = PTR_ERR(e1

[PATCH] usb: gadget: fix platform_no_drv_owner.cocci warnings

2014-11-25 Thread Julia Lawall
Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Julia Lawall --- bdc_core.c |1 - 1 file changed, 1 deletion(-) --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc

[PATCH 8/8] wusb: replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
From: Julia Lawall Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr

[PATCH 0/8] replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; local idexpression e; type

[PATCH 8/8 v2] wusb: replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
From: Julia Lawall Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr

[PATCH 0/8] replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; local idexpression e; type

[PATCH 4/4] usbip: remove unneeded structure

2014-11-30 Thread Julia Lawall
From: Julia Lawall Delete a local structure that is only used to be initialized by memset. A semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x,i; @@ { ... when any -struct i x; <+... when != x - memset(&x,...); ...+> } // Sig

[PATCH 0/4] remove unneeded array

2014-11-30 Thread Julia Lawall
Remove an array or structure that only serves as the first argument to memset. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; type T; @@ { ... when any -T x[...]; <+... when != x - memset(x,...); ...+> } @@ identifier x,i; @@

[PATCH 8/20] USB: isp1760: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. The function name starts with isp, not ips. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall --- The semantic patch is difficult to summarize, but

[PATCH 18/20] usb: gadget: fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall --- The semantic patch is difficult to summarize, but is available in the cover letter of this

[PATCH 0/20] fix misspelling of current function in string

2014-12-07 Thread Julia Lawall
These patches replace what appears to be a reference to the name of the current function but is misspelled in some way by either the name of the function itself, or by %s and then __func__ in an argument list. // // sudo apt-get install python-pip // sudo pip install python-Levenshtein // spatch

  1   2   >