Message ID | 20200313104955.30423-1-andriy.shevchenko@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/8] iio: light: st_uvis25: Drop unneeded casting when print error code | expand |
On Fri, 13 Mar 2020 12:49:48 +0200 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > Explicit casting in printf() usually shows that something is not okay. > Here, we really don't need it by providing correct specifier. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Applied to the togreg branch of iio.git. thanks, Jonathan > --- > v2: no change > drivers/iio/light/st_uvis25_i2c.c | 4 ++-- > drivers/iio/light/st_uvis25_spi.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c > index 4889bbeb0c73..400724069d19 100644 > --- a/drivers/iio/light/st_uvis25_i2c.c > +++ b/drivers/iio/light/st_uvis25_i2c.c > @@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client, > > regmap = devm_regmap_init_i2c(client, &st_uvis25_i2c_regmap_config); > if (IS_ERR(regmap)) { > - dev_err(&client->dev, "Failed to register i2c regmap %d\n", > - (int)PTR_ERR(regmap)); > + dev_err(&client->dev, "Failed to register i2c regmap %ld\n", > + PTR_ERR(regmap)); > return PTR_ERR(regmap); > } > > diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c > index a9ceae4f58b3..cd3761a3ee3f 100644 > --- a/drivers/iio/light/st_uvis25_spi.c > +++ b/drivers/iio/light/st_uvis25_spi.c > @@ -31,8 +31,8 @@ static int st_uvis25_spi_probe(struct spi_device *spi) > > regmap = devm_regmap_init_spi(spi, &st_uvis25_spi_regmap_config); > if (IS_ERR(regmap)) { > - dev_err(&spi->dev, "Failed to register spi regmap %d\n", > - (int)PTR_ERR(regmap)); > + dev_err(&spi->dev, "Failed to register spi regmap %ld\n", > + PTR_ERR(regmap)); > return PTR_ERR(regmap); > } >
On Sun, 15 Mar 2020 12:26:09 +0000 Jonathan Cameron <jic23@kernel.org> wrote: > On Fri, 13 Mar 2020 12:49:48 +0200 > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > Explicit casting in printf() usually shows that something is not okay. > > Here, we really don't need it by providing correct specifier. > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Applied to the togreg branch of iio.git. > +CC Rohit and Nishant On that note. Cleaning other cases of this out sounds like good and useful work for those who have asked recently. git grep -A 4 dev_err -- drivers/iio/ | grep \(int\) Gives a few likely places to look. If not I'll sweep up the lot in a week or so as clearly been some cut and paste going on here and I'd rather it didn't happen again. Thanks, Jonathan > thanks, > > Jonathan > > > --- > > v2: no change > > drivers/iio/light/st_uvis25_i2c.c | 4 ++-- > > drivers/iio/light/st_uvis25_spi.c | 4 ++-- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c > > index 4889bbeb0c73..400724069d19 100644 > > --- a/drivers/iio/light/st_uvis25_i2c.c > > +++ b/drivers/iio/light/st_uvis25_i2c.c > > @@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client, > > > > regmap = devm_regmap_init_i2c(client, &st_uvis25_i2c_regmap_config); > > if (IS_ERR(regmap)) { > > - dev_err(&client->dev, "Failed to register i2c regmap %d\n", > > - (int)PTR_ERR(regmap)); > > + dev_err(&client->dev, "Failed to register i2c regmap %ld\n", > > + PTR_ERR(regmap)); > > return PTR_ERR(regmap); > > } > > > > diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c > > index a9ceae4f58b3..cd3761a3ee3f 100644 > > --- a/drivers/iio/light/st_uvis25_spi.c > > +++ b/drivers/iio/light/st_uvis25_spi.c > > @@ -31,8 +31,8 @@ static int st_uvis25_spi_probe(struct spi_device *spi) > > > > regmap = devm_regmap_init_spi(spi, &st_uvis25_spi_regmap_config); > > if (IS_ERR(regmap)) { > > - dev_err(&spi->dev, "Failed to register spi regmap %d\n", > > - (int)PTR_ERR(regmap)); > > + dev_err(&spi->dev, "Failed to register spi regmap %ld\n", > > + PTR_ERR(regmap)); > > return PTR_ERR(regmap); > > } > > >
diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c index 4889bbeb0c73..400724069d19 100644 --- a/drivers/iio/light/st_uvis25_i2c.c +++ b/drivers/iio/light/st_uvis25_i2c.c @@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client, regmap = devm_regmap_init_i2c(client, &st_uvis25_i2c_regmap_config); if (IS_ERR(regmap)) { - dev_err(&client->dev, "Failed to register i2c regmap %d\n", - (int)PTR_ERR(regmap)); + dev_err(&client->dev, "Failed to register i2c regmap %ld\n", + PTR_ERR(regmap)); return PTR_ERR(regmap); } diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c index a9ceae4f58b3..cd3761a3ee3f 100644 --- a/drivers/iio/light/st_uvis25_spi.c +++ b/drivers/iio/light/st_uvis25_spi.c @@ -31,8 +31,8 @@ static int st_uvis25_spi_probe(struct spi_device *spi) regmap = devm_regmap_init_spi(spi, &st_uvis25_spi_regmap_config); if (IS_ERR(regmap)) { - dev_err(&spi->dev, "Failed to register spi regmap %d\n", - (int)PTR_ERR(regmap)); + dev_err(&spi->dev, "Failed to register spi regmap %ld\n", + PTR_ERR(regmap)); return PTR_ERR(regmap); }
Explicit casting in printf() usually shows that something is not okay. Here, we really don't need it by providing correct specifier. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- v2: no change drivers/iio/light/st_uvis25_i2c.c | 4 ++-- drivers/iio/light/st_uvis25_spi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)