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
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
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
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
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
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
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:
> > > >
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
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:
> > >>
> >
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
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
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
[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
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:
> > >
> > &
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:
> > >
> > >
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
_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
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
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
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
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
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:
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
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
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 !
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
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
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
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
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
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:
> >>
> >
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
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
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
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
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
;
+ 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 ++---
> 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.
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
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
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 +--
> > >
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
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
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
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
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
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
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
&
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
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
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
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 !=
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
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
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 !=
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 !
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 !=
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
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
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
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
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
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
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
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
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
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;
@@
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
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
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 - 100 of 173 matches
Mail list logo