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: <ZhAbMA-ezv4hwBGn@smile.fi.intel.com>
Date: Fri, 5 Apr 2024 18:39:28 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Sudeep Holla <sudeep.holla@....com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Peng Fan <peng.fan@....com>,
	"Peng Fan (OSS)" <peng.fan@....nxp.com>,
	"brgl@...ev.pl" <brgl@...ev.pl>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"cristian.marussi@....com" <cristian.marussi@....com>
Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP

On Fri, Apr 05, 2024 at 10:46:04AM +0100, Sudeep Holla wrote:
> On Fri, Apr 05, 2024 at 02:13:28AM +0000, Peng Fan wrote:
> > > On Thu, Apr 04, 2024 at 01:44:50PM +0200, Linus Walleij wrote:
> > > > On Mon, Apr 1, 2024 at 4:02 PM Peng Fan (OSS) <peng.fan@....nxp.com>
> > > wrote:

..

> > > > > +               if (ret == -EINVAL || ret == -ENOTSUPP || ret ==
> > > > > + -EOPNOTSUPP)
> > > >
> > > > TBH it's a bit odd to call an in-kernel API such as
> > > > pin_config_get_for_pin() and get -EOPNOTSUPP back. But it's not like I care
> > > a lot, so patch applied.
> > >
> > > Hmm... I would like actually to get this being consistent. The documentation
> > > explicitly says that in-kernel APIs uses Linux error code and not POSIX one.
> >
> > Would you please share me the documentation?
> 
> +1, I am interested in knowing more about this as I wasn't aware of this.

See my previous reply.

> > > This check opens a Pandora box.
> > >
> > > FWIW, it just like dozen or so drivers that needs to be fixed, I prefer to have
> > > them being moved to ENOTSUPP, rather this patch.
> >
> > I see many patches convert to use EOPNOTSUPP by checking git log.
> >
> > And checkpatch.pl reports warning for using ENOTSUPP.
> 
> Exactly, I do remember changing ENOTSUPP to EOPNOTSUPP based on checkpatch
> suggestion.

Sometimes suggestions can be wrong. Checkpatch is famous for false-positives as
it's a dumb tool, it can't know about everything.

> So either the checkpatch.pl or the document you are referring
> is inconsistent and needs fixing either way.

True.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ