All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen, tools: console.h shouldn't require string.h by default
@ 2017-10-06 11:48 Wei Liu
  2017-10-06 12:39 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2017-10-06 11:48 UTC (permalink / raw)
  To: Xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, Jan Beulich, Bhupinder Thakur

Unilaterally making string.h a prerequisite for console.h is going to
break build for a lot of consumers of console.h.

Define a macro for the new flex ring. Consumers which want to use it
should define the macro.

Partially revert af8d9356417cb617b635c5ace782388ebfe86e3a.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Julien Grall <julien.grall@arm.com>
Cc: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/console/daemon/io.c       | 2 +-
 xen/arch/arm/vpl011.c           | 2 ++
 xen/include/Makefile            | 1 -
 xen/include/public/io/console.h | 6 +++---
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index afe162e9c2..e22009aa39 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -21,7 +21,6 @@
 
 #include "utils.h"
 #include "io.h"
-#include <string.h>
 #include <xenevtchn.h>
 #include <xengnttab.h>
 #include <xenstore.h>
@@ -30,6 +29,7 @@
 
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
 #include <poll.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 56d9cbe09e..f7ddccb42a 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -16,6 +16,8 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define XEN_WANT_FLEX_CONSOLE_RING 1
+
 #include <xen/errno.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
diff --git a/xen/include/Makefile b/xen/include/Makefile
index c90fdeee75..1299b1962f 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -98,7 +98,6 @@ PUBLIC_C99_HEADERS := public/io/9pfs.h public/io/pvcalls.h
 PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS))
 
 public/io/9pfs.h-prereq := string
-public/io/console.h-prereq := string
 public/io/pvcalls.h-prereq := string
 
 headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h
index 0f0711fbdb..cdbdcd273b 100644
--- a/xen/include/public/io/console.h
+++ b/xen/include/public/io/console.h
@@ -27,8 +27,6 @@
 #ifndef __XEN_PUBLIC_IO_CONSOLE_H__
 #define __XEN_PUBLIC_IO_CONSOLE_H__
 
-#include "ring.h"
-
 typedef uint32_t XENCONS_RING_IDX;
 
 #define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
@@ -40,7 +38,9 @@ struct xencons_interface {
     XENCONS_RING_IDX out_cons, out_prod;
 };
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
+    defined(XEN_WANT_FLEX_CONSOLE_RING)
+#include "ring.h"
 DEFINE_XEN_FLEX_RING(xencons);
 #endif
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen, tools: console.h shouldn't require string.h by default
  2017-10-06 11:48 [PATCH] xen, tools: console.h shouldn't require string.h by default Wei Liu
@ 2017-10-06 12:39 ` Jan Beulich
  2017-10-06 14:40   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2017-10-06 12:39 UTC (permalink / raw)
  To: Wei Liu
  Cc: Stefano Stabellini, KonradRzeszutek Wilk, George Dunlap,
	Andrew Cooper, IanJackson, Tim Deegan, Julien Grall,
	Bhupinder Thakur, Xen-devel

>>> On 06.10.17 at 13:48, <wei.liu2@citrix.com> wrote:
> @@ -40,7 +38,9 @@ struct xencons_interface {
>      XENCONS_RING_IDX out_cons, out_prod;
>  };
>  
> -#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
> +    defined(XEN_WANT_FLEX_CONSOLE_RING)
> +#include "ring.h"
>  DEFINE_XEN_FLEX_RING(xencons);
>  #endif

Wouldn't it be reasonable to drop the GNU and ANSI checks?
Someone not using a suitable compiler simply shouldn't define
the macro.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] xen, tools: console.h shouldn't require string.h by default
  2017-10-06 12:39 ` Jan Beulich
@ 2017-10-06 14:40   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2017-10-06 14:40 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, KonradRzeszutek Wilk, George Dunlap,
	Andrew Cooper, IanJackson, Tim Deegan, Julien Grall,
	Bhupinder Thakur, Xen-devel

On Fri, Oct 06, 2017 at 06:39:22AM -0600, Jan Beulich wrote:
> >>> On 06.10.17 at 13:48, <wei.liu2@citrix.com> wrote:
> > @@ -40,7 +38,9 @@ struct xencons_interface {
> >      XENCONS_RING_IDX out_cons, out_prod;
> >  };
> >  
> > -#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> > +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
> > +    defined(XEN_WANT_FLEX_CONSOLE_RING)
> > +#include "ring.h"
> >  DEFINE_XEN_FLEX_RING(xencons);
> >  #endif
> 
> Wouldn't it be reasonable to drop the GNU and ANSI checks?
> Someone not using a suitable compiler simply shouldn't define
> the macro.

That would be fine by me.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-10-06 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 11:48 [PATCH] xen, tools: console.h shouldn't require string.h by default Wei Liu
2017-10-06 12:39 ` Jan Beulich
2017-10-06 14:40   ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.