Re: [Cocci] [PATCH v2 08/10] scripts: Coccinelle script for namespace dependencies.

2019-08-13 Thread Himanshu Jha
d, 97 insertions(+), 1 deletion(-) > create mode 100644 scripts/coccinelle/misc/add_namespace.cocci > create mode 100644 scripts/nsdeps [] > +if [ "$SPATCH_VERSION_NUM" -lt "$SPATCH_REQ_VERSION_NUM" ] ; then > +echo 'spatch needs to be version 1.06 or higher

[PATCH] iio: chemical: bme680: Fix pressure and humidity ABI mismatch

2019-08-08 Thread Himanshu Jha
. Currently pressure is reported in hectopascal(hPa) and relative humidity in percent. Hence fix this ABI mismatch conforming to the standard ABI. Fixes: 1b3bd8592780 ("iio: chemical: Add support for Bosch BME680 sensor") Signed-off-by: Himanshu Jha --- While cleaning this mess I wonder

[PATCH v2] coccinelle: api: add devm_platform_ioremap_resource script

2019-07-15 Thread Himanshu Jha
Use recently introduced devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together. This helps produce much cleaner code and remove local `struct resource` declaration. Signed-off-by: Himanshu Jha Signed-off-by: Julia Lawall --- v2

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

2019-04-03 Thread Himanshu Jha
lso be removed in this same patch: * Licensed under the GPL-2 or later. And lastly, MODULE_LICENSE() should also be checked, which appear to be correct in its current form. > /* > * ADIS16203 Programmable 360 Degrees Inclinometer > * > -- > 2.1.4 > -- Hima

Re: [PATCH v3 2/2] iio/chemical/bme680: Fix SPI read interface

2019-03-17 Thread Himanshu Jha
On Sat, Mar 16, 2019 at 01:00:39PM +, Mike Looijmans wrote: > On 16-03-19 11:24, Himanshu Jha wrote: > > On Wed, Mar 06, 2019 at 08:31:48AM +0100, Mike Looijmans wrote: > >> The SPI interface implementation was completely broken. > >> > >> When using the SPI

Re: [PATCH v3 2/2] iio/chemical/bme680: Fix SPI read interface

2019-03-16 Thread Himanshu Jha
o work before: root@beaglebone:/sys/bus/iio/devices/iio:device1# cat name in_temp_input \ in_pressure_input in_humidityrelative_input in_resistance_input bme680 26860 --> w/o your patch it used to be 26.86000 degC 990.87000 55.26500 10091 I'm still assuming that there is some problem on my side, as it works flawless for you. But it is really difficult for me to figure out exactly where the problem could be! -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] iio/chemical/bme680: Fix SPI read interface

2019-02-16 Thread Himanshu Jha
> + u8 addr = *(const u8 *)reg; > + u8 addr7; Unused variable. > + ret = bme680_regmap_spi_select_page(ctx, addr); > + if (ret) > + return ret; > > - return spi_write_then_read(spi, reg, reg_size, val, val_size); > + addr |= 0x80; /* bit7 = RW = '1' */ > + > + return spi_write_then_read(spi, &addr, 1, val, val_size); > } > > static struct regmap_bus bme680_regmap_bus = { > @@ -45,8 +111,8 @@ static int bme680_regmap_spi_read(void *context, const > void *reg, > static int bme680_spi_probe(struct spi_device *spi) > { > const struct spi_device_id *id = spi_get_device_id(spi); > + struct bme680_spi_bus_context *bus_context; > struct regmap *regmap; > - unsigned int val; > int ret; > > spi->bits_per_word = 8; > @@ -56,45 +122,21 @@ static int bme680_spi_probe(struct spi_device *spi) > return ret; > } > > + bus_context = devm_kzalloc(&spi->dev, sizeof(*bus_context), GFP_KERNEL); > + if (!bus_context) > + return -ENOMEM; > + > + bus_context->spi = spi; > + bus_context->current_page = 0xff; /* Undefined on warm boot */ OK. This is what you observed. If this patch works as expected then I think a "Fixes:" tag should be added while marking it for stable ? Thanks for the patch Mike and apologies again for the whole mess. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] drivers: iio: industrialio-core: add check when kzalloc fails

2019-01-25 Thread Himanshu Jha
;buffer_list); > > + } else { > > + return NULL; > > I'd argue that this is a bit redundant, because `dev` is NULL, the > return below (return dev) will also return NULL. +1 Also, subject title is incorrect. Always use: $ git log --oneline drivers/

Re: [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support

2019-01-15 Thread Himanshu Jha
On Mon, Jan 14, 2019 at 03:19:13PM -0500, Sebastien Bourdelin wrote: > This commit allow the driver to work with device-tree. > > Signed-off-by: Sebastien Bourdelin > --- Acked-by: Himanshu Jha Thanks! > v2 -> v3: > - remove of_match_ptr: Suggested by Jonathan

Re: [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680

2019-01-15 Thread Himanshu Jha
On Mon, Jan 14, 2019 at 03:19:14PM -0500, Sebastien Bourdelin wrote: > BME680 is a pressure/temperature/humidity/voc sensor. > > Signed-off-by: Sebastien Bourdelin > --- > v2 -> v3: > - change i2c address to 0x76 as it seems more reliable: Suggested by > Himanshu Jha

Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-15 Thread Himanshu Jha
Hi Sebastien, On Mon, Jan 14, 2019 at 03:00:41PM -0500, sebastien bourdelin wrote: > Hi, > > On 1/12/19 4:42 AM, Himanshu Jha wrote: > > On Fri, Jan 11, 2019 at 03:53:58PM -0500, Sebastien Bourdelin wrote: > > > This commit allow the driver to work with device-tree. &g

Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

2019-01-12 Thread Himanshu Jha
ed this while testing. Actallly, I don't understand what "VDIDO" is, as explained in the datasheet. Anyway, if the above compilation issue is not a problem, then Acked-by: Himanshu Jha Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] Staging: iio: ad7192: replaced bool in struct

2019-01-07 Thread Himanshu Jha
On Wed, Jan 02, 2019 at 01:25:27PM -0800, Matt Ranostay wrote: > > > On Dec 24, 2018, at 01:58, Himanshu Jha wrote: > > > >> On Fri, Dec 21, 2018 at 03:26:26PM -0800, Amir Mahdi Ghorbanian wrote: > >> Replaced bool in struct with unsigned int bitfield to con

Re: [PATCH] Staging: iio: ad7192: replaced bool in struct

2018-12-24 Thread Himanshu Jha
; > + unsigned intchop_en : 1; > + unsigned intbuf_en : 1; > + unsigned intunipolar_en : 1; > + unsigned intburnout_curr_en : 1; > }; > > #endif /* IIO_ADC_AD7192_H_ */ > -- > 2.7.4 > Goodluck! -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH 2/2] checkpatch: add Co-developed-by to signature tags

2018-12-14 Thread Himanshu Jha
oe - I find this tag kinda useless and duplicative. But whatever. I'm fine either way, just the problem is: Co-developed-by Vs Co-Developed-by with checkpatch spitting out that it is not a valid signature. In the end, I can completely remove the tag from docs if it is useless and duplicati

Re: [PATCH] checkpatch: add Co-Developed-by to signature tags

2018-12-14 Thread Himanshu Jha
On Fri, Dec 14, 2018 at 09:39:10AM -0800, Joe Perches wrote: > On Fri, 2018-12-14 at 22:58 +0530, Himanshu Jha wrote: > > On Fri, Dec 14, 2018 at 08:27:33AM -0800, Joe Perches wrote: > > > Is it really important to specify things like 75% / 25% > > > authorship credi

Re: [PATCH 1/2] docs: fix Co-Developed-by docs

2018-12-14 Thread Himanshu Jha
nother > developer > along with the original author. This is useful at times when multiple people > work on a single patch. Note, this person also needs to have a > Signed-off-by: > line in the patch as well. > -- > 2.7.4 > -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] checkpatch: add Co-Developed-by to signature tags

2018-12-14 Thread Himanshu Jha
On Fri, Dec 14, 2018 at 08:27:33AM -0800, Joe Perches wrote: > On Fri, 2018-12-14 at 21:46 +0530, Himanshu Jha wrote: > > On Fri, Dec 14, 2018 at 07:52:15AM -0800, Joe Perches wrote: > > > On Fri, 2018-12-14 at 14:01 +0100, Jorge Ramirez-Ortiz wrote: > > > > As per Do

Re: [PATCH] checkpatch: add Co-Developed-by to signature tags

2018-12-14 Thread Himanshu Jha
does multiple Signed-off-by: in the commits imply that the patch was created by all those developers ? I don't think so, perhaps this was the reason to introduce Co-developed-by: tag. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [Cocci] [PATCH 0/2] scripts: coccinelle: Improve boolinit

2018-12-12 Thread Himanshu Jha
.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] staging: iio: ad5933: add binding doc for ad5933

2018-12-02 Thread Himanshu Jha
> Signed-off-by: Marcelo Schmitt > Signed-off-by: Gabriel Capella > --- Use `./scripts/get_maintainer.pl ` to list the DT maintainers and the relevant mailing list. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH 2/3] iio: chemical: add support for Sensirion SPS30 sensor

2018-11-25 Thread Himanshu Jha
o_cmd(state, SPS30_START_MEAS, NULL, 0); > + if (ret) { > + dev_err(&client->dev, "failed to start measurement\n"); > + return ret; > + } > + > + ret = devm_iio_triggered_buffer_setup(&client->dev, indio_dev, NULL, > + sps30_trigger_handler, NULL); > + if (ret) > + return ret; > + > + return devm_iio_device_register(&client->dev, indio_dev); > +} > + > +static int sps30_remove(struct i2c_client *client) Perfect candidate for `devm_add_action_or_reset()` ? > +{ > + struct iio_dev *indio_dev = i2c_get_clientdata(client); > + struct sps30_state *state = iio_priv(indio_dev); > + > + sps30_do_cmd(state, SPS30_STOP_MEAS, NULL, 0); > + > + return 0; > +} -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH v7 3/3] staging: iio: ad2s1210: Add device tree table.

2018-11-01 Thread Himanshu Jha
tree/bindings/iio/resolver/ad2s1210.txt Cc'ed to devictree list + Rob(DT Maintainer). Just wondering why didn't it came up till now from the IIO reviewers ? v7!! -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [Outreachy kernel] [RESEND PATCH 2/2] staging: vboxvideo: Use unsigned int instead bool

2018-10-28 Thread Himanshu Jha
aranteed to be -1..0 Regardless, integer conversion rules will kick in. > But the :1 adds instructions, so at least for only one bool, where little > space is saved, it is probably not worth it. True, we should reply on a promised guideline rather than possibility. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [Outreachy kernel] [RESEND PATCH 2/2] staging: vboxvideo: Use unsigned int instead bool

2018-10-28 Thread Himanshu Jha
ble alignement issues" in CHECK report is difficult to figure out by just doing a glance analysis. :) Linus also suggested to use bool as the base type i.e., `bool x:1` but again sizeof(_Bool) is implementation defined ranging from 1-4 bytes. And since this issue is added to checkpatch now, very

Re: [PATCH v3 2/3] iio: adc128s052: add ACPI _HID AANT1280

2018-10-27 Thread Himanshu Jha
BME0280", BME280_CHIP_ID }, Therefore, I used BME0680 for bosch bme680 sensor! In OF matching, we use vendor prefixes and that looks more legimate: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/vendor-prefixes.txt Dan, These questions are not just for you but to rest of the community members as well. If there is something I misunderstood, then please let me know :) Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] staging: iio: ad7780: update voltage on read

2018-10-25 Thread Himanshu Jha
I missing something? Your patch applies fine. I think the problem is on Lars end due to Thunderbird. In the meantime, you can verify the patch using: $ git am Also, you can try to use `git send-email` to send patches. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH v4 3/3] iio: magnetometer: Add driver support for PNI RM3100

2018-10-12 Thread Himanshu Jha
se three breaks are not proper aligned. Please send the new version of a patch as a *new* thread and don't use `--in-reply-to` flag(if you're using) to chain into older versions as whole thread of older discussion comes up and is often not required. The changelog gives enough info of what's new in the revised series. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] staging: iio: ad2s1210: fix 'assignment operator' style checks

2018-10-07 Thread Himanshu Jha
-email`. Also, as a safety measure you may use the `--dry-run` flag of `git send-email` to see how it would look like when you send the patch. Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH 2/2] iio: magnetometer: Add driver support for PNI RM3100

2018-09-25 Thread Himanshu Jha
ap = devm_regmap_init_spi(spi, &rm3100_regmap_config); > + if (IS_ERR(regmap)) > + return PTR_ERR(regmap); > + > + return rm3100_common_probe(&spi->dev, regmap, spi->irq); > +} > + > +static const struct of_device_id rm3100_dt_match[] = {

Re: [PATCH] iio: adc: Fix potential integer overflow

2018-09-24 Thread Himanshu Jha
ertainly it is undefined behavior and called "overflow". And here `temp` is guaranteed to not overflow! But I don't understand what issue are you trying to resolve here and I'm interested in this particular set of warnings because I too get coverity scan reports on the same alth

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

2018-09-22 Thread Himanshu Jha
216 For 'GNU General Public License (GPL) version 2 only' use: 217 SPDX-License-Identifier: GPL-2.0 218 For 'GNU General Public License (GPL) version 2 or any later version' use: 219 SPDX-License-Identifier: GPL-2.0+ -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH 2/2] iio: adc: at91: fix wrong channel number in triggered buffer mode

2018-09-22 Thread Himanshu Jha
6.GA2077@himanshu-Vostro-3559/ And it nests properly in the given thread avoiding any noise to kbuild bot. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH] iio: magnetometer: hmc5843: Clean up redundant code.

2018-09-21 Thread Himanshu Jha
gnetometer/hmc5843_i2c.ko] > >> undefined! You would need to export these above symbols using EXPORT_SYMBOL() to be used by i2c/spi modules. But on the other hand, exporting too many symbols is a bad idea since it is only used for this driver and not at any other place in IIO. So,

Re: [PATCH -next] iio: potentiometer: mcp4531: merge calls to of_match_device and of_device_get_match_data

2018-09-15 Thread Himanshu Jha
er //# of_device_get_match_data() returns const * and therefore the left //# argument of assignment should also be a const * for compatible //# types. /// // Confidence: Moderate // Copyright: (C) 2018 Himanshu Jha, GPLv2. // Copyright: (C) 2018 Julia Lawall, INRIA/LIP6. GPLv

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

2018-09-14 Thread Himanshu Jha
o "Keyser Söze" once you're done with your major at University. You would need to test/review patches in future. Not a big deal though.. > + > +static const struct of_device_id st_vl53l0x_dt_match[] = { > + { .compatible = "st,vl53l0x-i2c", }, > + {

Re: [PATCH v4 4/5] iio: fxas21002c: add ODR/Scale support

2018-09-14 Thread Himanshu Jha
of the drivers ? I see its wide usage in IIO without bug reports: himanshu@himanshu-Vostro-3559:~/linux-next$ git grep -w "IIO_DEGREE_TO_RAD" drivers/iio/ | wc -l 34 And that concludes, that there is some problem within your code! In the meantime, you can try to look the disassemb

Re: [PATCH] iio: proximity: lidar-v2: replace i2c block access method with the one already implemented.

2018-09-14 Thread Himanshu Jha
ur queries doesn't get included in the commit message. And no need to reply an explicit "thanks". That is implicit ;) We already have a ~30k email traffic on LKML... https://marc.info/?l=linux-kernel&r=1&w=2 Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH v2 3/4] iio: adc: Add Xilinx AMS driver

2018-09-14 Thread Himanshu Jha
nd would save his effort of doing it again :) https://lore.kernel.org/lkml/20180903183618.ga6...@embeddedor.com/ > +MODULE_LICENSE("GPL"); > +MODULE_AUTHOR("Xilinx, Inc."); Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

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

2018-09-12 Thread Himanshu Jha
tries--); > + if (!tries) > + return -ETIMEDOUT; > + > + msg[0].addr = client->addr; > + msg[0].buf = &write_command; > + msg[0].len = 1; > + msg[0].flags = client->flags | I2C_M_STOP; > + > + msg[1].addr = client->addr; >

Re: [PATCH v4 4/5] iio: fxas21002c: add ODR/Scale support

2018-09-12 Thread Himanshu Jha
* 314159ULL + 900ULL) / 1800ULL) This '/' operator might be the culprit! Just for checking that the error, remove the macro declaration `FXAS21002C_SCALE` plus its usage and re-cross compile using `make ARCH=i386`. In my case I used the `div64_s64` function handles builds fo

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] 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] 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: 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 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] iio: chemical: bme680: Add check for val2 in the write_raw function

2018-08-19 Thread Himanshu Jha
On Sun, Aug 19, 2018 at 05:25:14PM +0100, Jonathan Cameron wrote: > On Sat, 11 Aug 2018 15:56:36 +0530 > Himanshu Jha wrote: > > > val2 is responsible for the floating part of the number to be > > written to the device. We don't need the floating part > > while wr

Re: [PATCH] Coccinelle: remove pci_alloc_consistent semantic to dectect in zalloc-simple.cocci

2018-08-18 Thread Himanshu Jha
On Sat, Aug 18, 2018 at 10:10:26PM +0800, zhong jiang wrote: > On 2018/8/18 22:01, Julia Lawall wrote: > > > > On Sat, 18 Aug 2018, zhong jiang wrote: > > > >> On 2018/8/18 20:52, Himanshu Jha wrote: > >>> On Sat, Aug 18, 2018 at 08:01:40P

Re: [PATCH] Coccinelle: remove pci_alloc_consistent semantic to dectect in zalloc-simple.cocci

2018-08-18 Thread Himanshu Jha
ot; -> "detect" Otherwise, Acked-by: Himanshu Jha Thanks for cleaning up, we still have few more *_alloc/memset in the mainline, especially in the scsi subsystem, even after I cleaned up with two long patch series in the past. -- Himanshu Jha Undergraduate Student Department of Electr

Re: [PATCH] staging: gasket: remove null ptr check before kfree

2018-08-12 Thread Himanshu Jha
ps://www.kernel.org/doc/html/latest/process/submitting-patches.html#the-canonical-patch-format Hope that helps! -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

[PATCH] iio: chemical: bme680: Add check for val2 in the write_raw function

2018-08-11 Thread Himanshu Jha
ff-by: Himanshu Jha --- drivers/iio/chemical/bme680_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c index 7d9bb62baa3f..9d5a05e054d1 100644 --- a/drivers/iio/chemical/bme680_core.c +++ b/drivers/iio/chemical/bme680_c

Re: [PATCH] coccicheck: return proper error code on check fail

2018-08-10 Thread Himanshu Jha
es are obsolete and likely more prone to be disfunctional. For instance: https://systeme.lip6.fr/pipermail/cocci/2017-December/004799.html Thanks. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

Re: [PATCH][iio-next] iio: chemical: fix spelling mistake "failted" -> "failed"

2018-08-03 Thread Himanshu Jha
On Fri, Aug 03, 2018 at 12:55:51PM +0100, Colin King wrote: > From: Colin Ian King > > fix spelling mistake in dev_err error message text > > Signed-off-by: Colin Ian King Oops! Thanks for the patch Colin. Reviewed-by: Himanshu Jha -- Himanshu Jha Undergraduate Studen

[PATCH v5] iio: chemical: Add support for Bosch BME680 sensor

2018-07-26 Thread Himanshu Jha
dia/_tech/media/datasheets/BST-BME680-DS001-00.pdf Cc: Daniel Baluta Signed-off-by: Himanshu Jha --- v5: -removed unnecessary casts from compensate functions. -used devm_iio_register for now. -used bitshifting near approximation instead of complex multiplication in bme680

Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor

2018-07-23 Thread Himanshu Jha
On Mon, Jul 23, 2018 at 03:16:10PM -0700, David Frey wrote: > On 7/22/2018 3:21 PM, Himanshu Jha wrote: > >On Sat, Jul 21, 2018 at 08:45:34PM +0300, Daniel Baluta wrote: > >>On Sat, Jul 21, 2018 at 6:43 PM, Andy Shevchenko > >> wrote: > >>>On Sat, Jul 21, 20

Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor

2018-07-22 Thread Himanshu Jha
On Sat, Jul 21, 2018 at 08:45:34PM +0300, Daniel Baluta wrote: > On Sat, Jul 21, 2018 at 6:43 PM, Andy Shevchenko > wrote: > > On Sat, Jul 21, 2018 at 6:36 PM, Himanshu Jha > > wrote: > > > >>> > + /* Look up table 1 for the possible gas range va

Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor

2018-07-21 Thread Himanshu Jha
On Sat, Jul 21, 2018 at 06:43:51PM +0300, Andy Shevchenko wrote: > On Sat, Jul 21, 2018 at 6:36 PM, Himanshu Jha > wrote: > > >> > + /* Look up table 1 for the possible gas range values */ > >> > + u32 lookupTable1[16] = {2147

Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor

2018-07-21 Thread Himanshu Jha
> > Don't think you can get here so this code should not be here. Ok. > > + default: > > + return -EINVAL; > > + } > > + default: > > + return -EINVAL; > > + } > > + > > You can't

[PATCH v4] iio: chemical: Add support for Bosch BME680 sensor

2018-07-20 Thread Himanshu Jha
dia/_tech/media/datasheets/BST-BME680-DS001-00.pdf Cc: Daniel Baluta Signed-off-by: Himanshu Jha --- v4: -Added Bosch API links and datasheet link. -explained with comments about the compensate functions. -fixed SPI ID register address. -Used FIELD_PREP macro to avoid unnecess

Re: [PATCH v3] iio: chemical: Add support for Bosch BME680 sensor

2018-07-15 Thread Himanshu Jha
Hi Jonathan, On Sun, Jul 15, 2018 at 10:10:36AM +0100, Jonathan Cameron wrote: > On Sat, 14 Jul 2018 13:03:42 +0530 > Himanshu Jha wrote: > > > Hi David, > > > > On Fri, Jul 13, 2018 at 01:42:35PM -0700, David Frey wrote: > > > Hi Himanshu Jha, > >

Re: [PATCH v3] iio: chemical: Add support for Bosch BME680 sensor

2018-07-14 Thread Himanshu Jha
Hi David, On Fri, Jul 13, 2018 at 01:42:35PM -0700, David Frey wrote: > Hi Himanshu Jha, > > First a bit of background. I'm working on a device which will contain a > bme680 sensor. A colleague of mine started work on a Linux kernel driver > for the chip a little while ag

[PATCH v3] iio: chemical: Add support for Bosch BME680 sensor

2018-07-11 Thread Himanshu Jha
dia/_tech/media/datasheets/BST-BME680-DS001-00.pdf Cc: Daniel Baluta Signed-off-by: Himanshu Jha --- v3: -moved files to chemical directory instead of a dedicated directory. -read calibration parameters serially with endian conversions. -drop some return ret. -removed few unnecessa

Re: [PATCH 2/3] iio: imu: mpu6050: add support for regulator framework

2018-07-11 Thread Himanshu Jha
_core_probe); > > +int inv_mpu_core_remove(struct inv_mpu6050_state *st) > +{ > + return regulator_disable(st->vddio_supply); > +} EXPORT_SYMBOL_GPL(inv_mpu_core_remove); ? This is causing 0-day test build failure perhaps. -- Himanshu Jha Undergraduate Student Department of Electronics &

Re: [PATCH v2] iio: chemical: bme680: Add Bosch BME680 sensor support

2018-07-08 Thread Himanshu Jha
On Sat, Jul 07, 2018 at 07:01:55PM +0100, Jonathan Cameron wrote: > On Fri, 6 Jul 2018 13:20:16 +0530 > Himanshu Jha wrote: > > > Bosch BME680 is a 4-in-1 sensor with temperature, pressure, humidity > > and gas sensing capability. It supports both I2C and SPI communica

[PATCH v2] iio: chemical: bme680: Add Bosch BME680 sensor support

2018-07-06 Thread Himanshu Jha
dia/_tech/media/datasheets/BST-BME680-DS001-00.pdf Cc: Daniel Baluta Signed-off-by: Himanshu Jha --- v2: -Used devm_add_action() to add a generic remove method for both I2C & SPI driver. -Introduction of compensation functions. -chip initialisation routines

Re: [PATCH v3 1/2] iio: dac: Add AD5758 support

2018-06-28 Thread Himanshu Jha
On Fri, Jun 29, 2018 at 03:18:18AM +0530, Himanshu Jha wrote: > On Thu, Jun 28, 2018 at 03:13:32PM +0300, Stefan Popa wrote: > > The AD5758 is a single channel DAC with 16-bit precision which uses the > > SPI interface that operates at clock rates up to 50MHz. > > > > T

Re: [PATCH v3 1/2] iio: dac: Add AD5758 support

2018-06-28 Thread Himanshu Jha
gt; + ARRAY_SIZE(ad5758_dc_dc_ilim), > + sizeof(int), cmpfunc); Thanks. -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology

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

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

[PATCH 2/4] Staging: iio: accel: adis16201: Use GENMASK

2018-03-22 Thread Himanshu Jha
Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/staging/iio

[PATCH 1/4] Staging: iio: accel: adis16201: Remove unused headers

2018-03-22 Thread Himanshu Jha
Remove few unused headers files since the adis core handles the buffer and sysfs support. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c

[PATCH 3/4] Staging: iio: accel: adis16201: Fix 80 character line limit

2018-03-22 Thread Himanshu Jha
Split the line over 80 characters limit to fix checkpatch warning. Signed-off-by: Himanshu Jha --- drivers/staging/iio/accel/adis16201.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c index

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 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

[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 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 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 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 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 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 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 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 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 (

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Himanshu Jha
On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: > > > On 03/13/2018 11:24 AM, Himanshu Jha wrote: > >Hi Gustavo, > > > >On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: > >>In preparation to enabling -Wvla, remove

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Himanshu Jha
#x27;ed you and Kees to avoid the patch collisions. -- Thanks Himanshu Jha

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

2018-03-09 Thread Himanshu Jha
o-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

Re: [PATCH] iio: potentiometer: ds1803: Remove VLA usage

2018-03-09 Thread Himanshu Jha
On Thu, Mar 08, 2018 at 11:39:15AM -0800, Kees Cook wrote: > On Thu, Mar 8, 2018 at 10:45 AM, Himanshu Jha > wrote: > > In preparation to enabling -Wvla, remove VLA usage and replace it > > with fixed a fixed length array and therefore, prevent potential > > stack overflo

Re: [PATCH v4] Staging: iio: adis16209: Change some macro names

2018-03-08 Thread Himanshu Jha
AG_STAT_ALARM1 BIT(8) > +#define ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT 5 > +#define ADIS16209_DIAG_STAT_SPI_FAIL_BIT3 > +#define ADIS16209_DIAG_STAT_FLASH_UPT_BIT 2 #define ADIS16209_STAT_FLASH_UPT_FAIL_BIT2 ? It represents flash update fail bit! -- Thanks Himanshu Jha

[PATCH] iio: potentiometer: ds1803: Remove VLA usage

2018-03-08 Thread Himanshu Jha
-by: Himanshu Jha --- drivers/iio/potentiometer/ds1803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 9b0ff4a..6bf12c9 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio

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

2018-03-07 Thread Himanshu Jha
On Wed, Mar 07, 2018 at 08:50:30PM +, Jonathan Cameron wrote: > On Mon, 5 Mar 2018 13:19:29 +0530 > Himanshu Jha wrote: > > > Clarify the conversion and formation of resultant data in the > > adis16201_read_raw() with sufficient comments. > > > > Signed-off

[PATCH v2] usb: isp1760: Use kasprintf

2018-03-07 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf and therefore avoid unnecessary computation of string length. Also, remove the useless local variable. Signed-off-by: Himanshu Jha --- drivers/usb/isp1760/isp1760-udc.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) v2

Re: [PATCH] usb: isp1760: Use kasprintf

2018-03-07 Thread Himanshu Jha
On Wed, Mar 07, 2018 at 08:20:54PM +0200, Andy Shevchenko wrote: > On Wed, Mar 7, 2018 at 8:08 PM, Himanshu Jha > wrote: > > Use kasprintf instead of combination of kmalloc and sprintf and > > therefore avoid unnecessary computation of string length. > > >

[PATCH] usb: isp1760: Use kasprintf

2018-03-07 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf and therefore avoid unnecessary computation of string length. Signed-off-by: Himanshu Jha --- drivers/usb/isp1760/isp1760-udc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-udc.c b

[PATCH] mfd: ab8500-debugfs: Use kasprintf

2018-03-07 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf. Signed-off-by: Himanshu Jha --- drivers/mfd/ab8500-debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 8ba4107..831a1ce 100644 --- a/drivers

[PATCH] drm/vmwgfx: Use kasprintf

2018-03-07 Thread Himanshu Jha
Use kasprintf instead of combination of kmalloc and sprintf. Also, remove the local variables used for storing the string length as they are not required now. Signed-off-by: Himanshu Jha --- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions

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

2018-03-06 Thread Himanshu Jha
such as Fatory Reset, Software Reset, etc. See, it is difficult to point the perfect names than the suitable ones! And let's just leave these *bikeshedding* ;-) -- Thanks Himanshu Jha

[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 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 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 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

  1   2   3   >