diff mbox series

[v2,8/8] iio: humidity: hts221: Drop unneeded casting when print error code

Message ID 20200313104955.30423-8-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

Commit Message

Andy Shevchenko March 13, 2020, 10:49 a.m. UTC
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: new patch
 drivers/iio/humidity/hts221_i2c.c | 4 ++--
 drivers/iio/humidity/hts221_spi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Jonathan Cameron March 15, 2020, 12:44 p.m. UTC | #1
On Fri, 13 Mar 2020 12:49:55 +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.  These may sit in my local tree for a few days as I have
an existing pull request out and will want to fast-forward the
tree after that.

Thanks,

Jonathan

> ---
> v2: new patch
>  drivers/iio/humidity/hts221_i2c.c | 4 ++--
>  drivers/iio/humidity/hts221_spi.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/humidity/hts221_i2c.c b/drivers/iio/humidity/hts221_i2c.c
> index 1398794e4bc7..cab39c4756f8 100644
> --- a/drivers/iio/humidity/hts221_i2c.c
> +++ b/drivers/iio/humidity/hts221_i2c.c
> @@ -32,8 +32,8 @@ static int hts221_i2c_probe(struct i2c_client *client,
>  
>  	regmap = devm_regmap_init_i2c(client, &hts221_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/humidity/hts221_spi.c b/drivers/iio/humidity/hts221_spi.c
> index ba1115489c2c..729e86e433b1 100644
> --- a/drivers/iio/humidity/hts221_spi.c
> +++ b/drivers/iio/humidity/hts221_spi.c
> @@ -31,8 +31,8 @@ static int hts221_spi_probe(struct spi_device *spi)
>  
>  	regmap = devm_regmap_init_spi(spi, &hts221_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);
>  	}
>
Andy Shevchenko March 16, 2020, 8:27 a.m. UTC | #2
On Sun, Mar 15, 2020 at 12:44:51PM +0000, Jonathan Cameron wrote:
> On Fri, 13 Mar 2020 12:49:55 +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.  These may sit in my local tree for a few days as I have
> an existing pull request out and will want to fast-forward the
> tree after that.

It's fine, thank you, Jonathan.
diff mbox series

Patch

diff --git a/drivers/iio/humidity/hts221_i2c.c b/drivers/iio/humidity/hts221_i2c.c
index 1398794e4bc7..cab39c4756f8 100644
--- a/drivers/iio/humidity/hts221_i2c.c
+++ b/drivers/iio/humidity/hts221_i2c.c
@@ -32,8 +32,8 @@  static int hts221_i2c_probe(struct i2c_client *client,
 
 	regmap = devm_regmap_init_i2c(client, &hts221_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/humidity/hts221_spi.c b/drivers/iio/humidity/hts221_spi.c
index ba1115489c2c..729e86e433b1 100644
--- a/drivers/iio/humidity/hts221_spi.c
+++ b/drivers/iio/humidity/hts221_spi.c
@@ -31,8 +31,8 @@  static int hts221_spi_probe(struct spi_device *spi)
 
 	regmap = devm_regmap_init_spi(spi, &hts221_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);
 	}