iio: as3935: Remove unnecessary cast
PATCH 1/3 iio: as3935: Remove unnecessary cast
buf is cast to a const char *, but buf is already a const char *, so the case is unnecessary.
--- drivers/iio/proximity/as3935.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/proximity/as3935.c +1 -1
@@ -133,7 +133,7 @@ static ssize_t as3935_sensor_sensitivity_store(struct device *dev,unsigned long val;int ret; - ret =kstrtoul ((const char *) buf,10 , &val); + ret =kstrtoul (buf,10 , &val);if (ret)return -EINVAL ;
Signature · 1 line
2.30.2
PATCH 2/3 iio: in2xx-adc: Remove unnecessary cast
buf is cast to a const char *, but buf is already a const char *, so the case is unnecessary.
--- drivers/iio/adc/ina2xx-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ina2xx-adc.c +1 -1
@@ -550,7 +550,7 @@ static ssize_t ina2xx_allow_async_readout_store(struct device *dev,bool val;int ret; - ret =strtobool ((const char *) buf, &val); + ret =strtobool (buf, &val);if (ret)return ret;
Signature · 1 line
2.30.2
A message that is not in the archive (sent off-list or not yet received): CAHp75Vd+NoRzbJAKX7kZ_JBF0fC6xZc2rkLezbuTozSsAp8X8A@mail.gmail.com
Re: [PATCH 2/3] iio: in2xx-adc: Remove unnecessary cast
Quoted 19 lines · Andy Shevchenko
Quoted 17 lines · Lars-Peter Clausen
bufis cast to a const char *, butbufis already a const char *, so the case is unnecessary.Signed-off-by Lars-Peter Clausen <[email protected]>--- drivers/iio/adc/ina2xx-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/ina2xx-adc.c +0
-0@@ -550,7 +550,7 @@ static ssize_t ina2xx_allow_async_readout_store(structdevice *dev, bool val;int ret;
Quoted 5 lines
drivers/iio/adc/ina2xx-adc.c static ssize_t ina2xx_allow_async_readout_store(struct device *dev, · line 553
Quoted 2 lines
drivers/iio/adc/ina2xx-adc.c +1
-1- ret =strtobool ((const char *) buf, &val); + ret =strtobool (buf, &val);While at it, please switch to
kstrtobool().
This seems unrelated to this patch. And while worthwhile doing it should be in its own series.
PATCH 3/3 iio: vz89x: Remove unnecessary cast
In reply to Lars-Peter ClausenThe case to u8 * is unnecessary here since the expression is already of type u8 *.
--- drivers/iio/chemical/vz89x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/chemical/vz89x.c +1 -1
@@ -242,7 +242,7 @@ static int vz89x_get_resistance_reading(struct vz89x_data *data,struct iio_chan_spec const *chan, int *val) { - u8 *tmp = (u8 *) &data->buffer[chan->address]; + u8 *tmp = &data->buffer[chan->address];switch (chan->scan_type.endianness) {case IIO_LE :
Signature · 1 line
2.30.2
A message that is not in the archive (sent off-list or not yet received): CAHp75VdDB92KGALRhBoepmBZQiXqUK7n4AmpM4mbSxKDku0f8Q@mail.gmail.com
Quoted 20 lines · On Fri, 10 Dec 2021 00:13:49 +0200 Andy Shevchenko <[email protected]>…
Quoted 18 lines · Lars-Peter Clausen
bufis cast to a const char *, butbufis already a const char *, so the case is unnecessary.Signed-off-by Lars-Peter Clausen <[email protected]>--- drivers/iio/proximity/as3935.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/proximity/ renamed from drivers/iio/proximity/as3935.c +0
-0
as3935.c
indexd62766b6b39e..51f4f92ae84a100644drivers/iio/proximity/as3935.c +0
-0@@ -133,7 +133,7 @@ static ssize_t as3935_sensor_sensitivity_store(structdevice *dev, unsigned long val;int ret;
Quoted 9 lines
drivers/iio/proximity/as3935.c static ssize_t as3935_sensor_sensitivity_store(struct device *dev, · line 138
Quoted 4 lines
drivers/iio/proximity/as3935.c +1
-1- ret =kstrtoul ((const char *) buf,10 , &val); + ret =kstrtoul (buf,10 , &val);if (ret)return -EINVAL ;A bit out of scope, but this eventually should be
Agreed this could do with a follow up, as should the other one you point out, but in the spirit of single purpose series I've applied this set to the togreg branch of iio.git - pushed out as testing and look forward to the follow ups ;)
Jonathan
Quoted 10 lines
return ret;
Quoted 5 lines
--
2.30.2