linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libnvdimm: add missing macros
@ 2016-07-08 16:29 Eric Engestrom
  2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eric Engestrom @ 2016-07-08 16:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric Engestrom, Eric Engestrom, Dan Williams, linux-nvdimm

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---

This can't compile without these macros… Is this header really used by anyone?
Should it be removed, to avoid bit-rot?

---
 include/uapi/linux/ndctl.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 309915f..50ae5e7 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -15,6 +15,14 @@
 
 #include <linux/types.h>
 
+#ifdef __GNUC__
+#define __packed __attribute__((packed))
+#else
+#define __packed
+#endif
+
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
+
 struct nd_cmd_smart {
 	__u32 status;
 	__u8 data[128];
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] netfilter: add missing macro
  2016-07-08 16:29 [PATCH 1/2] libnvdimm: add missing macros Eric Engestrom
@ 2016-07-08 16:29 ` Eric Engestrom
  2016-07-08 17:00   ` kbuild test robot
  2016-07-11 10:41   ` Pablo Neira Ayuso
  2016-07-08 17:25 ` [PATCH 1/2] libnvdimm: add missing macros kbuild test robot
  2016-07-08 19:32 ` Dan Williams
  2 siblings, 2 replies; 6+ messages in thread
From: Eric Engestrom @ 2016-07-08 16:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric Engestrom, Eric Engestrom, Pablo Neira Ayuso,
	Patrick McHardy, Jozsef Kadlecsik, netfilter-devel, coreteam

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---

This can't compile without this macro… Is this header really used by anyone?
Should it be removed, to avoid bit-rot?

---
 include/uapi/linux/netfilter/xt_sctp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/netfilter/xt_sctp.h b/include/uapi/linux/netfilter/xt_sctp.h
index 58ffcfb..e4410db 100644
--- a/include/uapi/linux/netfilter/xt_sctp.h
+++ b/include/uapi/linux/netfilter/xt_sctp.h
@@ -3,6 +3,8 @@
 
 #include <linux/types.h>
 
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
+
 #define XT_SCTP_SRC_PORTS	        0x01
 #define XT_SCTP_DEST_PORTS	        0x02
 #define XT_SCTP_CHUNK_TYPES		0x04
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] netfilter: add missing macro
  2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
@ 2016-07-08 17:00   ` kbuild test robot
  2016-07-11 10:41   ` Pablo Neira Ayuso
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2016-07-08 17:00 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: kbuild-all, linux-kernel, Eric Engestrom, Eric Engestrom,
	Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, coreteam

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

Hi,

[auto build test WARNING on linux-nvdimm/libnvdimm-for-next]
[also build test WARNING on v4.7-rc6 next-20160708]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Eric-Engestrom/libnvdimm-add-missing-macros/20160709-003310
base:   https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git libnvdimm-for-next
config: m68k-sun3_defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

   In file included from net/netfilter/xt_sctp.c:10:0:
>> include/uapi/linux/netfilter/xt_sctp.h:6:0: warning: "ARRAY_SIZE" redefined
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
    ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from net/netfilter/xt_sctp.c:2:
   include/linux/kernel.h:54:0: note: this is the location of the previous definition
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
    ^

vim +/ARRAY_SIZE +6 include/uapi/linux/netfilter/xt_sctp.h

     1	#ifndef _XT_SCTP_H_
     2	#define _XT_SCTP_H_
     3	
     4	#include <linux/types.h>
     5	
   > 6	#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
     7	
     8	#define XT_SCTP_SRC_PORTS	        0x01
     9	#define XT_SCTP_DEST_PORTS	        0x02
    10	#define XT_SCTP_CHUNK_TYPES		0x04
    11	
    12	#define XT_SCTP_VALID_FLAGS		0x07
    13	
    14	struct xt_sctp_flag_info {

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 11731 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] libnvdimm: add missing macros
  2016-07-08 16:29 [PATCH 1/2] libnvdimm: add missing macros Eric Engestrom
  2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
@ 2016-07-08 17:25 ` kbuild test robot
  2016-07-08 19:32 ` Dan Williams
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2016-07-08 17:25 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: kbuild-all, linux-kernel, Eric Engestrom, Eric Engestrom,
	Dan Williams, linux-nvdimm

[-- Attachment #1: Type: text/plain, Size: 2170 bytes --]

Hi,

[auto build test WARNING on linux-nvdimm/libnvdimm-for-next]
[also build test WARNING on v4.7-rc6 next-20160708]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Eric-Engestrom/libnvdimm-add-missing-macros/20160709-003310
base:   https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git libnvdimm-for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from drivers/dax/../nvdimm/nd.h:20:0,
                    from drivers/dax/pmem.c:18:
>> include/uapi/linux/ndctl.h:24:0: warning: "ARRAY_SIZE" redefined
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
    
   In file included from include/linux/percpu-refcount.h:49:0,
                    from drivers/dax/pmem.c:13:
   include/linux/kernel.h:54:0: note: this is the location of the previous definition
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
    

vim +/ARRAY_SIZE +24 include/uapi/linux/ndctl.h

     8	 * This program is distributed in the hope it will be useful, but WITHOUT ANY
     9	 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    10	 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
    11	 * more details.
    12	 */
    13	#ifndef __NDCTL_H__
    14	#define __NDCTL_H__
    15	
    16	#include <linux/types.h>
    17	
    18	#ifdef __GNUC__
    19	#define __packed __attribute__((packed))
    20	#else
    21	#define __packed
    22	#endif
    23	
  > 24	#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
    25	
    26	struct nd_cmd_smart {
    27		__u32 status;
    28		__u8 data[128];
    29	} __packed;
    30	
    31	#define ND_SMART_HEALTH_VALID	(1 << 0)
    32	#define ND_SMART_TEMP_VALID 	(1 << 1)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 54806 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] libnvdimm: add missing macros
  2016-07-08 16:29 [PATCH 1/2] libnvdimm: add missing macros Eric Engestrom
  2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
  2016-07-08 17:25 ` [PATCH 1/2] libnvdimm: add missing macros kbuild test robot
@ 2016-07-08 19:32 ` Dan Williams
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Williams @ 2016-07-08 19:32 UTC (permalink / raw)
  To: Eric Engestrom; +Cc: linux-kernel, Eric Engestrom, linux-nvdimm@lists.01.org

On Fri, Jul 8, 2016 at 9:29 AM, Eric Engestrom
<eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>
> This can't compile without these macros… Is this header really used by anyone?
> Should it be removed, to avoid bit-rot?

It's used by ndctl [1].  You can't use it directly in userspace, you
need the kernel's "make headers_install" to strip out the
kernel-specific macros.

[1]: https://github.com/pmem/ndctl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] netfilter: add missing macro
  2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
  2016-07-08 17:00   ` kbuild test robot
@ 2016-07-11 10:41   ` Pablo Neira Ayuso
  1 sibling, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2016-07-11 10:41 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: linux-kernel, Eric Engestrom, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, coreteam

On Fri, Jul 08, 2016 at 05:29:11PM +0100, Eric Engestrom wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
> 
> This can't compile without this macro… Is this header really used by anyone?
> Should it be removed, to avoid bit-rot?

Probably better to define something like:

#define SCTP_BITMAP_LEN         (256 / sizeof (u_int32_t))

and use it consistently all around the code, so we can get rid of
these ARRAY_SIZE() from the uapi header.

> ---
>  include/uapi/linux/netfilter/xt_sctp.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/uapi/linux/netfilter/xt_sctp.h b/include/uapi/linux/netfilter/xt_sctp.h
> index 58ffcfb..e4410db 100644
> --- a/include/uapi/linux/netfilter/xt_sctp.h
> +++ b/include/uapi/linux/netfilter/xt_sctp.h
> @@ -3,6 +3,8 @@
>  
>  #include <linux/types.h>
>  
> +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0])
> +
>  #define XT_SCTP_SRC_PORTS	        0x01
>  #define XT_SCTP_DEST_PORTS	        0x02
>  #define XT_SCTP_CHUNK_TYPES		0x04
> -- 
> 2.9.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-11 10:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 16:29 [PATCH 1/2] libnvdimm: add missing macros Eric Engestrom
2016-07-08 16:29 ` [PATCH 2/2] netfilter: add missing macro Eric Engestrom
2016-07-08 17:00   ` kbuild test robot
2016-07-11 10:41   ` Pablo Neira Ayuso
2016-07-08 17:25 ` [PATCH 1/2] libnvdimm: add missing macros kbuild test robot
2016-07-08 19:32 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).