Re: [PATCH] drivers: iio: Drop unnecessary explicit casting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 21 Mar 2020 05:26:52 -0700
Joe Perches <joe@xxxxxxxxxxx> wrote:

> On Wed, 2020-03-18 at 15:37 +0530, Nishant Malpani wrote:
> > Provide correct specifiers while printing error logs to discard the use
> > of unnecessary explicit casting.  
> []
> > diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c  
> []
> > @@ -21,8 +21,8 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c,
> >  
> >  	regmap = devm_regmap_init_i2c(i2c, &config);
> >  	if (IS_ERR(regmap)) {
> > -		dev_err(&i2c->dev, "Failed to register i2c regmap %d\n",
> > -			(int)PTR_ERR(regmap));
> > +		dev_err(&i2c->dev, "Failed to register i2c regmap %ld\n",
> > +			PTR_ERR(regmap));  
> 
> Another option would be to use %pe to print the error identifier
> and not the error number
> 
> etc...
> 
> 

Indeed that would be even better.  I'd missed that one being added
to the magic of prink :)

Jonathan



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux