Message ID | 20211209161730.396848-2-lars@metafoo.de (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/3] iio: as3935: Remove unnecessary cast | expand |
On 12/9/21 11:15 PM, Andy Shevchenko 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/adc/ina2xx-adc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c >> index 352f27657238..08f243f5b92b 100644 >> --- a/drivers/iio/adc/ina2xx-adc.c >> +++ b/drivers/iio/adc/ina2xx-adc.c >> @@ -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); > > > While at it, please switch to kstrtobool(). This seems unrelated to this patch. And while worthwhile doing it should be in its own series.
diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 352f27657238..08f243f5b92b 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -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;
`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/adc/ina2xx-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)