Message ID | 20211209161730.396848-1-lars@metafoo.de (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/3] iio: as3935: Remove unnecessary cast | expand |
On Fri, 10 Dec 2021 00:13:49 +0200 Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Thursday, December 9, 2021, Lars-Peter Clausen <lars@metafoo.de> wrote: > > > `buf` is cast to a const char *, but `buf` is already a const char *, so > > the case is unnecessary. > > > > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> > > --- > > drivers/iio/proximity/as3935.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/ > > as3935.c > > index d62766b6b39e..51f4f92ae84a 100644 > > --- a/drivers/iio/proximity/as3935.c > > +++ b/drivers/iio/proximity/as3935.c > > @@ -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; > > > > 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 > return ret; > > > > > > > -- > > 2.30.2 > > > > >
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index d62766b6b39e..51f4f92ae84a 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -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;
`buf` is cast to a const char *, but `buf` is already a const char *, so the case is unnecessary. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> --- drivers/iio/proximity/as3935.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)