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:
"
)
> + 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
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,
>
; + 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
> + __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
*/
> *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
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
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
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
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
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
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
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
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
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
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
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
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
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 (
: 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
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
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
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
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
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
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
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
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
s",
> + .pm = &ams_pm_ops,
> + .of_match_table = ams_of_match_table,
> + },
> +};
> +module_platform_driver(ams_driver);
--
Thanks
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
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:
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
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
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
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
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,
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
>
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
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_
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
!
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
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:
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
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
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
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
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
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
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
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
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
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:
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
, 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
, 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
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
, 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
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
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
, 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
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
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
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
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
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
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
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
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
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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
101 - 200 of 254 matches
Mail list logo