[PATCH] netfilter: nf_conntrack: consolidate lock/unlock into unlock_wait

2016-03-14 Thread Nicholas Mc Guire
The spin_lock()/spin_unlock() is synchronizing on the nf_conntrack_locks_all_lock which is equivalent to spin_unlock_wait() but the later should be more efficient. Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with: x86_64_defconfig (implies CONFIG_NETFILTER=y) Simple run test

Re: [PATCH] net: consolidate lock/unlock into unlock_wait

2016-03-19 Thread Nicholas Mc Guire
On Fri, Mar 18, 2016 at 03:35:18PM -0700, Joe Perches wrote: > On Fri, 2016-03-18 at 17:37 -0400, David Miller wrote: > > From: Nicholas Mc Guire > > > The spin_lock()/spin_unlock() is synchronizing on the adapter->work_lock > > > as the comment also su

[PATCH] net: consolidate lock/unlock into unlock_wait

2016-03-19 Thread Nicholas Mc Guire
The spin_lock()/spin_unlock() is synchronizing on the adapter->work_lock as the comment also suggests, which is equivalent to spin_unlock_wait() but the later should be more efficient. Signed-off-by: Nicholas Mc Guire --- Problem located by coccinelle spatch Patch was compile tested w

[PATCH] sctp: consolidate local_bh_disable/enable + spin_lock/unlock to _bh variant

2016-03-13 Thread Nicholas Mc Guire
local_bh_disable() + spin_lock() is equivalent to spin_lock_bh(), same for the unlock/enable case, so replace the calls by the appropriate wrappers. Signed-off-by: Nicholas Mc Guire --- net-next 3c8e43ba "sctp: remove macros sctp_spin_[un]lock" and net-next 79b91130 "sctp

[PATCH] rsi: consolidate kmalloc/memset 0 calls to kzalloc

2015-12-19 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_defconfig + CONFIG_RSI_91X

[PATCH] rsi: bool tests do not need comparison

2015-12-19 Thread Nicholas Mc Guire
This is an API consolidation only. Bool initializations should use true and false thus bool tests don't need an explicit comparison. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle: scripts/coccinelle/misc/boolinit.cocci Patch was compile tested with: x86_64_defc

[PATCH] ibmveth: consolidate kmalloc of array, memset 0 to kcalloc

2015-12-20 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 is equivalent to kcalloc in this case as it is allocating an array of elements. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was

[PATCH] wlcore: consolidate kmalloc + memset 0 into kzalloc

2015-12-21 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_defconfig + CONFIG_WL12XX=m

Re: [PATCH] wlcore: consolidate kmalloc + memset 0 into kzalloc

2015-12-21 Thread Nicholas Mc Guire
On Tue, Dec 22, 2015 at 09:56:10AM +1100, Julian Calaby wrote: > Hi, > > On Tue, Dec 22, 2015 at 3:47 AM, Nicholas Mc Guire wrote: > > This is an API consolidation only. The use of kmalloc + memset to 0 > > is equivalent to kzalloc. > > > > Signed-off-by: Nichola

[PATCH] ath10k: txrx: remove unreachable negative return check and fixup type

2015-06-11 Thread Nicholas Mc Guire
named variable is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARD=y CONFIG_ATH10K=m Patch is against 4.1-rc7 (localversion-next is -next-20150611) drivers/net/wireless/ath/ath10k/txrx.c |6 +++--- 1 fil

[PATCH] ath10k: mac: remove unreachable negative return check

2015-06-11 Thread Nicholas Mc Guire
named variable is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARD=y CONFIG_ATH10K=m Patch is against 4.1-rc7 (localversion-next is -next-20150611) drivers/net/wireless/ath/ath10k/mac.c | 10 +-

[BUG ?] delay always evaluates to 0

2015-06-12 Thread Nicholas Mc Guire
Hi ! commit 2c86c275015c ("Add ipw2100 wireless driver.") introduced drivers/net/wireless/ipw2100.c - line-numbers are from next-20150511 1410 static int ipw2100_hw_phy_off(struct ipw2100_priv *priv) 1411 { 1412 1413 #define HW_PHY_OFF_LOOP_DELAY (HZ / 5000) 141

[BUG ?] rtlwifi: rtl8723be: condition with no effect

2015-06-13 Thread Nicholas Mc Guire
From: Nicholas Mc Guire scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886 WARNING: condition with no effect (if branch == else) Added in 'commit a619d1abe20c ("rtlwifi:

[BUG ?] irda: via-ircc: condition with no effect

2015-06-13 Thread Nicholas Mc Guire
From: Nicholas Mc Guire scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/net/irda/via-ircc.c:598 WARNING: condition with no effect (if branch == else) This code was added prior to the transition to git (Linux-2.6.12-rc2

Re: [BUG ?] rtlwifi: rtl8723be: condition with no effect

2015-06-14 Thread Nicholas Mc Guire
On Sun, 14 Jun 2015, Larry Finger wrote: > On 06/13/2015 05:43 AM, Nicholas Mc Guire wrote: >> From: Nicholas Mc Guire >> >> scanning for trivial bug-patters with coccinelle spatches returned: >> ./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886 >> WARN

[PATCH] wireless: ipw2100: fix timeout bug - always evaluated to 0

2015-06-15 Thread Nicholas Mc Guire
commit: commit 2c86c275015c ("Add ipw2100 wireless driver.") introduced HW_PHY_OFF_LOOP_DELAY (HZ / 5000) which always evaluated to 0. Clarified by Stanislav Yakovlev that it should be 50 milliseconds thus fixed up to msecs_to_jiffies(50). Signed-off-by: Nicholas Mc Guire ---

Re: [BUG ?] delay always evaluates to 0

2015-06-15 Thread Nicholas Mc Guire
On Mon, 15 Jun 2015, Stanislav Yakovlev wrote: > Hi Nicholas, > > On 12 June 2015 at 20:58, Nicholas Mc Guire wrote: > > Hi ! > > > > commit 2c86c275015c ("Add ipw2100 wireless driver.") introduced > > > > drivers/net/wireless/ipw2100.c - line-n

[BUG ?] brcmsmac: condition with no effect

2015-07-08 Thread Nicholas Mc Guire
From: Nicholas Mc Guire scanning for trivial bug-patters with coccinelle spatches returned: drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c:3391 WARNING: condition with no effect (if branch == else) added in 'commit 5b435de0d786

[PATCH] mwifiex: drop condition with no effect

2015-07-08 Thread Nicholas Mc Guire
nk")' with dev_dbg/dev_err (though with the same message) to differentiate severity and then in 'commit acebe8c10a6e ("mwifiex: change dbg print func to mwifiex_dbg")' all dev_dbg,dev_warn and dev_err got converted to mwifiex_dbg which should thus probably drop this if/e

Re: [PATCH] mwifiex: drop condition with no effect

2015-07-08 Thread Nicholas Mc Guire
On Wed, 08 Jul 2015, Avinash Patil wrote: > Hi Nicholas, > > On Wed, Jul 8, 2015 at 7:15 AM, Nicholas Mc Guire wrote: > > scanning for trivial bug-patters with coccinelle spatches returned: > > ./drivers/net/wireless/mwifiex/sta_cmdresp.c:895 > > WARNING: c

[PATCH] irda: irda-usb: use msecs_to_jiffies for conversions

2015-05-23 Thread Nicholas Mc Guire
ersion-next is -next-20150522) Signed-off-by: Nicholas Mc Guire --- V2: the unnecessary () flagged by Joe Perches was removed - thanks (...once again...) ! drivers/net/irda/irda-usb.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/irda/irda-usb.c b/d

[PATCH] net: use msecs_to_jiffies for conversion to jiffies

2015-05-23 Thread Nicholas Mc Guire
ion to use msecs_to_jiffies(val) conversion is correct in all cases. Further the () around the arithmetic expression was dropped. Patch was compile tested for x86_64_defconfig + CONFIG_IRDA=m Patch is against 4.1-rc4 (localversion-next is -next-20150522) Signed-off-by: Nicholas Mc Guire ---

Re: [PATCH] net: use msecs_to_jiffies for conversion to jiffies

2015-05-24 Thread Nicholas Mc Guire
On Sun, 24 May 2015, David Miller wrote: > From: Nicholas Mc Guire > Date: Sat, 23 May 2015 15:43:36 +0200 > > > API compliance scanning with coccinelle flagged: > > ./net/irda/timer.c:63:35-37: use of msecs_to_jiffies probably perferable > > > > Converting mil

[PATCH V2] irda: use msecs_to_jiffies for conversion to jiffies

2015-05-24 Thread Nicholas Mc Guire
ion to use msecs_to_jiffies(val) conversion is correct in all cases. Further the () around the arithmetic expression was dropped. Patch was compile tested for x86_64_defconfig + CONFIG_IRDA=m Patch is against 4.1-rc4 (localversion-next is -next-20150522) Signed-off-by: Nicholas Mc Guire --- V

[PATCH RFC] 8139cp: make timeout HZ independent

2015-05-27 Thread Nicholas Mc Guire
is -next-20150527) Signed-off-by: Nicholas Mc Guire --- As there is no documentation of the intended timeout it might be wrong to convert it with msecs_to_jiffies as this can reduces the actual jiffies value by at least a factor of 10 - so someone that knows this driver needs to check on the

[PATCH] cosa: use msecs_to_jiffies for conversions

2015-06-06 Thread Nicholas Mc Guire
constant to jiffies with msecs_to_jiffies() Signed-off-by: Nicholas Mc Guire --- As the actually intended timeout is not documented and msecs_to_jiffies timeouts can be a factor 10 different from the current effective timeout As the original driver predates variable HZ (2.2.26 drivers/net/cosa.c also

[PATCH] wan: dscc4: fix build warning Wunused-but-set-variable

2015-06-06 Thread Nicholas Mc Guire
Fix: drivers/net/wan/dscc4.c: In function 'dscc4_open': drivers/net/wan/dscc4.c:1049:25: warning: variable 'ppriv' set but not used [-Wunused-but-set-variable] This has been in there unused since 1da177e4c3f (Linux-2.6.12-rc2) simply remove it. Signed-off-by: Nicholas Mc Guir

[PATCH] wan: dscc4: use msecs_to_jiffies for conversions

2015-06-06 Thread Nicholas Mc Guire
dependent Numeric constants passed to schedule_timeout_*() make the effective timeout HZ dependent which does not seem to be the intent here. Fixed up by converting the constant to jiffies with msecs_to_jiffies() Signed-off-by: Nicholas Mc Guire --- As the intended timeout is not documented and

Re: [PATCH] cosa: use msecs_to_jiffies for conversions

2015-06-07 Thread Nicholas Mc Guire
On Sun, 07 Jun 2015, David Miller wrote: > From: Nicholas Mc Guire > Date: Sat, 6 Jun 2015 09:51:51 +0200 > > > @@ -517,7 +517,7 @@ static int cosa_probe(int base, int irq, int dma) > > */ > > set_current_state(TASK_INTERRUPTIBLE); > >

Re: [PATCH] wan: dscc4: use msecs_to_jiffies for conversions

2015-06-07 Thread Nicholas Mc Guire
On Sun, 07 Jun 2015, David Miller wrote: > From: Nicholas Mc Guire > Date: Sat, 6 Jun 2015 10:41:06 +0200 > > > API compliance scanning with coccinelle flagged: > > ./drivers/net/wan/dscc4.c:1036:1-33: > > WARNING: timeout (10) seems HZ dependent > > .

[PATCH V2] wan: dscc4: use msecs_to_jiffies for conversions

2015-06-07 Thread Nicholas Mc Guire
dependent Numeric constants passed to schedule_timeout_*() make the effective timeout HZ dependent which does not seem to be the intent here. Fixed up by converting the constant to jiffies with msecs_to_jiffies(), passing 100ms (assuming HZ==100 in the original code). Signed-off-by: Nicholas Mc Guire

[PATCH] atm: use msecs_to_jiffies for conversions

2015-06-08 Thread Nicholas Mc Guire
with msecs_to_jiffies() As this driver was introduced in the early 2.3 series it is most likely assuming HZ=100 so the constant 50 is converted to 500ms. Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with i386_defconfig + CONFIG_ATM=y, CONFIG_ATM_IA=m Patch is against 4.1-rc6

[PATCH V2] liquidio: declare liquidio_set_rxcsum_command static

2016-08-22 Thread Nicholas Mc Guire
liquidio_set_rxcsum_command is a local function only, no need to expose it outside of lio_main.c so declare it static and make sparse happy. Signed-off-by: Nicholas Mc Guire --- V2: forgot to fix up the checkpatch.pl warnings... Detected by sparse: CHECK drivers/net/ethernet/cavium

[PATCH RFC] liquidio: make timeout HZ independent

2016-08-22 Thread Nicholas Mc Guire
schedule_timeout_* takes a timeout in jiffies but the code currently is passing in a constant which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. Signed-off-by: Nicholas Mc Guire --- Problem found by coccinelle script The below patch sets the timeout to

[PATCH] liquidio: declare liquidio_set_rxcsum_command static

2016-08-22 Thread Nicholas Mc Guire
liquidio_set_rxcsum_command is a local function only, no need to expose it outside of lio_main.c so declare it static and make sparse happy. Signed-off-by: Nicholas Mc Guire --- Detected by sparse: CHECK drivers/net/ethernet/cavium/liquidio/lio_main.c drivers/net/ethernet/cavium/liquidio

[PATCH RFC] liquidio: make timeout HZ independent

2016-12-15 Thread Nicholas Mc Guire
schedule_timeout_* takes a timeout in jiffies but the code currently is passing in a constant which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. Fixes: commit b0d66369edcd ("liquidio VF error handling") Signed-off-by: Nicholas Mc Guire --- Pro

[PATCH] liquidio CN23XX: make timeout HZ independent

2016-12-16 Thread Nicholas Mc Guire
schedule_timeout_* takes a timeout in jiffies but the code currently is passing in a constant which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. Signed-off-by: Nicholas Mc Guire --- Problem found by coccinelle spatch The current delay can vary by a

RFC if==else in halbtc8723b1ant.c

2016-10-30 Thread Nicholas Mc Guire
Hi ! in your commit f5b586909581 ("rtlwifi: btcoexist: Modify driver to support BT coexistence in rtl8723be") you introduced a if/else where both branches are the same but the comment in the else branch suggests that this might be unintended. from code review only I canĀ“t say what the int

[PATCH RFC] rtlwifi: btcoexist: fix port assignment

2016-11-06 Thread Nicholas Mc Guire
The port assignment in the if case should be to AUX not MAIN. Fixes: commit baa170229095 ("rtlwifi: btcoexist: Implement antenna selection") Signed-off-by: Nicholas Mc Guire --- problem located by coccinelle in: drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:exhalbtc_s

Re: [PATCH] net: qrtr: use protocol endiannes variable

2019-05-10 Thread Nicholas Mc Guire
On Fri, May 10, 2019 at 01:28:00PM -0700, David Miller wrote: > From: Nicholas Mc Guire > Date: Fri, 10 May 2019 03:08:53 +0200 > > > diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c > > index dd0e97f..c90edaa 100644 > > --- a/net/qrtr/qrtr.c > > +++ b/net

[PATCH V2] net: qrtr: use protocol endiannes variable

2019-05-10 Thread Nicholas Mc Guire
sparse was unable to verify endiannes correctness due to reassignment from le32_to_cpu to the same variable - fix this warning up by providing a proper __le32 type and initializing it. This is not actually fixing any bug - rather just addressing the sparse warning. Signed-off-by: Nicholas Mc