From: Joe Perches <joe@perches.com>
To: Nishant Malpani <nish.malpani25@gmail.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 11:33:48 -0700 [thread overview]
Message-ID: <ed459ac3c268d6287f70a0aa8ca682b022f27a8e.camel@perches.com> (raw)
In-Reply-To: <9aa90ffd-9574-d615-0bc0-f791e51b3be4@gmail.com>
On Sat, 2020-03-21 at 23:56 +0530, Nishant Malpani wrote:
> 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
> https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#error-pointers
next prev parent reply other threads:[~2020-03-21 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 10:07 Nishant Malpani
2020-03-21 11:05 ` Jonathan Cameron
2020-03-21 12:26 ` Joe Perches
2020-03-21 18:26 ` Nishant Malpani
2020-03-21 18:33 ` Joe Perches [this message]
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=ed459ac3c268d6287f70a0aa8ca682b022f27a8e.camel@perches.com \
--to=joe@perches.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nish.malpani25@gmail.com \
--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
all inboxes | Powered by JetHome®