[PATCH] scsi: be2iscsi: Use kasprintf

2017-10-06 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/scsi/be2iscsi/be_main.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be

Re: [PATCH] scsi: be2iscsi: Use kasprintf

2017-10-11 Thread Himanshu Jha
On Tue, Oct 10, 2017 at 05:54:15PM -0400, Kyle Fortin wrote: > Hi Himanshu, > > On Oct 6, 2017, at 2:57 PM, Himanshu Jha <himanshujha199...@gmail.com> wrote: > > > > Use kasprintf instead of combination of kmalloc and sprintf. > > > > Signed-off-by: Hi

Re: [PATCH] scsi: remove memset before memcpy

2017-08-29 Thread Himanshu Jha
On Tue, Aug 29, 2017 at 12:29:35PM -0700, Joe Perches wrote: > On Wed, 2017-08-30 at 00:19 +0530, Himanshu Jha wrote: > > drivers/scsi/megaraid/megaraid_sas_fusion.c > > I don't know if you did this with coccinelle. Yes, I did this with coccinelle. > > If so, it would be

[PATCH] scsi: 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/scsi/bfa/bfa_ioc.c | 1 - drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 -- drivers/scsi/qla4xxx/ql

[PATCH] scsi: qla2xxx: remove unnecessary call to memset

2017-09-11 Thread Himanshu Jha
, e2); Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/scsi/qla2xxx/qla_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b5b48dd..54c1d63 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/d

[PATCH] scsi: esas2r: Use setup_timer and mod_timer

2017-09-28 Thread Himanshu Jha
-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/scsi/esas2r/esas2r_main.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 81f226b..1866ba0 100644 --- a/drivers/scsi/

[PATCH] scsi: qla2xxx: Use PTR_ERR_OR_ZERO

2017-08-29 Thread Himanshu Jha
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/q

[PATCH v2] scsi: be2iscsi: Use kasprintf

2017-10-11 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf. Also, remove BEISCSI_MSI_NAME macro used to specify size of string as kasprintf handles size computations. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- v2: -remove the unnecessary macro BEISCSI_MSI_NAME. d

Re: [PATCH v2] scsi: be2iscsi: Use kasprintf

2017-11-03 Thread Himanshu Jha
On Wed, Oct 11, 2017 at 09:06:14PM +0530, Himanshu Jha wrote: Hi James, Just a reminder, is my patch in our queue ? Thanks Himanshu Jha > Use kasprintf instead of combination of kmalloc and sprintf. > Also, remove BEISCSI_MSI_NAME macro used to specify size of string as > kasprint

Re: [PATCH v2] scsi: be2iscsi: Use kasprintf

2017-11-03 Thread Himanshu Jha
On Fri, Nov 03, 2017 at 11:25:05AM -0400, Martin K. Petersen wrote: Hi Martin, > > Himanshu, > > > Just a reminder, is my patch in our queue ? > > It is not. It needs a review/ack from the driver maintainers. What about Kyle Fortin's review ? > -- > Martin K. PetersenOracle Linux

Re: [PATCH] scsi: Use vzalloc instead of vmalloc/memset

2017-11-07 Thread Himanshu Jha
On Tue, Nov 07, 2017 at 08:51:36PM +0100, Luis R. Rodriguez wrote: > On Sun, Nov 05, 2017 at 03:26:26AM +0530, Himanshu Jha wrote: > > Use vzalloc instead of vmalloc/memset to allocate memory filled with 0 > > value. > > > > Done using Coccinel

[PATCH] scsi: Use vzalloc instead of vmalloc/memset

2017-11-04 Thread Himanshu Jha
Use vzalloc instead of vmalloc/memset to allocate memory filled with 0 value. Done using Coccinelle. Semantic patch used : @@ expression x,a; statement S; @@ - x = vmalloc(a); + x = vzalloc(a); if (x == NULL || ...) S - memset(x, 0, a); Signed-off-by: Himanshu Jha <himanshujha

[PATCH] scsi: Remove null check before kfree

2017-11-06 Thread Himanshu Jha
Kfree on NULL pointer is a no-op and therefore checking is redundant. Done using Coccinelle. Semantic patch used : @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; Signed-off-by: Himanshu Jha

[PATCH] scsi: megaraid: Use zeroing memory allocator than allocator/memset

2017-12-30 Thread Himanshu Jha
Use pci_zalloc_consistent 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] scsi: fnic: Use eth_broadcast_addr instead of memset

2017-12-30 Thread Himanshu Jha
Use eth_broadcasr_addr Networking API instead of memset to assign the broadcast address to the given address array. 0-day tested with no failures. Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com> --- drivers/scsi/fnic/fnic_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 4/9] scsi: mvsas: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/mvsas/mv

[PATCH 5/9] scsi: fnic: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use vzalloc instead of vmalloc followed by memset 0. 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> --- drivers/scsi/fnic/fnic_debugfs.c | 10 ++

[PATCH 7/9] scsi: bnx2fc: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/bnx2fc/bnx2f

[PATCH 2/9] scsi: qla2xxx: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent and vzalloc instead of dma_alloc_coherent and vmalloc respectively, followed by memset 0. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Suggested-by: Luis R. Rodriguez <mcg...@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199...@

[PATCH 3/9] scsi: qedi: Use zeroing allocator instead of allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/qedi/qedi

[PATCH 9/9] scsi: bnx2i: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/bnx2i/bnx2

[PATCH 1/9] scsi: qla4xxx: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/qla4xxx/ql4

[PATCH 6/9] scsi: dpt_i2o: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/dp

[PATCH 8/9] scsi: bfa: Use zeroing allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
Use vzalloc instead of vmalloc followed by memset 0. 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> --- drivers/scsi/bfa/bfad.c | 3 +-- driv

[PATCH 0/9] scsi: Use zeroing allocators than allocator/memset

2017-12-30 Thread Himanshu Jha
failures. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Link: https://lkml.org/lkml/2017/12/26/205 Himanshu Jha (9): scsi: qla4xxx: Use zeroing allocator rather than allocator/memset scsi: qla2xxx: Use zeroing allocator rather than allocator/memset scsi

[RESEND PATCH 1/2] scsi: bnx2fc: Use zeroing allocator rather than allocator/memset

2018-01-09 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/bnx2fc/bnx2f

[RESEND PATCH 2/2] scsi: qedi: Use zeroing allocator instead of allocator/memset

2018-01-09 Thread Himanshu Jha
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. 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> --- drivers/scsi/qedi/qedi

Re: [PATCH 7/9] scsi: bnx2fc: Use zeroing allocator rather than allocator/memset

2018-01-03 Thread Himanshu Jha
roing allocator rather than allocator/memset --Applied But do I also need to send those mentioned above, which didn't receive any response from you ? Also, I later sent a patch for fnic after this series which can be applied after or before this series whichever is suitable to you. Thanks Himanshu Jha

Re: [PATCH] scsi: megaraid: Use zeroing memory allocator than allocator/memset

2018-01-04 Thread Himanshu Jha
Hi Shivashran, On Thu, Jan 04, 2018 at 04:52:54PM +0530, Shivasharan Srikanteshwara wrote: > > -Original Message- > > From: Himanshu Jha [mailto:himanshujha199...@gmail.com] > > Sent: Saturday, December 30, 2017 9:18 PM > > To: martin.peter...@oracle.com; j...@l