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]
Date:	Sat, 19 Jul 2014 11:10:25 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Sam Ravnborg <sam@...nborg.org>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Thierry Reding <thierry.reding@...il.com>,
	linux-arch@...r.kernel.org, Russell King <linux@....linux.org.uk>,
	Catalin Marinas <catalin.marinas@....com>,
	Stephen Boyd <sboyd@...eaurora.org>,
	linux-kernel@...r.kernel.org, Will Deacon <will.deacon@....com>
Subject: Re: [PATCH v3 1/3] asm-generic/io.h: Implement generic {read,write}s*()

On Saturday 19 July 2014 10:53:38 Sam Ravnborg wrote:
> 
> Then there are the other type where one IO access function
> may re-use the implementation of another IO access function:
> 
>     #ifndef writeb
>     #define writeb __raw_writeb
>     #endif
> 
> This could have been implmented like this:
> 
> #ifndef writeb
> #define writeb writeb
> static inline void writeb(u8 b, volatile void __iomem *addr)
> {
>    __raw_writeb(b, addr);
> }
> #endif
> 
> In this way the prototype of the function is easy to understand and
> we avoid the macro tricks were we blindly replace one function name,
> with another function name.
> And we also use the same pattarn all over for the various functions.
> 
> Concerning the efficiency the compiler should be smart enough to
> do the same independent on the two implmentations.

I really don't have a strong opinion on those, as you say one is a
little shorter and the other is a little more readable, so my
preference in a case like this is to leave it up to the person
who last touches the code and let them decide.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ