Remove leading underscores from Xen defines
PATCH 2/2 Remove leading underscores from Xen defines
Identifiers with leading underscores followed by capital letters or underscores are reserved for C standards.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/369
--- include/hw/xen/interface/grant_table.h | 4 ++-- include/hw/xen/interface/io/blkif.h | 4 ++-- include/hw/xen/interface/io/console.h | 4 ++-- include/hw/xen/interface/io/fbif.h | 4 ++-- include/hw/xen/interface/io/kbdif.h | 4 ++-- include/hw/xen/interface/io/netif.h | 4 ++-- include/hw/xen/interface/io/protocols.h | 4 ++-- include/hw/xen/interface/io/ring.h | 4 ++-- include/hw/xen/interface/io/usbif.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-)
include/hw/xen/interface/grant_table.h +2 -2
@@ -25,8 +25,8 @@* Copyright (c) 2004, K A Fraser */ -#ifndef __XEN_PUBLIC_GRANT_TABLE_H__ -#define __XEN_PUBLIC_GRANT_TABLE_H__ +#ifndef XEN_PUBLIC_GRANT_TABLE_H +#define XEN_PUBLIC_GRANT_TABLE_H /* * Reference to a grant entry in a specified domain's grant table.
include/hw/xen/interface/io/blkif.h +2 -2
@@ -25,8 +25,8 @@* Copyright (c) 2012, Spectra Logic Corporation */ -#ifndef __XEN_PUBLIC_IO_BLKIF_H__ -#define __XEN_PUBLIC_IO_BLKIF_H__ +#ifndef XEN_PUBLIC_IO_BLKIF_H +#define XEN_PUBLIC_IO_BLKIF_H #include "ring.h" #include "../grant_table.h"
include/hw/xen/interface/io/console.h +2 -2
@@ -24,8 +24,8 @@* Copyright (c) 2005, Keir Fraser */ -#ifndef __XEN_PUBLIC_IO_CONSOLE_H__ -#define __XEN_PUBLIC_IO_CONSOLE_H__ +#ifndef XEN_PUBLIC_IO_CONSOLE_H +#define XEN_PUBLIC_IO_CONSOLE_H typedef uint32_t XENCONS_RING_IDX ;
include/hw/xen/interface/io/fbif.h +2 -2
@@ -23,8 +23,8 @@* Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <[email protected]> */ -#ifndef __XEN_PUBLIC_IO_FBIF_H__ -#define __XEN_PUBLIC_IO_FBIF_H__ +#ifndef XEN_PUBLIC_IO_FBIF_H +#define XEN_PUBLIC_IO_FBIF_H /* Out events (frontend -> backend) */
include/hw/xen/interface/io/kbdif.h +2 -2
@@ -23,8 +23,8 @@* Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <[email protected]> */ -#ifndef __XEN_PUBLIC_IO_KBDIF_H__ -#define __XEN_PUBLIC_IO_KBDIF_H__ +#ifndef XEN_PUBLIC_IO_KBDIF_H +#define XEN_PUBLIC_IO_KBDIF_H /* *****************************************************************************
include/hw/xen/interface/io/netif.h +2 -2
@@ -24,8 +24,8 @@* Copyright (c) 2003-2004, Keir Fraser */ -#ifndef __XEN_PUBLIC_IO_NETIF_H__ -#define __XEN_PUBLIC_IO_NETIF_H__ +#ifndef XEN_PUBLIC_IO_NETIF_H +#define XEN_PUBLIC_IO_NETIF_H #include "ring.h" #include "../grant_table.h"
include/hw/xen/interface/io/protocols.h +2 -2
@@ -22,8 +22,8 @@* Copyright (c) 2008, Keir Fraser */ -#ifndef __XEN_PROTOCOLS_H__ -#define __XEN_PROTOCOLS_H__ +#ifndef XEN_PROTOCOLS_H +#define XEN_PROTOCOLS_H #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi"#define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi"
include/hw/xen/interface/io/ring.h +2 -2
@@ -24,8 +24,8 @@* Tim Deegan and Andrew Warfield November 2004. */ -#ifndef __XEN_PUBLIC_IO_RING_H__ -#define __XEN_PUBLIC_IO_RING_H__ +#ifndef XEN_PUBLIC_IO_RING_H +#define XEN_PUBLIC_IO_RING_H /* * When #include'ing this header, you need to provide the following
include/hw/xen/interface/io/usbif.h +2 -2
@@ -25,8 +25,8 @@* DEALINGS IN THE SOFTWARE. */ -#ifndef __XEN_PUBLIC_IO_USBIF_H__ -#define __XEN_PUBLIC_IO_USBIF_H__ +#ifndef XEN_PUBLIC_IO_USBIF_H +#define XEN_PUBLIC_IO_USBIF_H #include "ring.h" #include "../grant_table.h"
Signature · 1 line
2.25.1
Quoted 144 lines · Ahmed Abouzied
Identifiers with leading underscores followed by capital letters or underscores are reserved for C standards.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/369
Signed-off-by Ahmed Abouzied <[email protected]>--- include/hw/xen/interface/grant_table.h | 4 ++-- include/hw/xen/interface/io/blkif.h | 4 ++-- include/hw/xen/interface/io/console.h | 4 ++-- include/hw/xen/interface/io/fbif.h | 4 ++-- include/hw/xen/interface/io/kbdif.h | 4 ++-- include/hw/xen/interface/io/netif.h | 4 ++-- include/hw/xen/interface/io/protocols.h | 4 ++-- include/hw/xen/interface/io/ring.h | 4 ++-- include/hw/xen/interface/io/usbif.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-)include/hw/xen/interface/grant_table.h +2
-2@@ -25,8 +25,8 @@* Copyright (c) 2004, K A Fraser */ -#ifndef __XEN_PUBLIC_GRANT_TABLE_H__ -#define __XEN_PUBLIC_GRANT_TABLE_H__ +#ifndef XEN_PUBLIC_GRANT_TABLE_H +#define XEN_PUBLIC_GRANT_TABLE_H /* * Reference to a grant entry in a specified domain's grant table. include/hw/xen/interface/io/blkif.h +2
-2@@ -25,8 +25,8 @@* Copyright (c) 2012, Spectra Logic Corporation */ -#ifndef __XEN_PUBLIC_IO_BLKIF_H__ -#define __XEN_PUBLIC_IO_BLKIF_H__ +#ifndef XEN_PUBLIC_IO_BLKIF_H +#define XEN_PUBLIC_IO_BLKIF_H #include "ring.h" #include "../grant_table.h" include/hw/xen/interface/io/console.h +2
-2@@ -24,8 +24,8 @@* Copyright (c) 2005, Keir Fraser */ -#ifndef __XEN_PUBLIC_IO_CONSOLE_H__ -#define __XEN_PUBLIC_IO_CONSOLE_H__ +#ifndef XEN_PUBLIC_IO_CONSOLE_H +#define XEN_PUBLIC_IO_CONSOLE_H typedef uint32_t XENCONS_RING_IDX ;include/hw/xen/interface/io/fbif.h +2
-2@@ -23,8 +23,8 @@* Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <[email protected]> */ -#ifndef __XEN_PUBLIC_IO_FBIF_H__ -#define __XEN_PUBLIC_IO_FBIF_H__ +#ifndef XEN_PUBLIC_IO_FBIF_H +#define XEN_PUBLIC_IO_FBIF_H /* Out events (frontend -> backend) */ include/hw/xen/interface/io/kbdif.h +2
-2@@ -23,8 +23,8 @@* Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <[email protected]> */ -#ifndef __XEN_PUBLIC_IO_KBDIF_H__ -#define __XEN_PUBLIC_IO_KBDIF_H__ +#ifndef XEN_PUBLIC_IO_KBDIF_H +#define XEN_PUBLIC_IO_KBDIF_H /* ***************************************************************************** include/hw/xen/interface/io/netif.h +2
-2@@ -24,8 +24,8 @@* Copyright (c) 2003-2004, Keir Fraser */ -#ifndef __XEN_PUBLIC_IO_NETIF_H__ -#define __XEN_PUBLIC_IO_NETIF_H__ +#ifndef XEN_PUBLIC_IO_NETIF_H +#define XEN_PUBLIC_IO_NETIF_H #include "ring.h" #include "../grant_table.h" include/hw/xen/interface/io/protocols.h +2
-2@@ -22,8 +22,8 @@* Copyright (c) 2008, Keir Fraser */ -#ifndef __XEN_PROTOCOLS_H__ -#define __XEN_PROTOCOLS_H__ +#ifndef XEN_PROTOCOLS_H +#define XEN_PROTOCOLS_H #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi"#define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi"include/hw/xen/interface/io/ring.h +2
-2@@ -24,8 +24,8 @@* Tim Deegan and Andrew Warfield November 2004. */ -#ifndef __XEN_PUBLIC_IO_RING_H__ -#define __XEN_PUBLIC_IO_RING_H__ +#ifndef XEN_PUBLIC_IO_RING_H +#define XEN_PUBLIC_IO_RING_H /* * When #include'ing this header, you need to provide the following include/hw/xen/interface/io/usbif.h +0
-0
include/hw/xen/interface/io/usbif.h line 32
Quoted 10 lines
include/hw/xen/interface/io/usbif.h +2
-2@@ -25,8 +25,8 @@* DEALINGS IN THE SOFTWARE. */ -#ifndef __XEN_PUBLIC_IO_USBIF_H__ -#define __XEN_PUBLIC_IO_USBIF_H__ +#ifndef XEN_PUBLIC_IO_USBIF_H +#define XEN_PUBLIC_IO_USBIF_H #include "ring.h" #include "../grant_table.h"
I hope the Xen people can comment on whether the underscores had a purpose here or whether it's ok to remove them, thus:
From my QEMU-developer's side of view:
Quoted 20 lines · Thomas Huth
Quoted 6 lines · Ahmed Abouzied
Identifiers with leading underscores followed by capital letters or underscores are reserved for C standards.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/369
Signed-off-by Ahmed Abouzied <[email protected]>Quoted 12 lines
--- include/hw/xen/interface/grant_table.h | 4 ++-- include/hw/xen/interface/io/blkif.h | 4 ++-- include/hw/xen/interface/io/console.h | 4 ++-- include/hw/xen/interface/io/fbif.h | 4 ++-- include/hw/xen/interface/io/kbdif.h | 4 ++-- include/hw/xen/interface/io/netif.h | 4 ++-- include/hw/xen/interface/io/protocols.h | 4 ++-- include/hw/xen/interface/io/ring.h | 4 ++-- include/hw/xen/interface/io/usbif.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-)
Quoted 9 lines
I hope the Xen people can comment on whether the underscores had a purpose here or whether it's ok to remove them, thus:
From my QEMU-developer's side of view:
Reviewed-by Thomas Huth <[email protected]>
Please don't change the header guards in include/hw/xen/interface/.
This have been attempted before and result in build failures, see d1744bd3218daa820744c14572058491e4854399 (Revert xen/io/ring.h of "Clean up a few header guard symbols")
Cheers,
Signature · 1 line
Anthony PERARD