[PATCH] Staging: irda: Use !x instead of NULL comparison

2017-09-15 Thread Srishti Sharma
Test for NULL as !x where functions that return NULL on failure are used. Done using the following semantic patch by coccinelle. @ is_null @ expression E; statement S; @@ E = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...)); ( if(!E) S

[PATCH 1/2] android: binder: Remove unused vma argument

2017-09-15 Thread Sherry Yang
The vma argument in update_page_range is no longer used after 74310e06 ("android: binder: Move buffer out of area shared with user space"), since mmap_handler no longer calls update_page_range with a vma. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang --- drivers/android/binder_alloc.c | 1

[PATCH 2/2] android: binder: Don't get mm from task

2017-09-15 Thread Sherry Yang
Use binder_alloc struct's mm_struct rather than getting a reference to the mm struct through get_task_mm to avoid a potential deadlock between lru lock, task lock and dentry lock, since a thread can be holding the task lock and the dentry lock while trying to acquire the lru lock. Acked-by: Arve H

[PATCH] staging: lustre: lnet: Replace list_for_each with list_for_each_entry

2017-09-15 Thread Haneen Mohammed
Replace use of the combination of list_for_each and list_entry with list_for_each_entry to simplify the code and remove variables that are used only in list_for_each. Issue found and corrected using Coccinelle script: @r@ expression head, member, e; type T1, T2, T3; iterator name list_for_each, li

Re: [PATCH v2] staging: iio: tsl2x7x: clean up limit checks

2017-09-15 Thread Brian Masney
On Fri, Sep 08, 2017 at 01:53:43PM +0300, Dan Carpenter wrote: > The background of this code is that we can either use the default > tables or load our own table with sysfs. The default tables are three > element arrays of struct tsl2x7x_lux. If we load the table with sysfs > then we can have as

Re: [PATCH 2/2] Staging: irda: Remove parentheses on the right of assignment

2017-09-15 Thread Joe Perches
On Sat, 2017-09-16 at 02:36 +0530, Srishti Sharma wrote: > Parentheses are not needed on the right hand side of assignment > statement in most cases. Done using the following semantic > patch by coccinelle. [] > @@ > identifier E,F,G,f; > expression e,r; > @@ > > ( > E = (G == F); > > > > E = (e

Re: [Outreachy kernel] Re: [PATCH 2/2] Staging: irda: Remove parentheses on the right of assignment

2017-09-15 Thread Julia Lawall
On Fri, 15 Sep 2017, Joe Perches wrote: > On Sat, 2017-09-16 at 02:36 +0530, Srishti Sharma wrote: > > Parentheses are not needed on the right hand side of assignment > > statement in most cases. Done using the following semantic > > patch by coccinelle. > [] > > @@ > > identifier E,F,G,f; > > e

Re: [PATCH net] netvsc: increase default receive buffer size

2017-09-15 Thread David Miller
From: Stephen Hemminger Date: Thu, 14 Sep 2017 09:31:07 -0700 > The default receive buffer size was reduced by recent change > to a value which was appropriate for 10G and Windows Server 2016. > But the value is too small for full performance with 40G on Azure. > Increase the default back to maxi

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 2:39 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> On Sat, Sep 16, 2017 at 1:30 AM, Julia Lawall wrote: >> > >> > >> > On Sat, 16 Sep 2017, Srishti Sharma wrote: >> > >> >> Write assignment statement outside the if statement. Done using >> >

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Julia Lawall
On Sat, 16 Sep 2017, Srishti Sharma wrote: > On Sat, Sep 16, 2017 at 1:30 AM, Julia Lawall wrote: > > > > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > > > >> Write assignment statement outside the if statement. Done using > >> the following semantic patch by coccinelle. > >> > >> @@ > >> id

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:30 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> Write assignment statement outside the if statement. Done using >> the following semantic patch by coccinelle. >> >> @@ >> identifier E; >> expression F; >> statement S; >> @@ >> >> -if((E =

[PATCH 2/2] Staging: irda: Remove parentheses on the right of assignment

2017-09-15 Thread Srishti Sharma
Parentheses are not needed on the right hand side of assignment statement in most cases. Done using the following semantic patch by coccinelle. @@ identifier E,F,G,f; expression e,r; @@ ( E = (G == F); | E = (e == r); | E = -( ... -) ; ) Signed-off-by: Srishti Sharma --- drivers/staging/irda/d

[PATCH 1/2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside of the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F; +if(E) S Signed-off-by: Srishti Sharma --- drivers/staging/irda/drivers/irda-usb.c | 4 ++-- drivers/staging/ir

[PATCH 0/2] Assign outside if

2017-09-15 Thread Srishti Sharma
This patch series intends to remove the assignment statements inside the if statement, and eliminates the cases of parentheses around the right hand side of assignment generated as a result of the same. Srishti Sharma (2): Staging: irda: Don't use assignment inside if statement Staging: irda

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Julia Lawall
On Sat, 16 Sep 2017, Srishti Sharma wrote: > Write assignment statement outside the if statement. Done using > the following semantic patch by coccinelle. > > @@ > identifier E; > expression F; > statement S; > @@ > > -if((E = F)) > +E = F; > +if(E) > S > > Signed-off-by: Srishti Sharma Acke

[PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F; +if(E) S Signed-off-by: Srishti Sharma --- Changes in v2: -Semicolon was missing in one of the statements of the

Re: [Outreachy kernel] [PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:08 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> Write assignment statement outside the if statement. Done using >> the following semantic patch by coccinelle. >> >> @@ >> identifier E; >> expression F; >> statement S; >> @@ >> >> -if((E =

Re: [Outreachy kernel] [PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Julia Lawall
On Sat, 16 Sep 2017, Srishti Sharma wrote: > Write assignment statement outside the if statement. Done using > the following semantic patch by coccinelle. > > @@ > identifier E; > expression F; > statement S; > @@ > > -if((E = F)) > +E = F The line above would need to end in a ; This ends up w

Re: [PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:03 AM, Srishti Sharma wrote: > Write assignment statement outside the if statement. Done using > the following semantic patch by coccinelle. > > @@ > identifier E; > expression F; > statement S; > @@ > > -if((E = F)) > +E = F > +if(E) > S > > Signed-off-by: Srishti Shar

[PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F +if(E) S Signed-off-by: Srishti Sharma --- drivers/staging/irda/drivers/irda-usb.c | 4 ++-- drivers/staging/irda/dri

[PATCH] staging: unisys/visorbus: add __init/__exit annotations

2017-09-15 Thread Arnd Bergmann
gcc-4.6 causes a harmless warning about the init function: WARNING: vmlinux.o(.text+0xed62c2): Section mismatch in reference from the function init_unisys() to the function .init.text:visorutil_spar_detect() The function init_unisys() references the function __init visorutil_spar_detect(). This i

RE: [PATCH 1/1] Drivers: hv: vmbus: Fix rescind handling issues

2017-09-15 Thread KY Srinivasan
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Friday, September 15, 2017 6:49 AM > To: KY Srinivasan > Cc: Stephen Hemminger ; o...@aepfle.de; > Stephen Hemminger ; > gre...@linuxfoundation.org; jasow...@redhat.com; linux- > ker...@vger.kernel.org; a.

Re: [PATCH 1/1] Drivers: hv: vmbus: Fix rescind handling issues

2017-09-15 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Stephen Hemminger writes: > >> On Fri, 11 Aug 2017 10:03:59 -0700 >> k...@exchange.microsoft.com wrote: >> >>> From: K. Y. Srinivasan >>> >>> This patch handles the following issues that were observed when we are >>> handling racing channel offer message and rescind

Re: [Outreachy kernel] [PATCH] staging: rtlwifi: delete double assignment

2017-09-15 Thread Julia Lawall
On Fri, 15 Sep 2017, Harsha Sharma wrote: > Remove two adjacent assignments to the same location. > In practice, many such occurences are intentional but > this case don't seem to fall into that category. > Done using following coccinelle semantic patch > > @@ > expression e1,e2,e3; > @@ > > ( >

Re: [PATCH 1/1] Drivers: hv: vmbus: Fix rescind handling issues

2017-09-15 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Fri, 11 Aug 2017 10:03:59 -0700 > k...@exchange.microsoft.com wrote: > >> From: K. Y. Srinivasan >> >> This patch handles the following issues that were observed when we are >> handling racing channel offer message and rescind message for the same >> offer: >> >>

[PATCH] staging: rtl8188eu: remove parenthesis from right hand side of assignment

2017-09-15 Thread Aishwarya Pant
Parenthesis are not needed around the right hand side of an assignment. This patch was made on the core files of rtl8188eu using the following coccinelle script. @@ binary operator op = {==,!=,&&,||,>=,<=,&,|}; expression l, r, t; @@ ( l = (r op t) | l = -( r -) ) Signed-off-by: Aishwarya Pant

[PATCH] staging: rtlwifi: delete double assignment

2017-09-15 Thread Harsha Sharma
Remove two adjacent assignments to the same location. In practice, many such occurences are intentional but this case don't seem to fall into that category. Done using following coccinelle semantic patch @@ expression e1,e2,e3; @@ ( (<+...e1++...+>)=e2; | (<+...e1--...+>)=e2; | (<+...++e1...+>