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: <9a42d3d3-a142-4e4a-811b-0b3b931e798b@lunn.ch>
Date: Tue, 27 Jun 2023 16:50:58 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: Moritz Fischer <moritzf@...gle.com>, netdev@...r.kernel.org,
	pabeni@...hat.com, kuba@...nel.org, edumazet@...gle.com,
	davem@...emloft.net, bryan.whitehead@...rochip.com,
	UNGLinuxDriver@...rochip.com, mdf@...nel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH net v3] net: lan743x: Don't sleep in atomic context

> Side note would be that I don't see much value in iopoll.h's macros
> returning
> 
> 	(cond) ? 0 : -ETIMEDOUT; \
> 
> this could be just !!cond but given the count of the callsites...probably
> better to leave it as is.

The general pattern everywhere in linux is:

    err = foo(bar);
    if (err)
        return err;

We want functions to return meaningful error codes, otherwise the
caller needs to figure out an error code and return it. Having iopoll
return an error code means we have consistency. Otherwise i would
expect some developers to decide on EIO, ETIMEDOUT, EINVAL, maybe
ENXIO?

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ