lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed459ac3c268d6287f70a0aa8ca682b022f27a8e.camel@perches.com>
Date:   Sat, 21 Mar 2020 11:33:48 -0700
From:   Joe Perches <joe@...ches.com>
To:     Nishant Malpani <nish.malpani25@...il.com>, jic23@...nel.org
Cc:     knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: iio: Drop unnecessary explicit casting

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ