Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread Ben Hutchings
On Tue, 2016-03-01 at 14:48 -0500, David Miller wrote: > From: Ben Hutchings > Date: Tue, 01 Mar 2016 17:14:06 + > > > On Tue, 2016-03-01 at 11:42 -0500, David Miller wrote: > >> From: Nicolas Dichtel > >> Date: Tue,  1 Mar 2016 16:20:41 +0100 > >>  > >> > DIV_ROUND_UP and is defined in linu

Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread David Miller
From: Ben Hutchings Date: Tue, 01 Mar 2016 17:14:06 + > On Tue, 2016-03-01 at 11:42 -0500, David Miller wrote: >> From: Nicolas Dichtel >> Date: Tue,  1 Mar 2016 16:20:41 +0100 >> >> > DIV_ROUND_UP and is defined in linux/kernel.h only for the kernel. INT_MAX >> > needs limits.h in userland

Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread Ben Hutchings
On Tue, 2016-03-01 at 11:42 -0500, David Miller wrote: > From: Nicolas Dichtel > Date: Tue,  1 Mar 2016 16:20:41 +0100 > > > DIV_ROUND_UP and is defined in linux/kernel.h only for the kernel. INT_MAX > > needs limits.h in userland. > > It is wrong to provide a definition of this in the user visi

Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread David Miller
From: Nicolas Dichtel Date: Tue, 1 Mar 2016 16:20:41 +0100 > DIV_ROUND_UP and is defined in linux/kernel.h only for the kernel. INT_MAX > needs limits.h in userland. It is wrong to provide a definition of this in the user visible global namespace.

Re: [PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread Ben Hutchings
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/

[PATCH net-next] ethtool.h: define DIV_ROUND_UP for userland

2016-03-01 Thread Nicolas Dichtel
DIV_ROUND_UP and is defined in linux/kernel.h only for the kernel. INT_MAX needs limits.h in userland. When ethtool.h is included by a userland app, we got the following errors: include/linux/ethtool.h:1218:8: error: variably modified 'queue_mask' at file scope __u32 queue_mask[DIV_ROUND_UP(MA