nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl: export ndctl.h
@ 2018-04-04 22:02 Dan Williams
  2018-04-06 21:41 ` Verma, Vishal L
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Williams @ 2018-04-04 22:02 UTC (permalink / raw)
  To: linux-nvdimm

The ndctl project maintains a local version of the ndctl.h header file
published by the kernel. Given that the kernel header may be out of date
relative to the header used to build ndctl, provide the local version in
ndctl/ndctl.h alongside ndctl/libndctl.h so that consumers of the
library have access to the same definitions used to build the library.

Reported-by: Juston Li <juston.li@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/lib/Makefile.am         |    2 +-
 ndctl/ndctl.h                 |    2 ++
 test/ack-shutdown-count-set.c |    3 ---
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ndctl/lib/Makefile.am b/ndctl/lib/Makefile.am
index e3a12e7177e9..77970399bf00 100644
--- a/ndctl/lib/Makefile.am
+++ b/ndctl/lib/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.am.in
 %.pc: %.pc.in Makefile
 	$(SED_PROCESS)
 
-pkginclude_HEADERS = ../libndctl.h
+pkginclude_HEADERS = ../libndctl.h ../ndctl.h
 lib_LTLIBRARIES = libndctl.la
 
 libndctl_la_SOURCES =\
diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h
index ebd2a41cce46..c6aaa4c0981f 100644
--- a/ndctl/ndctl.h
+++ b/ndctl/ndctl.h
@@ -13,7 +13,9 @@
 #ifndef __NDCTL_H__
 #define __NDCTL_H__
 
+#ifndef ARRAY_SIZE
 #include <ccan/array_size/array_size.h>
+#endif
 #include <linux/types.h>
 #include <sys/user.h>
 #include <unistd.h>
diff --git a/test/ack-shutdown-count-set.c b/test/ack-shutdown-count-set.c
index ef38176442f1..6766c5f3b021 100644
--- a/test/ack-shutdown-count-set.c
+++ b/test/ack-shutdown-count-set.c
@@ -15,9 +15,6 @@
 
 #include <ccan/array_size/array_size.h>
 #include <ndctl/libndctl.h>
-#ifdef HAVE_NDCTL_H
-#include <linux/ndctl.h>
-#else
 #include <ndctl.h>
 #endif
 #include <test.h>

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [ndctl PATCH] ndctl: export ndctl.h
  2018-04-04 22:02 [ndctl PATCH] ndctl: export ndctl.h Dan Williams
@ 2018-04-06 21:41 ` Verma, Vishal L
  0 siblings, 0 replies; 2+ messages in thread
From: Verma, Vishal L @ 2018-04-06 21:41 UTC (permalink / raw)
  To: Williams, Dan J, linux-nvdimm

Resending, looks like the list rejected my reply because my client was
attaching s-mime signatures..

On Wed, 2018-04-04 at 15:02 -0700, Dan Williams wrote:
> The ndctl project maintains a local version of the ndctl.h header file
> published by the kernel. Given that the kernel header may be out of date
> relative to the header used to build ndctl, provide the local version in
> ndctl/ndctl.h alongside ndctl/libndctl.h so that consumers of the
> library have access to the same definitions used to build the library.
> 
> Reported-by: Juston Li <juston.li@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  ndctl/lib/Makefile.am         |    2 +-
>  ndctl/ndctl.h                 |    2 ++
>  test/ack-shutdown-count-set.c |    3 ---
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/ndctl/lib/Makefile.am b/ndctl/lib/Makefile.am
> index e3a12e7177e9..77970399bf00 100644
> --- a/ndctl/lib/Makefile.am
> +++ b/ndctl/lib/Makefile.am
> @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.am.in
>  %.pc: %.pc.in Makefile
>  	$(SED_PROCESS)
>  
> -pkginclude_HEADERS = ../libndctl.h
> +pkginclude_HEADERS = ../libndctl.h ../ndctl.h
>  lib_LTLIBRARIES = libndctl.la
>  
>  libndctl_la_SOURCES =\
> diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h
> index ebd2a41cce46..c6aaa4c0981f 100644
> --- a/ndctl/ndctl.h
> +++ b/ndctl/ndctl.h
> @@ -13,7 +13,9 @@
>  #ifndef __NDCTL_H__
>  #define __NDCTL_H__
>  
> +#ifndef ARRAY_SIZE
>  #include <ccan/array_size/array_size.h>
> +#endif
>  #include <linux/types.h>
>  #include <sys/user.h>
>  #include <unistd.h>
> diff --git a/test/ack-shutdown-count-set.c b/test/ack-shutdown-count-
> set.c
> index ef38176442f1..6766c5f3b021 100644
> --- a/test/ack-shutdown-count-set.c
> +++ b/test/ack-shutdown-count-set.c
> @@ -15,9 +15,6 @@
>  
>  #include <ccan/array_size/array_size.h>
>  #include <ndctl/libndctl.h>
> -#ifdef HAVE_NDCTL_H
> -#include <linux/ndctl.h>
> -#else
>  #include <ndctl.h>
>  #endif

This orphaned #endif needs to be removed too.

>  #include <test.h>
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2018-04-06 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04 22:02 [ndctl PATCH] ndctl: export ndctl.h Dan Williams
2018-04-06 21:41 ` Verma, Vishal L

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).