Re: [PATCH] iio: remove unnecessary condition judgment in am2315_trigger_handler

2018-09-08 Thread Himanshu Jha
sensor_data.hum_data); > + data->buffer[i] = sensor_data.temp_data; No, this seems wrong! We have buffer support to either take both readings(temp & humid) simultaneously, or only single channel using specified scan mask. Patch title should be: "

Re: [PATCH] iio: proximity: Add driver support for ST's VL53L0X ToF ranging sensor.

2018-09-10 Thread Himanshu Jha
) > + return -ENOMEM; > + > + data = iio_priv(indio_dev); > + data->client = client; > + i2c_set_clientdata(client, indio_dev); > + mutex_init(&data->lock); > + > + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE

Re: [PATCH] iio: proximity: Add driver support for ST's VL53L0X ToF ranging sensor.

2018-09-11 Thread Himanshu Jha
On Tue, Sep 11, 2018 at 02:46:38PM +0800, Song Qiang wrote: > On Mon, Sep 10, 2018 at 11:27:47PM +0530, Himanshu Jha wrote: > > On Mon, Sep 10, 2018 at 10:42:59PM +0800, Song Qiang wrote: > > > This driver was originally written by ST in 2016 as a misc input device, >

Re: [PATCH v2] iio: proximity: Add driver support for ST's VL53L0X ToF ranging sensor.

2018-09-11 Thread Himanshu Jha
; + int ret; > + > + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); > + if (!indio_dev) > + return -ENOMEM; > + > + data = iio_priv(indio_dev); > + data->client = client; > + data->indio_dev = indio_dev; Is this required ? > + i2c_set_clientdata(client, indio_dev); > + > + if (!i2c_check_functionality(client->adapter, > + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_I2C)) > + return -EOPNOTSUPP; > + > + indio_dev->dev.parent = &client->dev; > + indio_dev->name = VL53L0X_DRV_NAME; > + indio_dev->info = &vl53l0x_info; > + indio_dev->channels = vl53l0x_channels; > + indio_dev->num_channels = ARRAY_SIZE(vl53l0x_channels); > + indio_dev->modes = INDIO_DIRECT_MODE; > + > + ret = devm_iio_device_register(&client->dev, indio_dev); return devm_iio_device_register(&client->dev, indio_dev); > + if (ret) > + return ret; > + > + return 0; > +} Do you have the sensor and are these patches tested ? Just curious! Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH v2 1/4] iio: gyro: add support for fxas21002c

2018-08-31 Thread Himanshu Jha
> + __be16 bulk_raw; > + > + switch (chan->type) { > + case IIO_ANGL_VEL: > + ret = regmap_bulk_read(data->regmap, chan->address, > +&bulk_raw, sizeof(bulk_raw)); > + if (ret) > + return ret; > + > + *val = sign_extend32(be16_to_cpu(bulk_raw), 15); > + return IIO_VAL_INT; > + case IIO_TEMP: > + ret = regmap_read(data->regmap, chan->address, val); > + if (ret) > + return ret; > + > + return IIO_VAL_INT; > + default: > + return -EINVAL; > + } > +} > + > +static int fxas21002c_read_raw(struct iio_dev *indio_dev, > +struct iio_chan_spec const *chan, int *val, > +int *val2, long mask) Similarly here. static int fxas21002c_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH v3 1/4] Staging: iio: adis16209: Remove and add some comments and group the definitions

2018-03-04 Thread Himanshu Jha
*/ > *val = 0; > - *val2 = 25000; /* 0.025 degree */ > + *val2 = 25000; > return IIO_VAL_INT_PLUS_MICRO; > default: > return -EINVAL; > } > break; > case IIO_CHAN_INFO_OFFSET: > - *val = 25000 / -470 - 0x4FE; /* 25 C = 0x4FE */ > + /* > + * The raw ADC value is 0x4FE when the temperature > + * is 45 degrees and the scale factor per milli > + * degree celcius is -470. Are you sure it is *45 degrees* and not *25 degrees* instead ? As I can clearly see from the datasheet : "sensitivity = −0.47°/LSB, 25°C = 1278 LSB = 0x04FE" Please check it :) I found this because I'm also doing a similar cleanup for adis16201. -- Thanks Himanshu Jha

[PATCH 01/11] Staging: iio: accel: Prefer alphabetical sequence of header files

2018-03-04 Thread Himanshu Jha
Arrange header files in alphabetical sequence to improve readability. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c

[PATCH 00/11] staging: iio: accel: adis16201 driver cleanup

2018-03-04 Thread Himanshu Jha
s have been tested using 0-day test service with success. Himanshu Jha (11): Staging: iio: accel: Prefer alphabetical sequence of header files Staging: iio: accel: Add a blank space before returns Staging: iio: accel: Remove unnecessary comments Staging: iio: accel: Rename few macro definiti

[PATCH 02/11] Staging: iio: accel: Add a blank space before returns

2018-03-04 Thread Himanshu Jha
Adding a blank space before/after some returns improves readability. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c index 0f6a204

[PATCH 05/11] Staging: iio: accel: Add _REG suffix to registers

2018-03-04 Thread Himanshu Jha
Addition of _REG suffix to the register definitions allows a distinction between registers and register fields. The various registers and its field bits are grouped together to improve readability and easy indentification. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c

[PATCH 07/11] Staging: iio: accel: Adjust arguments to match open parentheses

2018-03-04 Thread Himanshu Jha
In adis16201_read_raw() adjust an argument to match an open parentheses using tabs. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel

[PATCH 04/11] Staging: iio: accel: Rename few macro definitions

2018-03-04 Thread Himanshu Jha
Rename few macros with appropriate names specifying their usage/function. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio

[PATCH 09/11] Staging: iio: accel: Use sign_extend32 function

2018-03-04 Thread Himanshu Jha
Use sign_extned32() for 32 bit sign extending rather than hard coding the same. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel

[PATCH 11/11] Staging: iio: accel: Move adis16201 driver out of staging subsystem

2018-03-04 Thread Himanshu Jha
Move the adis16201 driver out of staging directory and merge to the mainline IIO subsystem. Signed-off-by: Himanshu Jha --- drivers/iio/accel/Kconfig | 12 ++ drivers/iio/accel/Makefile| 1 + drivers/iio/accel/adis16201.c | 323

[PATCH 08/11] Staging: iio: accel: Use switch statement than if-else

2018-03-04 Thread Himanshu Jha
Use switch statement instead of if-else pair to explicitly match the only two channels present. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers

[PATCH 10/11] Staging: iio: accel: Add comments about units in data read function

2018-03-04 Thread Himanshu Jha
Clarify the conversion and formation of resultant data in the adis16201_read_raw() with sufficient comments. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers

[PATCH 06/11] Staging: iio: accel: Reverse christmas tree

2018-03-04 Thread Himanshu Jha
Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel

[PATCH 03/11] Staging: iio: accel: Remove unnecessary comments

2018-03-04 Thread Himanshu Jha
Remove unnecessary comments since the definitions are pretty clear with their macro names. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 82 +-- 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/drivers/staging/iio/accel

[PATCH v2 0/9] Staging: iio: accel: adis16201 driver cleanup

2018-03-16 Thread Himanshu Jha
to suggest more cleanups/fix while pointing inline to the patch, the necessary changes. The framing of patch is made consistent with the datasheet naming where possible. For all the patches: Suggested-by: Jonathan Cameron https://marc.info/?l=linux-iio&m=151775804702998&w=2 Himanshu Jha (

[PATCH v2 1/9] Staging: iio: accel: adis16201: Rename few macro definitions

2018-03-16 Thread Himanshu Jha
: Himanshu Jha --- v2: -explained every change in the process of renaming macros. drivers/staging/iio/accel/adis16201.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c index 0fae8aa

[PATCH v2 9/9] Staging: iio: accel: adis16201: Move adis16201 driver out of staging

2018-03-16 Thread Himanshu Jha
Move the adis16201 driver out of staging directory and merge to the mainline IIO subsystem. Signed-off-by: Himanshu Jha --- v2: -no change in this patch. drivers/iio/accel/Kconfig | 12 ++ drivers/iio/accel/Makefile| 1 + drivers/iio/accel/adis16201.c

[PATCH v2 4/9] Staging: iio: accel: adis16201: Group register definitions

2018-03-16 Thread Himanshu Jha
Group register definitions with its register field bits to improve readability and easy identification. A small comment is also added to denote the purpose/functionality of the grouped register definitions. Signed-off-by: Himanshu Jha --- v2: -reordered patch series. drivers/staging/iio

[PATCH v2 7/9] Staging: iio: accel: adis16201: Prefer reverse christmas tree ordering

2018-03-16 Thread Himanshu Jha
Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Himanshu Jha --- v2: -no change in this patch. drivers/staging/iio/accel/adis16201.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b

[PATCH v2 8/9] Staging: iio: accel: adis16201: Adjust argument to match open parentheses

2018-03-16 Thread Himanshu Jha
In adis16201_read_raw() adjust an argument to match an open parentheses using tabs and spaces. Signed-off-by: Himanshu Jha --- v2: -aligned perfectly to match open parentheses. drivers/staging/iio/accel/adis16201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH v2 5/9] Staging: iio: accel: adis16201: Add comments about units in read_raw()

2018-03-16 Thread Himanshu Jha
Clarify the conversion and formation of resultant data in the adis16201_read_raw() with sufficient comments and remove the unnecessary comments. Signed-off-by: Himanshu Jha --- v2: -clarify voltage base conversions. drivers/staging/iio/accel/adis16201.c | 27 ++- 1

[PATCH v2 6/9] Staging: iio: accel: adis16201: Use sign_extend32 function

2018-03-16 Thread Himanshu Jha
Use sign_extned32() for 32 bit sign extending rather than hard coding. Signed-off-by: Himanshu Jha --- v2: -no change in this patch. drivers/staging/iio/accel/adis16201.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b

[PATCH v2 3/9] Staging: iio: accel: adis16201: Add _REG suffix to reisters

2018-03-16 Thread Himanshu Jha
Add a _REG suffix to distinguish between registers and the register bit fileds. Signed-off-by: Himanshu Jha --- v2: -reordered patch series. drivers/staging/iio/accel/adis16201.c | 84 +-- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a

[PATCH v2 2/9] Staging: iio: accel: adis16201: Remove unnecessary comments

2018-03-16 Thread Himanshu Jha
Remove few unnecessary comments since the macro definitions clearly justify their purpose. Signed-off-by: Himanshu Jha --- v2: -reodered patch series. drivers/staging/iio/accel/adis16201.c | 36 --- 1 file changed, 36 deletions(-) diff --git a/drivers

Re: [RFC PATCH] iio: adc: Add Xilinx AMS driver

2018-03-16 Thread Himanshu Jha
s", > + .pm = &ams_pm_ops, > + .of_match_table = ams_of_match_table, > + }, > +}; > +module_platform_driver(ams_driver); -- Thanks Himanshu Jha

[PATCH] Staging : unisys : visorbus : visorbus_main: Fixed a brace cdoing style issue

2017-07-23 Thread Himanshu Jha
Fixed coding style issue for function declaration. Signed-off-by: Himanshu Jha --- drivers/staging/unisys/visorbus/visorbus_main.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys

[PATCH 0/4] staging: iio: accel: adis16201 driver cleanup

2018-02-12 Thread Himanshu Jha
to suggest more cleanups/fix while pointing inline to the patch the necessary changes. All the patches have been tested using 0-day test service with success. For all the patches: Suggested-by: Jonathan Cameron Himanshu Jha (4): staging: iio: accel: adis16201: Use SPDX identifier staging:

[PATCH 2/4] staging: iio: accel: Remove unnecessary comments and add suitable suffix

2018-02-12 Thread Himanshu Jha
readability. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 226 -- 1 file changed, 79 insertions(+), 147 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c index b2145c9..011d2c5

[PATCH 1/4] staging: iio: accel: adis16201: Use SPDX identifier

2018-02-12 Thread Himanshu Jha
Use SPDX identifier format instead of GPLv2. Also, rearrange the headers in the alphabetical order. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers

[PATCH 4/4] staging: iio: accel: Move adis16201 driver out of staging

2018-02-12 Thread Himanshu Jha
Move the adis16201 driver out of staging directory and merge to the mainline IIO directory. Signed-off-by: Himanshu Jha --- drivers/iio/accel/Kconfig | 12 ++ drivers/iio/accel/Makefile| 1 + drivers/iio/accel/adis16201.c | 315

[PATCH 3/4] staging: iio: accel: Use sign_extend32 and adjust a switch statement

2018-02-12 Thread Himanshu Jha
Use sign_extend32 function instead of manually coding it. Also, adjust a switch block to explicitly match channels and return -EINVAL as default case which improves code readability. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 13 - 1 file changed, 8

Re: [PATCH 2/4] staging: iio: accel: Remove unnecessary comments and add suitable suffix

2018-02-12 Thread Himanshu Jha
Hi Dan, On Mon, Feb 12, 2018 at 03:53:12PM +0300, Dan Carpenter wrote: > On Mon, Feb 12, 2018 at 05:24:57PM +0530, Himanshu Jha wrote: > > Remove some unnecessary comments by giving appropriate name to macros. > > Therefore, add _REG suffix for control registers. Also,

Re: [PATCH 4/4] staging: iio: accel: Move adis16201 driver out of staging

2018-02-12 Thread Himanshu Jha
On Mon, Feb 12, 2018 at 03:10:56PM +0100, Philippe Ombredanne wrote: > On Mon, Feb 12, 2018 at 12:54 PM, Himanshu Jha > wrote: > > Move the adis16201 driver out of staging directory and merge to the > > mainline IIO directory. > > > > Signed-off-by: Himanshu Jha >

Re: [PATCH 4/4] staging: iio: accel: Move adis16201 driver out of staging

2018-02-12 Thread Himanshu Jha
On Mon, Feb 12, 2018 at 04:18:26PM +0300, Dan Carpenter wrote: > I think -M is prefered for these types of diffs? Not sure. I wrote about that in the cover letter if you missed. :) > On Mon, Feb 12, 2018 at 05:24:59PM +0530, Himanshu Jha wrote: > > +static int adis16201_probe(struc

Re: [PATCH 2/4] staging: iio: accel: Remove unnecessary comments and add suitable suffix

2018-02-12 Thread Himanshu Jha
On Mon, Feb 12, 2018 at 05:57:31PM +0300, Dan Carpenter wrote: > On Mon, Feb 12, 2018 at 08:05:22PM +0530, Himanshu Jha wrote: > > But these should be done when we have *more* instances. > > > > For eg: > > I added a tab space in function static int adis16201_read_

[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

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/qla2xxx/qla_attr.c| 5

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/qla4xxx/ql4_init.c | 5 ++--- drivers/scsi/qla4xxx/ql4_mbx.c | 21

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/fnic/fnic_debugfs.c | 10 ++ drivers/scsi/fnic/fnic_trace.c | 9 ++--- 2 files

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/mvsas/mv_init.c | 27 +++ 1 file changed, 11

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/dpt_i2o.c | 19 --- 1 file changed, 8 insertions(+), 11

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/qedi/qedi_main.c | 42 +++--- 1 file

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 60 +--- drivers

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/bnx2i/bnx2i_hwi.c | 14 ++ 1 file changed, 6 insertions(+), 8

[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 Signed-off-by: Himanshu Jha --- drivers/scsi/bfa/bfad.c | 3 +-- drivers/scsi/bfa/bfad_debugfs.c | 8 ++-- 2 files changed, 3

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

2017-12-30 Thread Himanshu Jha
Use dma_zalloc_coherent and 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 Signed-off-by: Himanshu Jha

[PATCH] IB/ocrdma: 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 Signed-off-by: Himanshu Jha --- drivers/infiniband

[PATCH] USB: host: Use zeroing memory allocator rather 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 Signed-off-by: Himanshu Jha --- drivers/usb/host

[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 Signed-off-by: Himanshu Jha --- drivers/net

[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 Signed-off-by: Himanshu Jha --- drivers/scsi

[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 Signed-off-by: Himanshu Jha --- .../net/wireless

[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 --- drivers/scsi/fnic/fnic_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fnic

[PATCH] [media] pulse8-cec: Eliminate use of time_t and time_to_tm

2017-12-30 Thread Himanshu Jha
! Signed-off-by: Himanshu Jha --- drivers/media/usb/pulse8-cec/pulse8-cec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c b/drivers/media/usb/pulse8-cec/pulse8-cec.c index 50146f2..3506358 100644 --- a/drivers/media/usb/pulse8-cec

Re: [PATCH] USB: host: Use zeroing memory allocator rather than allocator/memset

2017-12-30 Thread Himanshu Jha
On Sat, Dec 30, 2017 at 11:41:19AM -0500, Alan Stern wrote: > On Sat, 30 Dec 2017, Himanshu Jha wrote: > > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > > Generated-by:

[PATCH v2] USB: host: Use zeroing memory allocator rather 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 Signed-off-by: Himanshu Jha --- v2: -align

[PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 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. Signed-off-by: Himanshu Jha --- drivers/crypto/amcc/crypto4xx_core.c | 8

[PATCH] fbdev: auo_k190x: 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 Signed-off-by: Himanshu Jha --- drivers/video/fbdev

[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 Signed-off-by: Himanshu Jha --- drivers/net/ethernet/cavium

[PATCH] RDMA/vmw_pvrdma: Use zeroing memory allocator than allocator/memset

2017-12-31 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 Signed-off-by: Himanshu Jha --- drivers/infiniband

[PATCH] RDMA/qedr: Use zeroing memory allocator than allocator/memset

2017-12-31 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 Signed-off-by: Himanshu Jha --- drivers/infiniband

[PATCH] RDMA/bnxt_re: Use zeroing memory allocator than allocator/memset

2017-12-31 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 Signed-off-by: Himanshu Jha --- drivers/infiniband

[PATCH] IB/mthca: Use zeroing memory allocator than allocator/memset

2017-12-31 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 Signed-off-by: Himanshu Jha --- drivers/infiniband

Re: [PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2017-12-31 Thread Himanshu Jha
On Sun, Dec 31, 2017 at 07:46:09AM -0800, Joe Perches wrote: > On Sun, 2017-12-31 at 17:54 +0530, Himanshu Jha wrote: > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > > Generated

Re: [PATCH v2] USB: host: Use zeroing memory allocator rather than allocator/memset

2018-01-01 Thread Himanshu Jha
On Sun, Dec 31, 2017 at 04:20:45PM -0500, Alan Stern wrote: > On Sun, 31 Dec 2017, Himanshu Jha wrote: > > > Use dma_zalloc_coherent for allocating zeroed > > memory and remove unnecessary memset function. > > > > Done using Coccinelle. > > Generated-by:

Re: [PATCH v2] USB: host: Use zeroing memory allocator rather than allocator/memset

2018-01-01 Thread Himanshu Jha
On Mon, Jan 01, 2018 at 10:53:07AM -0500, Alan Stern wrote: > On Mon, 1 Jan 2018, Himanshu Jha wrote: > > > On Sun, Dec 31, 2017 at 04:20:45PM -0500, Alan Stern wrote: > > > On Sun, 31 Dec 2017, Himanshu Jha wrote: > > > > > > > Use dma_zalloc_coheren

[PATCH] Coccinelle: kzalloc-simple: Add all zero allocating functions

2017-12-24 Thread Himanshu Jha
, use zero memory allocating functions instead of regular memory allocators followed by memset 0 to remove redundant memset and make the code more cleaner and also reduce the code size. Signed-off-by: Himanshu Jha --- scripts/coccinelle/api/alloc/kzalloc-simple.cocci | 371 +- 1

[PATCH] Coccinelle: kzalloc-simple: Add all zero allocating functions

2017-12-26 Thread Himanshu Jha
, use zero memory allocating functions instead of regular memory allocators followed by memset 0 to remove redundant memset and make the code more cleaner and also reduce the code size. Signed-off-by: Himanshu Jha --- scripts/coccinelle/api/alloc/kzalloc-simple.cocci | 371 +- 1

Re: [Cocci] [PATCH] Coccinelle: kzalloc-simple: Add all zero allocating functions

2017-12-26 Thread Himanshu Jha
On Tue, Dec 26, 2017 at 06:14:07PM -0200, Fabio Estevam wrote: > On Tue, Dec 26, 2017 at 5:49 PM, Himanshu Jha > wrote: > > > diff --git a/scripts/coccinelle/api/alloc/kzalloc-simple.cocci > > b/scripts/coccinelle/api/alloc/kzalloc-simple.cocci > > index 52c55e

[PATCH v2] Coccinelle: kzalloc-simple: Add all zero allocating functions

2017-12-26 Thread Himanshu Jha
, use zero memory allocating functions instead of regular memory allocators followed by memset 0 to remove redundant memset and make the code more cleaner and also reduce the code size. Signed-off-by: Himanshu Jha --- v2: -fix typo in copyright. -move all the (T *) disjunction cases before (T

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

[PATCH] qed: remove unnecessary call to memset

2017-09-12 Thread Himanshu Jha
, e2); Signed-off-by: Himanshu Jha --- 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/drivers/net/ethernet/qlogic/qed

[PATCH] drm/amd/powerplay/hwmgr: Remove null check before kfree

2017-08-29 Thread Himanshu Jha
kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 6 +- .../gpu/drm/amd/powerplay/hwmgr/processpptables.c | 96 -- drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c

[PATCH] drm/amd: Remove null check before kfree

2017-08-29 Thread Himanshu Jha
Kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 ++ drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a

[PATCH] PCI: dwc: 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 --- drivers/pci/dwc/pci-exynos.c | 5 + drivers/pci/dwc/pcie-kirin.c | 10 ++ drivers/pci/dwc/pcie-qcom.c | 5 + 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/pci

[PATCH] PCI: tegra: 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 --- drivers/pci/host/pci-tegra.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 9c40da5..90cda5b 100644 --- a/drivers

[PATCH] remoteproc: qcom: 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 --- drivers/remoteproc/qcom_adsp_pil.c | 5 + drivers/remoteproc/qcom_common.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers

[PATCH] rtc: 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 --- drivers/rtc/rtc-digicolor.c | 5 + drivers/rtc/rtc-ds1347.c| 5 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c index

[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 --- 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/qla2xxx/tcm_qla2xxx.c index 3f82ea1..bf33350

[PATCH] drm: omapdrm: hdmi: 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 --- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 + drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 + drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 5 + drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 5

[PATCH] drm/sun4i: 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 --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 + drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 5 + drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 5 + 3 files changed, 3 insertions(+), 12

Re: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO

2017-08-29 Thread Himanshu Jha
On Tue, Aug 29, 2017 at 03:55:17PM +0200, Thierry Reding wrote: > On Tue, Aug 29, 2017 at 07:09:00PM +0530, Himanshu Jha wrote: > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > > > Signed-off-by: Himanshu Jha > > --- > > drivers/pci/host/

[PATCH] rtc: remove cast to void pointer

2017-08-29 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 --- drivers/rtc/interface.c | 4 ++-- drivers/rtc/rtc-88pm80x.c| 2 +- drivers/rtc/rtc-88pm860x.c | 2 +- drivers/rtc/rtc

Re: [PATCH] rtc: Use PTR_ERR_OR_ZERO

2017-08-29 Thread Himanshu Jha
On Tue, Aug 29, 2017 at 04:20:11PM +0200, Alexandre Belloni wrote: > Hi, > > On 29/08/2017 at 19:16:59 +0530, Himanshu Jha wrote: > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > > > I'm not taking that kind of useless changes (especially since

[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 --- drivers/scsi/bfa/bfa_ioc.c | 1 - drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 -- drivers/scsi/qla4xxx/ql4_os.c | 1 - 3 files

[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 --- drivers/net/wireless/rsi/rsi_91x_sdio.c | 1 - drivers/net/wireless/rsi/rsi_91x_usb.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/net/wireless/rsi

[PATCH] drm/amdkfd: 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 --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b

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 woul

[PATCH] drm/gma500: Remove null check before kfree

2017-08-30 Thread Himanshu Jha
kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c

[PATCH] drm/i915/opregion: Remove null check before kfree

2017-08-30 Thread Himanshu Jha
kfree on NULL pointer is a no-op and therefore checking is redundant. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/i915/intel_opregion.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c

[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 --- drivers/net/wireless/ath/ath9k/ar9003_mac.c | 4 ++-- drivers/net/wireless/ath/ath9k/dfs.c| 2 +- drivers/net

[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 --- drivers/net/wireless/atmel/at76c50x-usb.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless

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

2017-08-22 Thread Himanshu Jha
On Tue, Aug 22, 2017 at 10:41:45AM +0200, Matteo Croce wrote: > Il giorno mar, 22/08/2017 alle 13.41 +0530, Himanshu Jha ha scritto: > > Check memory allocation failure and return -ENOMEM if failure > > occurs. > > > > Signed-off-by: Himanshu Jha > > --- > &g

[PATCH] drivers: staging: rtl8192e: make const qualified argument

2017-08-22 Thread Himanshu Jha
The ether_addr_copy expects const u8* as its second argument, therefore pass const qualified argument instead of non-const argument. Signed-off-by: Himanshu Jha --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a

[PATCH v2] fbdev: vgastate: fix line over 80 character and remove unnecessary space

2017-08-23 Thread Himanshu Jha
Fixes the following checkpatch warnings: WARNING: line over 80 characters WARNING: space prohibited between function name and open parenthesis '(' WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable Signed-off-by: Himanshu Jha --- drivers/video/vgast

[PATCH] IB/core: replace memcpy with ether_addr_copy

2017-08-24 Thread Himanshu Jha
Use ether_addr_copy to copy an ethernet address of size ETH_ALEN instead of memcpy. Signed-off-by: Himanshu Jha --- drivers/infiniband/core/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index

<    1   2   3   >