public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishant Malpani <nish.malpani25@gmail.com>
To: Joe Perches <joe@perches.com>, jic23@kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: iio: Drop unnecessary explicit casting
Date: Sat, 21 Mar 2020 23:56:33 +0530	[thread overview]
Message-ID: <9aa90ffd-9574-d615-0bc0-f791e51b3be4@gmail.com> (raw)
In-Reply-To: <a7778635620163cb6185192819a56ed44d76d4b0.camel@perches.com>

On 21/03/20 5:56 pm, Joe Perches 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
> 
By 'error identifier' you mean the symbolic error name (as described in 
docs [1]), right? Yes, to me, it makes sense too, as it would be more 
"readable" during debugging. Jonathan, if you agree, do I send a 
patchset replacing with %pe specifier for all the drivers in consideration?

With regards,
Nishant Malpani

[1] 
https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#error-pointers

> etc...
> 
> 

  reply	other threads:[~2020-03-21 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 10:07 [PATCH] drivers: iio: Drop unnecessary explicit casting Nishant Malpani
2020-03-21 11:05 ` Jonathan Cameron
2020-03-21 12:26 ` Joe Perches
2020-03-21 18:26   ` Nishant Malpani [this message]
2020-03-21 18:33     ` Joe Perches
2020-03-21 18:47   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aa90ffd-9574-d615-0bc0-f791e51b3be4@gmail.com \
    --to=nish.malpani25@gmail.com \
    --cc=jic23@kernel.org \
    --cc=joe@perches.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox