From: Jonathan Cameron <jic23@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: Nishant Malpani <nish.malpani25@gmail.com>,
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 18:47:51 +0000 [thread overview]
Message-ID: <20200321184751.717f1d4d@archlinux> (raw)
In-Reply-To: <a7778635620163cb6185192819a56ed44d76d4b0.camel@perches.com>
On Sat, 21 Mar 2020 05:26:52 -0700
Joe Perches <joe@perches.com> 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
prev parent reply other threads:[~2020-03-21 18:47 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
2020-03-21 18:33 ` Joe Perches
2020-03-21 18:47 ` Jonathan Cameron [this message]
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=20200321184751.717f1d4d@archlinux \
--to=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=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