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: <1456846141.3098.155.camel@decadent.org.uk>
Date:	Tue, 01 Mar 2016 15:29:01 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Nicolas Dichtel <nicolas.dichtel@...nd.com>, davem@...emloft.net
Cc:	netdev@...r.kernel.org,
	Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
	Kan Liang <kan.liang@...el.com>
Subject: Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

On Tue, 2016-03-01 at 16:20 +0100, Nicolas Dichtel wrote:
> DIV_ROUND_UP and is defined in linux/kernel.h only for the kernel.
[...]

But what happens when another UAPI header wants to use DIV_ROUND_UP()?
 Do we duplicate the definition there as well?

It seems cleaner to do something like:

--- a/include/uapi/linux/kernel.h
+++ b/include/uapi/linux/kernel.h
+#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
-#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP

and then in include/uapi/linux/ethtool.h, replace DIV_ROUND_UP with
__KERNEL_DIV_ROUND_UP throughout.

Ben.

-- 
Ben Hutchings
If God had intended Man to program,
we'd have been born with serial I/O ports.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ