Passing uninitialised local variable

2018-03-28 Thread Himanshu Jha
the very first line which is an undefined behavior. So, what could be a possible fix for the above ? I'm not sure initialising 'var' to 0 would be the correct solution. -- Thanks Himanshu Jha

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-09 Thread Himanshu Jha
ect *ath9k* himanshu@himanshu-Vostro-3559:~/linux-next$ git log --oneline drivers/net/wireless/ath/ath9k/dfs.c 626ab67 ath9k: dfs: use swap macro in ath9k_check_chirping 50c8cd4 ath9k: remove cast to void pointer 8fc2b61 ath9k: DFS - add pulse chirp detection for FCC -- Thanks Himanshu Jha

[PATCH v2] brcmfmac: Use zeroing memory allocator than allocator/memset

2018-01-08 Thread Himanshu Jha
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Suggested-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- v2:

Re: brcmfmac: Use zeroing memory allocator than allocator/memset

2018-01-08 Thread Himanshu Jha
On Mon, Jan 08, 2018 at 05:23:22PM +, Kalle Valo wrote: > Himanshu Jha <himanshujha199...@gmail.com> wrote: > > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > >

[PATCH] liquidio: Use zeroing memory allocator than allocator/memset

2017-12-31 Thread Himanshu Jha
Use vzalloc for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by: Himanshu Jha <himan

[PATCH] brcmfmac: Use zeroing memory allocator than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by: Himans

[PATCH] ethernet/broadcom: Use zeroing memory allocator than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by: Himans

[PATCH] qed: Use zeroing memory allocator than allocator/memset

2017-12-30 Thread Himanshu Jha
ed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 12 +--- drivers/net/ethernet/qlogic/qed/qed_l2.c | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/etherne

[PATCH v2] mwifiex: Use put_unaligned_le32

2017-10-06 Thread Himanshu Jha
hen != tmp - memcpy(ptr, (T), ...); + put_unaligned_le32(x,ptr); ...+> @ depends on rule1 @ type j; identifier tmp; @@ - j tmp; ...when != tmp Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- v2: * added correct header file. drivers/net/wireless/marvell/mwifiex/c

Re: [PATCH] mwifiex: Use put_unaligned_le32

2017-10-05 Thread Himanshu Jha
On Thu, Oct 05, 2017 at 11:02:50AM -0700, Brian Norris wrote: > On Thu, Oct 05, 2017 at 08:52:33PM +0530, Himanshu Jha wrote: > > There are various instances where a function used in file say for eg > > int func_align (void* a) > > is used and it is defined in align.h >

Re: [PATCH] mwifiex: Use put_unaligned_le32

2017-10-05 Thread Himanshu Jha
On Thu, Oct 05, 2017 at 11:41:38AM +0300, Kalle Valo wrote: > Himanshu Jha <himanshujha199...@gmail.com> writes: > > >> > --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c > >> > +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c > >> > @@ -1

Re: [PATCH] mwifiex: Use put_unaligned_le32

2017-10-05 Thread Himanshu Jha
On Thu, Oct 05, 2017 at 10:23:37AM +0300, Kalle Valo wrote: > Himanshu Jha <himanshujha199...@gmail.com> writes: > > > Use put_unaligned_le32 rather than using byte ordering function and > > memcpy which makes code clear. > > Also, add the header file where it i

[PATCH] mwifiex: Use put_unaligned_le32

2017-10-04 Thread Himanshu Jha
hen != tmp - memcpy(ptr, (T), ...); + put_unaligned_le32(x,ptr); ...+> @ depends on rule1 @ type j; identifier tmp; @@ - j tmp; ...when != tmp Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 10 -- 1 file changed,

[PATCH] net: bcm63xx_enet: Use setup_timer and mod_timer

2017-09-24 Thread Himanshu Jha
-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index f8f..c6221f0

[PATCH] qed: remove unnecessary call to memset

2017-09-12 Thread Himanshu Jha
, e2); Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index eaca457..8f6ccc0 100644 --- a/drive

[PATCH] mwifiex: remove unnecessary call to memset

2017-09-11 Thread Himanshu Jha
, e2); Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/marvell/mwifiex/scan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c index c9d41ed..8838b88

[PATCH] ath9k: remove cast to void pointer

2017-08-31 Thread Himanshu Jha
casting to void pointer from any pointer type and vice-versa is done implicitly and therefore casting is not needed in such a case. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/ath/ath9k/ar9003_mac.c | 4 ++-- drivers/net/wireless/ath/ath9k

[PATCH] rsi: remove memset before memcpy

2017-08-29 Thread Himanshu Jha
calling memcpy immediately after memset with the same region of memory makes memset redundant. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/rsi/rsi_91x_sdio.c | 1 - drivers/net/wireless/rsi/rsi_91x_usb.c | 1 - 2 files changed, 2 deletions(-) diff

[PATCH] net: ethernet: broadcom: Remove null check before kfree

2017-08-26 Thread Himanshu Jha
Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/ethernet/broadcom/sb1250-mac.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/broadcom/

[PATCH] cfg80211: Use tabs for identation

2017-08-24 Thread Himanshu Jha
Removed whitespaces and added necessary tabs conforming to coding style. Issue found using checkpatch.pl Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- net/wireless/chan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/wireless/chan.c b/net/wi

[PATCH v2] at76c50x-usb: check memory allocation failure

2017-08-23 Thread Himanshu Jha
Check memory allocation failure and return -ENOMEM rather than just retuning void. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/atmel/at76c50x-usb.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/d

[PATCH] drivers: net: wireless: atmel: check memory allocation failure

2017-08-22 Thread Himanshu Jha
Check memory allocation failure and return -ENOMEM if failure occurs. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/net/wireless/atmel/at76c50x-usb.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/atmel/at