Re: [PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock

2019-06-23 Thread Nicholas Mc Guire
h a > struct idr.") The GFP_KERNEL actually was there befor this patch so not sure if this Fixes ref is correct - I think the GFP_KERNEL was introduced in: 4e6bafdfb9f3 ("staging: bcm2835_camera: Use a mapping table for context field of mmal_msg_header") > Signed-off-by: Christ

Re: [PATCH] staging: greybus: use proper return type for wait_for_completion_timeout

2019-04-30 Thread Nicholas Mc Guire
On Tue, Apr 30, 2019 at 12:58:21PM +0300, Dan Carpenter wrote: > On Sat, Apr 27, 2019 at 05:27:25AM +0200, Nicholas Mc Guire wrote: > > wait_for_completion_timeout() returns unsigned long (0 on timeout or > > remaining jiffies) not int. > > > > Yeah, but it's

Re: [PATCH V2] staging: fieldbus: anybus-s: force endiannes annotation

2019-04-29 Thread Nicholas Mc Guire
On Tue, Apr 30, 2019 at 04:02:23AM +0100, Al Viro wrote: > On Tue, Apr 30, 2019 at 04:22:38AM +0200, Nicholas Mc Guire wrote: > > On Mon, Apr 29, 2019 at 10:03:36AM -0400, Sven Van Asbroeck wrote: > > > On Mon, Apr 29, 2019 at 2:11 AM Nicholas Mc Guire > > > wr

Re: [PATCH V2] staging: fieldbus: anybus-s: force endiannes annotation

2019-04-29 Thread Nicholas Mc Guire
On Mon, Apr 29, 2019 at 10:03:36AM -0400, Sven Van Asbroeck wrote: > On Mon, Apr 29, 2019 at 2:11 AM Nicholas Mc Guire wrote: > > > > V2: As requested by Sven Van Asbroeck make the > > impact of the patch clear in the commit message. > > Thank you, but did you mis

[PATCH V2] staging: fieldbus: anybus-s: force endiannes annotation

2019-04-28 Thread Nicholas Mc Guire
While the endiannes is being handled correctly sparse was unhappy with the missing annotation as be16_to_cpu() expects a __be16. The __force cast to __be16 makes sparse happy but has no impact on the generated binary. Signed-off-by: Nicholas Mc Guire --- Problem reported by sparse V2: As

[PATCH V3] staging: fieldbus: anybus-s: consolidate wait_for_completion_timeout return handling

2019-04-28 Thread Nicholas Mc Guire
introducing an additional unsigned long variable. Along with fixing this type inconsistency the fall-through if is consolidated to a single if-block. Signed-off-by: Nicholas Mc Guire --- Problem located with experimental API conformance checking cocci script V3: As requested by Sven Van Asbroeck

[PATCH] staging: fieldbus: anybus-s: force endiannes annotation

2019-04-27 Thread Nicholas Mc Guire
While the endiannes is being handled correctly sparse was unhappy with the missing annotation as be16_to_cpu() expects a __be16. Signed-off-by: Nicholas Mc Guire --- Problem reported by sparse As far as I understand sparse here the __force is actually the only solution possible to inform

[PATCH V2] staging: fieldbus: anybus-s: consolidate wait_for_completion_timeout return handling

2019-04-27 Thread Nicholas Mc Guire
wait_for_completion_timeout() returns unsigned long (0 on timeout or remaining jiffies) not int - so rather than introducing an additional variable simply wrap the completion into an if(). Signed-off-by: Nicholas Mc Guire --- Problem located with experimental API conformance checking cocci

Re: [PATCH RFC] staging: fieldbus: anybus-s: use proper type for wait_for_completion_timeout

2019-04-27 Thread Nicholas Mc Guire
On Sat, Apr 27, 2019 at 03:20:54AM -0400, Sven Van Asbroeck wrote: > On Sat, Apr 27, 2019 at 3:01 AM Nicholas Mc Guire wrote: > > > > (some unrelated sparse warnings (cast to restricted __be16)) > > > > > > That sounds interesting too. Could you provide more deta

[PATCH RFC V2] staging: kpc2000: use int for wait_for_completion_interruptible

2019-04-27 Thread Nicholas Mc Guire
weit_for_completion_interruptible returns in (0 on completion and -ERESTARTSYS on interruption) - so use an int not long for API conformance and simplify the logic here a bit: need not check explicitly for == 0 as this is either -ERESTARTSYS or 0. Signed-off-by: Nicholas Mc Guire --- Problem

Re: [PATCH RFC] staging: fieldbus: anybus-s: use proper type for wait_for_completion_timeout

2019-04-27 Thread Nicholas Mc Guire
On Sat, Apr 27, 2019 at 02:17:42AM -0400, Sven Van Asbroeck wrote: > Hello Nicholas, thank you for your contribution, I really appreciate it ! > See inline comments below. > > On Sat, Apr 27, 2019 at 12:32 AM Nicholas Mc Guire wrote: > > > > wait_for_completion_timeout()

[PATCH RFC] staging: fieldbus: anybus-s: use proper type for wait_for_completion_timeout

2019-04-26 Thread Nicholas Mc Guire
wait_for_completion_timeout() returns unsigned long (0 on timeout or remaining jiffies) not int. thus there is no negative case to check for here. Signed-off-by: Nicholas Mc Guire --- Problem located with experimental API conformance checking cocci script Q: It is not really clear if the

[PATCH] staging: greybus: use proper return type for wait_for_completion_timeout

2019-04-26 Thread Nicholas Mc Guire
wait_for_completion_timeout() returns unsigned long (0 on timeout or remaining jiffies) not int. Signed-off-by: Nicholas Mc Guire --- Problem located with experimental API conformance checking cocci script Patch was compile-tested with: x86_64_defconfig + GREYBUS=m Patch is against 5.1-rc6

[PATCH RFC] staging: kpc2000: use int for wait_for_completion_interruptible

2019-04-26 Thread Nicholas Mc Guire
weit_for_completion_interruptible returns in (0 on completion and -ERESTARTSYS on interruption) - so use an int not long for API conformance and simplify the logic here a bit: need not check explicitly for == 0 as this is either -ERESTARTSYS or 0. Signed-off-by: Nicholas Mc Guire --- Problem

[PATCH V2] staging: vc04_services: handle kzalloc failure

2019-04-18 Thread Nicholas Mc Guire
then will fail with -EINVAL. Signed-off-by: Nicholas Mc Guire Reported-by: kbuild test robot --- Problem located with experimental coccinelle script V2: The != VCHIQ_SUCCES went unnoticed not clear how I did that as building drivers/staging/vc04_services/vchiq.o seemed to have succeeded

[PATCH RFC] staging: vc04_services: handle kzalloc failure

2019-04-18 Thread Nicholas Mc Guire
then will fail with -EINVAL. Signed-off-by: Nicholas Mc Guire --- Problem located with experimental coccinelle script Patch was compile-tested with: bcm2835_defconfig (implies BCM2835_VCHIQ=m) (with sparse warning: CHECK drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

[PATCH V2] staging: wilc1000: give usleep_range a range

2019-04-10 Thread Nicholas Mc Guire
From: Nicholas Mc Guire usleep_range() is called in non-atomic context so there is little point in setting min==max as the jitter of hrtimer is determined by interruptions anyway. usleep_range can only perform the intended coalescence if some room for placing the hrtimer is provided. Given the

Re: [PATCH RFC] staging: wilc1000: give usleep_range a range

2019-04-10 Thread Nicholas Mc Guire
On Wed, Apr 10, 2019 at 06:31:21PM +, adham.aboza...@microchip.com wrote: > Hi Nicolas > > On 4/8/19 6:36 PM, Nicholas Mc Guire wrote: > > On Mon, Apr 08, 2019 at 09:10:00PM +, adham.aboza...@microchip.com > > wrote: > >> Hi Nicholas > >> > >

Re: [PATCH RFC] staging: wilc1000: give usleep_range a range

2019-04-08 Thread Nicholas Mc Guire
On Mon, Apr 08, 2019 at 09:10:00PM +, adham.aboza...@microchip.com wrote: > Hi Nicholas > > On 4/6/19 5:01 AM, Nicholas Mc Guire wrote: > > External E-Mail > > > > > > Someone that knows the motivation for setting the time to 2 millisecond > > might ne

[PATCH RFC] staging: wilc1000: give usleep_range a range

2019-04-06 Thread Nicholas Mc Guire
delay will be anything from 2 to a few anyway - so make it 2-5 ms. Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script ./drivers/staging/wilc1000/wilc_wlan.c:411:4-16: WARNING: inefficient usleep_range with range 0 (min==max) ./drivers/staging/wilc1000

[PATCH V3] staging: wilc1000: drop explicit conversion to bool

2019-04-06 Thread Nicholas Mc Guire
As the expression evaluates to a boolean anyway (relational and logical operators) conversion with the ternary operator is not needed here as coccinelle notes (boolconv.cocci) Signed-off-by: Nicholas Mc Guire Reviewed-by: Julian Calaby --- V2: sent out the wrong version - the commit message

Re: [PATCH V2] staging: wilc1000: drop explicit conversion to bool

2019-04-06 Thread Nicholas Mc Guire
On Sat, Apr 06, 2019 at 08:11:55PM +1100, Julian Calaby wrote: > Hi Nicholas, > > On Sat, Apr 6, 2019 at 7:48 PM Nicholas Mc Guire wrote: > > > > As the expression evaluates to a boolean anyway (relational and logical > > operators) conversion with the ternary ope

[PATCH V2] staging: wilc1000: drop explicit conversion to bool

2019-04-06 Thread Nicholas Mc Guire
As the expression evaluates to a boolean anyway (relational and logical operators) conversion with the ternary operator is not needed here as coccinelle notes (boolconv.cocci) Signed-off-by: Nicholas Mc Guire --- V2: sent out the wrong version - the commit message was longer than 75 chars

[PATCH] staging: wilc1000: drop explicit conversion to bool

2019-04-06 Thread Nicholas Mc Guire
As the expression evaluates to a boolean anyway (relational and logical operators) conversion with the ternary operator is not needed here as coccinelle notes (boolconv.cocci) Signed-off-by: Nicholas Mc Guire --- scripts/coccinelle/misc/boolconv.cocci warned about: drivers/staging/wilc1000

[PATCH 1/2] staging:iio:accel:adis16203: add SPDX license identifier tag

2019-04-03 Thread Nicholas Mc Guire
Pop in the SPDX tag as the license is clearly indicated as GPL V2 or later this should also be indicated with a SPDX license identifier tag. Signed-off-by: Nicholas Mc Guire --- chackpatch.pl was warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Patch was compile

[PATCH 2/2] staging:iio:accel:adis16240: add SPDX license identifier tag

2019-04-03 Thread Nicholas Mc Guire
Pop in the SPDX tag as the license is clearly indicated as GPL V2 or later this should also be indicated with a SPDX license identifier tag. Signed-off-by: Nicholas Mc Guire --- chackpatch.pl was warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Patch was compile

Re: [PATCH] staging: rtlwifi: Use proper enum for return in halmac_parse_psd_data_88xx

2019-02-20 Thread Nicholas Mc Guire
r8822be: check kzalloc return or bail") > Link: https://github.com/ClangBuiltLinux/linux/issues/375 > Signed-off-by: Nathan Chancellor Reviewed-by: Nicholas Mc Guire > --- > drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 2 +- > 1 file changed, 1 i

[PATCH] staging: r8822be: check kzalloc return or bail

2019-02-15 Thread Nicholas Mc Guire
The kzalloc() in halmac_parse_psd_data_88xx() can fail and return NULL so check the psd_set->data after allocation and if allocation failed return HALMAC_CMD_PROCESS_ERROR. Signed-off-by: Nicholas Mc Guire Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-drive") ---

[PATCH V2] staging: iio: adc: ad7280a: check for devm_kasprint() failure

2018-11-27 Thread Nicholas Mc Guire
readable a temporary iio_attr is introduced and the code refactored. Signed-off-by: Nicholas Mc Guire Fixes: 2051f25d2a26 ("iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System2") --- V2: use a tmp pointer to iio_attr to make the error check more readable as propo

Re: [PATCH] staging: iio: adc: ad7280a: check for devm_kasprint() failure

2018-11-26 Thread Nicholas Mc Guire
On Mon, Nov 26, 2018 at 04:00:32PM +0300, Dan Carpenter wrote: > On Mon, Nov 26, 2018 at 10:39:04AM +0100, Nicholas Mc Guire wrote: > > devm_kasprintf() may return NULL on failure of internal allocation thus > > the assignments to attr.name are not safe if not ch

[PATCH] staging: iio: adc: ad7280a: check for devm_kasprint() failure

2018-11-26 Thread Nicholas Mc Guire
devm_kasprintf() may return NULL on failure of internal allocation thus the assignments to attr.name are not safe if not checked. On error ad7280_attr_init() returns a negative return so -ENOMEM should be OK here (passed on as return value of the probe function). Signed-off-by: Nicholas Mc

[PATCH] media: davinci_vpfe: bail out if kmalloc failed

2018-11-20 Thread Nicholas Mc Guire
pe_ioctl where a negative return is a valid indication of error so simply setting rval = -ENOMEM seems ok. Signed-off-by: Nicholas Mc Guire Fixes: da43b6ccadcf ("[media] davinci: vpfe: dm365: add IPIPE support for media controller driver") --- Problem located with experimental coccinell

Re: [PATCH 4.19 regression fix 1/2] staging: vboxvideo: Fix IRQs no longer working

2018-09-11 Thread Nicholas Mc Guire
On Tue, Sep 11, 2018 at 10:20:41AM +0300, Dan Carpenter wrote: > On Tue, Sep 11, 2018 at 06:48:27AM +0000, Nicholas Mc Guire wrote: > > On Mon, Sep 10, 2018 at 08:30:38PM +0200, Hans de Goede wrote: > > > Commit 1daddbc8dec5 ("staging: vboxvideo: Update driver to use

Re: [PATCH 4.19 regression fix 1/2] staging: vboxvideo: Fix IRQs no longer working

2018-09-11 Thread Nicholas Mc Guire
On Tue, Sep 11, 2018 at 08:53:35AM +0200, Hans de Goede wrote: > Hi, > > On 11-09-18 08:48, Nicholas Mc Guire wrote: > >On Mon, Sep 10, 2018 at 08:30:38PM +0200, Hans de Goede wrote: > >>Commit 1daddbc8dec5 ("staging: vboxvideo: Update driver to use > >>drm

Re: [PATCH 4.19 regression fix 1/2] staging: vboxvideo: Fix IRQs no longer working

2018-09-10 Thread Nicholas Mc Guire
e driver to use ...") > Cc: Fabio Rafael da Rosa > Cc: Nicholas Mc Guire > Signed-off-by: Hans de Goede Reviewed-by: Nicholas Mc Guire > --- > drivers/staging/vboxvideo/vbox_drv.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/staging/

[PATCH] staging: bcm2835-camera: fix timeout handling in wait_for_completion_timeout

2018-07-21 Thread Nicholas Mc Guire
wait_for_completion_timeout returns unsigned long not int so a variable of proper type is introduced. Further the check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case so no additional check needed here. Signed-off-by: Nicholas Mc Guire Fi

[PATCH] staging: bcm2835-camera: handle wait_for_completion_timeout return properly

2018-07-21 Thread Nicholas Mc Guire
wait_for_completion_timeout returns unsigned long not int so a variable of proper type is introduced. Further the check for <= 0 is ambiguous and should be == 0 here indicating timeout. Signed-off-by: Nicholas Mc Guire Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L

Re: [PATCH] staging: board: drop refcount in success case

2018-06-19 Thread Nicholas Mc Guire
On Tue, Jun 19, 2018 at 09:51:44AM +0200, Geert Uytterhoeven wrote: > On Tue, Jun 19, 2018 at 9:37 AM Dan Carpenter > wrote: > > On Mon, Jun 18, 2018 at 08:53:19PM +0200, Nicholas Mc Guire wrote: > > > The call to of_find_compatible_node() returns irqc_node with refcount &

[PATCH] staging: board: drop refcount in success case

2018-06-18 Thread Nicholas Mc Guire
The call to of_find_compatible_node() returns irqc_node with refcount incremented thus it must be explicitly decremented here after it was checked for non-NULL. Signed-off-by: Nicholas Mc Guire Fixes: commit 72ee8626eeb1 ("staging: board: Add support for translating hwirq to virq nu

completion issues in ks7010

2016-07-27 Thread Nicholas Mc Guire
Hi ! staging ks7010 has a a few completion calls, some of which are using wait_for_completion_interruptible_timeout(). The key difference betweeen wait_for_completion_interruptible_timeout() and wait_for_completion_timeout() is, if I got it right, only that the former will return on any pen

[PATCH 2/2 RFC] staging: ks7010: drop unused empty function

2016-07-27 Thread Nicholas Mc Guire
fix sparse warning by droping unused empty function. Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire --- sparse warning: drivers/staging/ks7010/ks_wlan_net.c:3525:5: warning: symbol 'ks_wlan_reset' not

[PATCH 1/2 RFC] staging: ks7010: fix location of declaration

2016-07-27 Thread Nicholas Mc Guire
fix sparse warning by moving the extern declaration to device scope header file. Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire --- sparse warning: drivers/staging/ks7010/ks_wlan_net.c:3392:6: warni

[PATCH 0/2 RFC] staging: ks7010: fix sparse warnings

2016-07-27 Thread Nicholas Mc Guire
Two proposed fixes for sparse warnings drivers/staging/ks7010/ks_wlan_net.c:3392:6: warning: symbol 'send_packet_complete' was not declared. Should it be static? looking at how it is used I guess it should not be static but the extern declaration moved into ks_wlan.h but all the functi

Re: [PATCH] staging: ks7010: declare private functions static

2016-07-25 Thread Nicholas Mc Guire
On Mon, Jul 25, 2016 at 11:04:18PM +0200, Wolfram Sang wrote: > On Mon, Jul 25, 2016 at 09:22:27PM +0200, Nicholas Mc Guire wrote: > > Private functions in ks_hostif.c can be declared static. > > > > Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nano

Re: [PATCH] staging: ks7010: declare private functions static

2016-07-25 Thread Nicholas Mc Guire
On Tue, Jul 26, 2016 at 08:51:14AM +0200, Wolfram Sang wrote: > On Tue, Jul 26, 2016 at 06:48:00AM +0000, Nicholas Mc Guire wrote: > > On Mon, Jul 25, 2016 at 11:04:18PM +0200, Wolfram Sang wrote: > > > On Mon, Jul 25, 2016 at 09:22:27PM +0200, Nicholas Mc Guire wrote: > >

Re: [PATCH] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling

2016-07-25 Thread Nicholas Mc Guire
On Mon, Jul 25, 2016 at 10:54:03PM +0200, Wolfram Sang wrote: > On Mon, Jul 25, 2016 at 09:21:50PM +0200, Nicholas Mc Guire wrote: > > wait_for_completion_interruptible_timeout return 0 on timeout and > > -ERESTARTSYS if interrupted. The check for > > !wait_for_completion_

[PATCH] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling

2016-07-25 Thread Nicholas Mc Guire
to msecs_to_jiffies(20). Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire --- API non-compliance was located by coccinelle Note: build showed some sparse warnings CHECK drivers/staging/ks701

[PATCH] staging: ks7010: declare private functions static

2016-07-25 Thread Nicholas Mc Guire
Private functions in ks_hostif.c can be declared static. Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire --- Found by sparse The build of ks_hostif.o generated the following sparse warnings: CHECK drivers/stag

Re: [PATCH] media: add GFP flag to media_*() that could get called in atomic context

2016-03-13 Thread Nicholas Mc Guire
On Sat, Mar 12, 2016 at 06:48:09PM -0700, Shuah Khan wrote: > Add GFP flags to media_create_pad_link(), media_create_intf_link(), > media_devnode_create(), and media_add_link() that could get called > in atomic context to allow callers to pass in the right flags for > memory allocation. > > tree-w

[PATCH V2] staging: rtl8712: consolidate kmalloc + memset 0 to kzalloc

2016-01-05 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 here is equivalent to kzalloc. Signed-off-by: Nicholas Mc Guire --- V2: use kzalloc rather than kcalloc which was not an equivalent replacement as flaged by Joe Perches Patch was compile tested with: x86_64_defconfig

[PATCH] staging: rtl8712: consolidate kmalloc/memset 0 of array to kcalloc

2016-01-04 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc of an array of elements of equal size + memset to 0 of the same is equivalent to kcalloc. Signed-off-by: Nicholas Mc Guire --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was

Re: [Cocci] [PATCH] staging/rdma/hfi1: Fix a possible null pointer dereference

2015-12-18 Thread Nicholas Mc Guire
On Fri, Dec 18, 2015 at 07:33:36AM +0100, Julia Lawall wrote: > > > On Mon, 14 Dec 2015, Nicholas Mc Guire wrote: > > > On Thu, Dec 10, 2015 at 11:13:38AM -0500, Mike Marciniszyn wrote: > > > From: Easwar Hariharan > > > > > > A code inspection p

Re: [PATCH 1/3] staging/rdma/hfi1: consolidate kmalloc_array+memset into kcalloc

2015-12-14 Thread Nicholas Mc Guire
On Mon, Dec 14, 2015 at 03:28:46PM +, Marciniszyn, Mike wrote: > > --- a/drivers/staging/rdma/hfi1/chip.c > > +++ b/drivers/staging/rdma/hfi1/chip.c > > @@ -10128,8 +10128,7 @@ static void init_qos(struct hfi1_devdata *dd, > > u32 first_ctxt) > > goto bail; > > if (num_vls * qpn

Re: [PATCH 2/3] staging/rdma/hfi1: check return value of kcalloc

2015-12-14 Thread Nicholas Mc Guire
On Mon, Dec 14, 2015 at 03:21:24PM +, Marciniszyn, Mike wrote: > > @@ -10129,6 +10129,9 @@ static void init_qos(struct hfi1_devdata *dd, > > u32 first_ctxt) > > if (num_vls * qpns_per_vl > dd->chip_rcv_contexts) > > goto bail; > > rsmmap = kcalloc(NUM_MAP_REGS, sizeof(u64),

[PATCH 1/3] staging/rdma/hfi1: consolidate kmalloc_array+memset into kcalloc

2015-12-14 Thread Nicholas Mc Guire
rather than using kmalloc_array + memset it seems cleaner to simply use kcalloc which will deliver memory set to zero. Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with: x86_64_defconfig CONFIG_INFINIBAND=m, CONFIG_STAGING=y, CONFIG_STAGING_RDMA=m Patch is against linux-next

[PATCH 3/3] staging/rdma/hfi1: fix build warning

2015-12-14 Thread Nicholas Mc Guire
fix the following build warning drivers/staging/rdma/hfi1/chip.c: In function 'init_qos': drivers/staging/rdma/hfi1/chip.c:10110:6: warning: unused variable 'rxcontext' [-Wunused-variable] Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with: x86_64_defconfig

[PATCH 2/3] staging/rdma/hfi1: check return value of kcalloc

2015-12-14 Thread Nicholas Mc Guire
Add a null check after the kcalloc call as proposed by Mike Marciniszyn . Signed-off-by: Nicholas Mc Guire --- Patch was compile tested with: x86_64_defconfig CONFIG_INFINIBAND=m, CONFIG_STAGING=y, CONFIG_STAGING_RDMA=m Patch is against linux-next (localversion-next is -next-20151214

Re: [PATCH] staging/rdma/hfi1: Fix a possible null pointer dereference

2015-12-14 Thread Nicholas Mc Guire
On Thu, Dec 10, 2015 at 11:13:38AM -0500, Mike Marciniszyn wrote: > From: Easwar Hariharan > > A code inspection pointed out that kmalloc_array may return NULL and > memset doesn't check the input pointer for NULL, resulting in a possible > NULL dereference. This patch fixes this. > > Reviewed-b

Re: [BUG ?] staging: rtl8723au: condition with no effect

2015-06-13 Thread Nicholas Mc Guire
On Sat, 13 Jun 2015, Jes Sorensen wrote: > Nicholas Mc Guire writes: > > scanning for trivial bug-patters with coccinelle spatches returned: > > ./drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1395 > > WARNING: condition with no effect (if branch == else) &g

[BUG ?] staging: rtl8723au: condition with no effect

2015-06-13 Thread Nicholas Mc Guire
scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1395 WARNING: condition with no effect (if branch == else) drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c - line numbers from 4.1-rc7 1395if (bWithoutHWSM) { 1396

Re: [PATCH 1/2] staging: dgnc: use schedule_timeout_interruptible()

2015-05-30 Thread Nicholas Mc Guire
On Sun, 31 May 2015, Greg Kroah-Hartman wrote: > On Fri, May 29, 2015 at 06:41:27PM +0200, Nicholas Mc Guire wrote: > > API consolidation with coccinelle found: > > ./drivers/staging/dgnc/dgnc_utils.c:16:1-17: > > consolidation with schedule_timeout_*() recommended &

Re: [PATCH 2/2] staging: dgnc: switch timeout to signed type

2015-05-29 Thread Nicholas Mc Guire
On Fri, 29 May 2015, Dan Carpenter wrote: > On Fri, May 29, 2015 at 07:21:26PM +0200, Nicholas Mc Guire wrote: > > On Fri, 29 May 2015, Dan Carpenter wrote: > > > > > On Fri, May 29, 2015 at 06:41:28PM +0200, Nicholas Mc Guire wrote: > > > > The schedule_ti

Re: [PATCH 2/2] staging: dgnc: switch timeout to signed type

2015-05-29 Thread Nicholas Mc Guire
On Fri, 29 May 2015, Dan Carpenter wrote: > On Fri, May 29, 2015 at 06:41:28PM +0200, Nicholas Mc Guire wrote: > > The schedule_timeout*() helpers take the timeout as signed long, as > > ch_close_delay in struct channel_t was not used for other purposes its > > type was sw

[PATCH] staging: panel: use schedule_timeout_interruptible()

2015-05-29 Thread Nicholas Mc Guire
_PARPORT=m, CONFIG_PANEL=m Signed-off-by: Nicholas Mc Guire --- Patch is against 4.1-rc5 (localversion-next is -next-20150529) not really clear what the intent of (ms * HZ + 999) / 1000 was - this is HZ dependent and does not really make sense - the comment states "sleeps that many mill

[PATCH 2/2] staging: dgnc: switch timeout to signed type

2015-05-29 Thread Nicholas Mc Guire
against 4.1-rc5 (localversion-next is -next-20150529) Signed-off-by: Nicholas Mc Guire --- Note that there is a "over 80 char" warning here that was not fixed as there are quite a few in dgnc_driver.h. drivers/staging/dgnc/dgnc_driver.h |2 +- drivers/staging/dgnc/dgnc_utils

[PATCH 1/2] staging: dgnc: use schedule_timeout_interruptible()

2015-05-29 Thread Nicholas Mc Guire
correctly. Patch was compile tested with x86_64_defconfig + CONFIG_STAGING=y, CONFIG_DGNC=m Patch is against 4.1-rc5 (localversion-next is -next-20150529) Signed-off-by: Nicholas Mc Guire --- drivers/staging/dgnc/dgnc_utils.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

Re: [PATCH] staging: me_daq: use schedule_timeout_interruptible()

2015-05-29 Thread Nicholas Mc Guire
On Fri, 29 May 2015, Ian Abbott wrote: > On 29/05/15 16:58, Nicholas Mc Guire wrote: >> API consolidation with coccinelle found: >> ./drivers/staging/comedi/drivers/me_daq.c:177:1-17: >> consolidation with schedule_timeout_*() recommended >> >> This i

[PATCH] staging: me_daq: use schedule_timeout_interruptible()

2015-05-29 Thread Nicholas Mc Guire
compile tested with x86_64_defconfig + CONFIG_STAGING=y, CONFIG_COMEDI=y, CONFIG_COMEDI_PCI_DRIVERS=y CONFIG_COMEDI_ME_DAQ=m Patch is against 4.1-rc5 (localversion-next is -next-20150529) Signed-off-by: Nicholas Mc Guire --- drivers/staging/comedi/drivers/me_daq.c |3 +-- 1 file changed, 1

[PATCH] staging: unisys: use schedule_timeout_interruptible()

2015-05-29 Thread Nicholas Mc Guire
(localversion-next is -next-20150529) 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 this needs to be checked by someone who knows the details of this driver in any case

[PATCH] staging: rts5208: pass timeout as HZ independent value

2015-05-27 Thread Nicholas Mc Guire
against 4.0-rc5 (localversion-next 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 - so someone that knows this driver needs to check on the actual value - but in any case it needs to

[PATCH v2] staging: rtl8188eu: core: switch with redundant cases

2015-02-05 Thread Nicholas Mc Guire
all be dropped and consolidated into the default but for documentation they are combined into a fall through case. Signed-off-by: Nicholas Mc Guire --- v2: verified that check_fwstate() has no side-effects requested by Rasmus Villemoes , and fixed up the log message based on feedback

[PATCH] storvsc: assign wait_for_completion_timeout to appropriately typed var

2015-02-04 Thread Nicholas Mc Guire
wait_for_completion_timeout() returns unsigned long not int. This assigns the return value to an appropriately typed variable. Signed-off-by: Nicholas Mc Guire --- As a suitable typed and named variable "timeout" is available and there is no conflict in this case no new variable

[PATCH v2] staging: comedi: dt282x: condition with no effect - if identical to else

2015-02-04 Thread Nicholas Mc Guire
The if and the else branch code are identical - so the condition has no effect on the effective code - this patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire --- v2: Review notes from Ian Abbott and Hartley Sweeten confirm that the condition is not

Re: [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else

2015-02-04 Thread Nicholas Mc Guire
On Wed, 04 Feb 2015, Hartley Sweeten wrote: > On Tuesday, February 03, 2015 8:13 AM, Ian Abbott wrote: > > On 03/02/15 12:38, Nicholas Mc Guire wrote: > >> The if and the else branch code are identical - so the condition has no > >> effect on the effective code - this

Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases

2015-02-04 Thread Nicholas Mc Guire
On Wed, 04 Feb 2015, Dan Carpenter wrote: > Btw, what tool are you using to find these? > working on a set of coccinell scripts - they are not yet really clean - but this one is simply: virtual context virtual patch virtual org virtual report @assign@ position p; statement S1; @@ <+... * if@p

[PATCH] staging: rtl8188eu: core: switch with redundant cases

2015-02-04 Thread Nicholas Mc Guire
A few redundant switch cases as well as a redundant if/else within one of the cases was consolidated to a single call. The cases are intentionally retained for documentation purposes. Signed-off-by: Nicholas Mc Guire --- case WIFI_REASSOCREQ,WIFI_PROBEREQ,WIFI_BEACON,WIFI_ACTION all have the

[PATCH 2/2] staging: rtl8188eu: odm: conditional setting with no effect

2015-02-04 Thread Nicholas Mc Guire
thus also no longer needed here. Signed-off-by: Nicholas Mc Guire --- The if/else executes the same code in both branches so the condition has no effect. This needs a check by someone who knows the details of the driver as it could be that the two branches actually should be different. >From

[PATCH 1/2] staging: rtl8188eu: odm: condition with no effect

2015-02-04 Thread Nicholas Mc Guire
The if and the else branch code are identical - so the condition has no effect on the effective code - this patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire --- The if/else performing the same settings in both branches so the condition has no effect. This

Re: [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else

2015-02-03 Thread Nicholas Mc Guire
On Tue, 03 Feb 2015, Ian Abbott wrote: > On 03/02/15 12:38, Nicholas Mc Guire wrote: >> The if and the else branch code are identical - so the condition has no >> effect on the effective code - this patch removes the condition and the >> duplicated code. >> >>

Re: [PATCH] staging: rtl8723au: multiple condition with no effect - if identical to else

2015-02-03 Thread Nicholas Mc Guire
On Tue, 03 Feb 2015, Jes Sorensen wrote: > Nicholas Mc Guire writes: > > A number if/else if/else branches are identical - so the condition has no > > effect on the effective code and can be significantly simplified - this > > patch removes the condition and the duplicated

[PATCH] staging: rtl8723au: multiple condition with no effect - if identical to else

2015-02-03 Thread Nicholas Mc Guire
A number if/else if/else branches are identical - so the condition has no effect on the effective code and can be significantly simplified - this patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire --- This looks like the output of some broken code-generator

[PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else

2015-02-03 Thread Nicholas Mc Guire
The if and the else branch code are identical - so the condition has no effect on the effective code - this patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire --- The if and else branch are identical code thus the condition has no effect if (cmd

[PATCH] hv: channel_mgmt: match var type to return type of wait_for_completion

2015-02-01 Thread Nicholas Mc Guire
From: Nicholas Mc Guire return type of wait_for_completion_timeout is unsigned long not int, this patch changes the type of t from int to unsigned long. Signed-off-by: Nicholas Mc Guire --- The return type of wait_for_completion_timeout is unsigned long not int. This patch resolves the type

[PATCH] hv: vmbus_drv: match var type to return type of wait_for_completion

2015-02-01 Thread Nicholas Mc Guire
From: Nicholas Mc Guire return type of wait_for_completion_timeout is unsigned long not int, this patch changes the type of t from int to unsigned long. Signed-off-by: Nicholas Mc Guire --- The return type of wait_for_completion_timeout is unsigned long not int. This patch resolves the type

[PATCH] hv: channel: match var type to return type of wait_for_completion

2015-02-01 Thread Nicholas Mc Guire
From: Nicholas Mc Guire return type of wait_for_completion_timeout is unsigned long not int, this patch changes the type of t from int to unsigned long. Signed-off-by: Nicholas Mc Guire --- The return type of wait_for_completion_timeout is unsigned long not int. This patch resolves the type

[PATCH] hv: hv_balloon: match var type to return type of wait_for_completion

2015-02-01 Thread Nicholas Mc Guire
From: Nicholas Mc Guire return type of wait_for_completion_timeout is unsigned long not int, this patch changes the type of t from int to unsigned long. Signed-off-by: Nicholas Mc Guire --- The return type of wait_for_completion_timeout is unsigned long not int. This patch resolves the type

[PATCH] staging: rtl8188eu: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable. Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Converting milliseconds to jiffies by "val * HZ / 1000" is technically ok but msecs_to_jiffies(val) is the cleane

[PATCH] staging: unisys: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable. Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Converting milliseconds to jiffies by "val * HZ / 1000" is technically ok but msecs_to_jiffies(val) is the cleane

[PATCH 2/2] staging: rtl8712: condition with no effect removed

2015-01-31 Thread Nicholas Mc Guire
The check for return of schedule_timeout() has no effect on the effective control flow of sleep_schedulable() so it can be dropped. Signed-off-by: Nicholas Mc Guire --- The current codes return check for schedule_timeout() has no effect and can probably be dropped unless it is intended as a

[PATCH 1/2] staging: rtl8712: cleanup of timeout conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable. Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). As msecs_to_jiffies will return > 0 if it is passed a value > 0 the == 0 check is not needed. Signed-off-by: Nicholas Mc Guire --- Converting milliseco

Re: [PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-29 Thread Nicholas Mc Guire
On Thu, 29 Jan 2015, Tomi Valkeinen wrote: > On 29/01/15 11:38, Nicholas Mc Guire wrote: > > On Mon, 26 Jan 2015, Tomi Valkeinen wrote: > > > >> Hi, > >> > >> On 25/01/15 16:47, Nicholas Mc Guire wrote: > >>> Signed-off-by: Nicholas

[PATCH 2/3 v3] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-29 Thread Nicholas Mc Guire
The return type of wait_for_completion_timeout is unsigned long not int. This patch fixes up the declarations only. Signed-off-by: Nicholas Mc Guire --- v2: fixed subject line v3: fixed patch description as recommended by Dan Carpenter Patch was compile tested only for x86_64_defconfig

Re: [PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-29 Thread Nicholas Mc Guire
On Thu, 29 Jan 2015, Dan Carpenter wrote: > On Thu, Jan 29, 2015 at 10:38:39AM +0100, Nicholas Mc Guire wrote: > > On Mon, 26 Jan 2015, Tomi Valkeinen wrote: > > > > > Hi, > > > > > > On 25/01/15 16:47, Nicholas Mc Guire wrote

Re: [PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-29 Thread Nicholas Mc Guire
On Mon, 26 Jan 2015, Tomi Valkeinen wrote: > Hi, > > On 25/01/15 16:47, Nicholas Mc Guire wrote: > > Signed-off-by: Nicholas Mc Guire > > --- > > > > v2: fixed subject line > > > > The return type of wait_for_completion_timeout is unsig

[PATCH RFC] staging: media: davinci_vpfe: drop condition with no effect

2015-01-25 Thread Nicholas Mc Guire
As the if and else branch body are identical the condition has no effect and can be dropped. Signed-off-by: Nicholas Mc Guire --- As the if and the else branch of the inner conditional paths are the same the condition is without effect. Given the comments indicate that the else branch *should

[PATCH v2] net: hyperv: else branch not necessary

2015-01-25 Thread Nicholas Mc Guire
As the if completes with a unconditional goto the else branch is not needed here. Signed-off-by: Nicholas Mc Guire --- v2: added missing subsystem string in subject line - patch unchanged All paths of execution that did not exit through the if branch will go through the else branch so no need

[PATCH v2] hyperv: match wait_for_completion_timeout return type

2015-01-25 Thread Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int, this patch just fixes up the declarations. Signed-off-by: Nicholas Mc Guire --- v2: fixed subject line The return type of wait_for_completion_timeout is unsigned long not int. This patch fixes up the declarations only. Patch

[PATCH 3/3 v2] hyperv: hid-hyperv.c: match wait_for_completion_timeout return type

2015-01-25 Thread Nicholas Mc Guire
Signed-off-by: Nicholas Mc Guire --- v2: fixed subject line The return type of wait_for_completion_timeout is unsigned long not int. This patch fixes up the declarations only. Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y CONFIG_HYPERV=m, CONFIG_HID_HYPERV_MOUSE=m

[PATCH 2/3 v2] hyperv: hyperv_fb.c: match wait_for_completion_timeout return type

2015-01-25 Thread Nicholas Mc Guire
Signed-off-by: Nicholas Mc Guire --- v2: fixed subject line The return type of wait_for_completion_timeout is unsigned long not int. This patch fixes up the declarations only. Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y CONFIG_HYPERV=m, CONFIG_FB_HYPERV=m Patch is

[PATCH 1/3 v2] hyperv: netvsc.c: match wait_for_completion_timeout return type

2015-01-25 Thread Nicholas Mc Guire
Signed-off-by: Nicholas Mc Guire --- v2: fixed subject line The return type of wait_for_completion_timeout is unsigned long not int. This patch fixes up the declarations only. Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y CONFIG_HYPERV=m, CONFIG_HYPERV_NET=m Patch is

  1   2   >