[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 <hof...@osadl.org> --- Problem found by coccinelle spatch The current

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

[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 <hof...@osadl.org> --- problem located by coccinelle in: drivers/net/wireless/realtek/r

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

[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 <hof...@osadl.org> --- Problem found by coccinelle script The below

[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 <hof...@osadl.org> --- Detected by sparse: CHECK drivers/net/ethernet/cavium/liquidio/lio_main.c drivers/net/et

[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 <hof...@osadl.org> --- V2: forgot to fix up the checkpatch.pl warnings... Detected by sparse: CHECK drive

[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 <hof...@osadl.org> --- Problem located by coccinelle spatch Patch wa

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 <hof...@osadl.org> > > > The spin_lock()/spin_unlock() is synchronizing on the adapter->work_lock > > >

[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 <hof...@osadl.org> --- Patch was compile tested with: x86_64_defconfig (implies CONFIG_NET

[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 <hof...@osadl.org> --- net-next 3c8e43ba "sctp: remove macros sctp_spin_[un]lock" and net-nex

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 <hof...@osadl.org> wrote: > > This is an API consolidation only. The use of kmalloc + memset to 0 > > is equivalent to kzalloc. > > > >

[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 <hof...@osadl.org> --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_def

[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 <hof...@osadl.org> --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/k

[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 <hof...@osadl.org> --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_def

[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 <hof...@osadl.org> --- Found by coccinelle: scripts/coccinelle/misc/boolinit.cocci Patch was compile

[BUG ?] brcmsmac: condition with no effect

2015-07-08 Thread Nicholas Mc Guire
From: Nicholas Mc Guire hof...@osadl.org 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

[PATCH] mwifiex: drop condition with no effect

2015-07-08 Thread Nicholas Mc Guire
)' 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/else as well. Signed-off-by: Nicholas Mc Guire

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 hof...@osadl.org wrote: scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/net/wireless/mwifiex/sta_cmdresp.c:895 WARNING: condition with no effect

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 der.h...@hofr.at wrote: Hi ! commit 2c86c275015c (Add ipw2100 wireless driver.) introduced drivers/net/wireless/ipw2100.c - line-numbers are from next-20150511 1410 static int

[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 stas.yakov...@gmail.com that it should be 50 milliseconds thus fixed up to msecs_to_jiffies(50). Signed-off-by: Nicholas Mc Guire

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 hof...@osadl.org scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886 WARNING: condition with no effect

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

2015-06-13 Thread Nicholas Mc Guire
From: Nicholas Mc Guire hof...@osadl.org 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

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

2015-06-13 Thread Nicholas Mc Guire
From: Nicholas Mc Guire hof...@osadl.org 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

[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) 1414

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

2015-06-11 Thread Nicholas Mc Guire
and the assignments fixed up. Signed-off-by: Nicholas Mc Guire hof...@osadl.org --- 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 file changed

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

2015-06-11 Thread Nicholas Mc Guire
and the assignments fixed up. Signed-off-by: Nicholas Mc Guire hof...@osadl.org --- 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 +- 1 file

[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 hof...@osadl.org --- Patch was compile tested with i386_defconfig + CONFIG_ATM=y, CONFIG_ATM_IA=m Patch

[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

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 hof...@osadl.org 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 ./drivers/net/wan/dscc4.c:554

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 hof...@osadl.org 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); cosa_putstatus

[PATCH] cosa: use msecs_to_jiffies for conversions

2015-06-06 Thread Nicholas Mc Guire
the constant to jiffies with msecs_to_jiffies() Signed-off-by: Nicholas Mc Guire hof...@osadl.org --- 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

[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 Guire hof...@osadl.org

[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 hof...@osadl.org --- As the intended timeout

[PATCH RFC] 8139cp: make timeout HZ independent

2015-05-27 Thread Nicholas Mc Guire
is -next-20150527) Signed-off-by: Nicholas Mc Guire hof...@osadl.org --- 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

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

2015-05-25 Thread Nicholas Mc Guire
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 hof...@osadl.org

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 hof...@osadl.org 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 milliseconds to jiffies by val

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

2015-05-23 Thread Nicholas Mc Guire
-20150522) Signed-off-by: Nicholas Mc Guire hof...@osadl.org --- V2: the unnecessary () flagged by Joe Perches j...@perches.com 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

[PATCH] net: use msecs_to_jiffies for conversion to jiffies

2015-05-23 Thread Nicholas Mc Guire
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 hof...@osadl.org