mbox series

[v2,0/4] tools: use xen-tools/libs.h for common definitions

Message ID 20230227154153.31080-1-jgross@suse.com (mailing list archive)
Headers show
Series tools: use xen-tools/libs.h for common definitions | expand

Message

Jürgen Groß Feb. 27, 2023, 3:41 p.m. UTC
There are some macros defined multiple times in tools. Use only
a single header file for defining those macros and drop the copies.

V2:
- add patch 1 (Andrew Cooper)

Juergen Gross (4):
  tools: rename xen-tools/libs.h file to common-macros.h
  tools: add container_of() macro to xen-tools/common-macros.h
  tools: get rid of additional min() and max() definitions
  tools: add offsetof() to xen-tools/common-macros.h

 tools/console/daemon/io.c                     |  2 +-
 tools/firmware/hvmloader/util.h               | 11 ++--------
 tools/firmware/include/stddef.h               |  4 ++--
 tools/fuzz/cpu-policy/afl-policy-fuzzer.c     |  2 +-
 .../xen-tools/{libs.h => common-macros.h}     | 22 ++++++++++++++++---
 tools/libfsimage/Rules.mk                     |  2 ++
 tools/libfsimage/xfs/fsys_xfs.c               |  4 +---
 tools/libs/call/buffer.c                      |  2 +-
 tools/libs/ctrl/xc_pm.c                       |  2 +-
 tools/libs/ctrl/xc_private.h                  |  2 +-
 tools/libs/foreignmemory/linux.c              |  2 +-
 tools/libs/gnttab/freebsd.c                   |  2 +-
 tools/libs/gnttab/linux.c                     |  2 +-
 tools/libs/guest/xg_core_arm.c                |  2 +-
 tools/libs/guest/xg_cpuid_x86.c               |  2 +-
 tools/libs/guest/xg_dom_arm.c                 |  2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       |  2 +-
 tools/libs/guest/xg_dom_x86.c                 |  2 +-
 tools/libs/guest/xg_sr_common.c               |  2 +-
 tools/libs/light/libxl_internal.h             |  2 +-
 tools/libs/light/libxl_psr.c                  |  2 +-
 tools/libs/stat/xenstat_linux.c               |  2 +-
 tools/libs/vchan/init.c                       |  7 +-----
 tools/misc/xen-access.c                       |  2 +-
 tools/misc/xen-cpuid.c                        |  2 +-
 tools/misc/xen-diag.c                         |  2 +-
 tools/misc/xen-hptool.c                       |  2 +-
 tools/misc/xen-livepatch.c                    |  2 +-
 tools/misc/xen-mfndump.c                      |  2 +-
 tools/misc/xenpm.c                            |  2 +-
 tools/ocaml/libs/mmap/xenmmap_stubs.c         |  2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c           |  2 +-
 tools/python/xen/lowlevel/xc/xc.c             |  2 +-
 tools/tests/cpu-policy/test-cpu-policy.c      |  2 +-
 .../paging-mempool/test-paging-mempool.c      |  2 +-
 tools/tests/resource/test-resource.c          |  2 +-
 tools/tests/tsx/test-tsx.c                    |  2 +-
 tools/tests/vhpet/emul.h                      | 16 +-------------
 tools/tests/vpci/emul.h                       | 22 +------------------
 tools/tests/x86_emulator/x86-emulate.h        |  7 +-----
 tools/tests/xenstore/test-xenstore.c          |  2 +-
 tools/xenstore/list.h                         |  6 ++---
 tools/xenstore/utils.h                        |  2 +-
 tools/xentrace/analyze.h                      |  2 +-
 tools/xl/xl_cmdtable.c                        |  2 +-
 xen/lib/x86/private.h                         |  2 +-
 46 files changed, 68 insertions(+), 105 deletions(-)
 rename tools/include/xen-tools/{libs.h => common-macros.h} (74%)

Comments

Christian Lindig Feb. 28, 2023, 10:36 a.m. UTC | #1
> On 27 Feb 2023, at 15:41, Juergen Gross <jgross@suse.com> wrote:
> 
> There are some macros defined multiple times in tools. Use only
> a single header file for defining those macros and drop the copies.
> 
> V2:
> - add patch 1 (Andrew Cooper)
> 
> Juergen Gross (4):
>  tools: rename xen-tools/libs.h file to common-macros.h
>  tools: add container_of() macro to xen-tools/common-macros.h
>  tools: get rid of additional min() and max() definitions
>  tools: add offsetof() to xen-tools/common-macros.h
> 
> tools/console/daemon/io.c                     |  2 +-
> tools/firmware/hvmloader/util.h               | 11 ++--------
> tools/firmware/include/stddef.h               |  4 ++--
> tools/fuzz/cpu-policy/afl-policy-fuzzer.c     |  2 +-
> .../xen-tools/{libs.h => common-macros.h}     | 22 ++++++++++++++++---
> tools/libfsimage/Rules.mk                     |  2 ++
> tools/libfsimage/xfs/fsys_xfs.c               |  4 +---
> tools/libs/call/buffer.c                      |  2 +-
> tools/libs/ctrl/xc_pm.c                       |  2 +-
> tools/libs/ctrl/xc_private.h                  |  2 +-
> tools/libs/foreignmemory/linux.c              |  2 +-
> tools/libs/gnttab/freebsd.c                   |  2 +-
> tools/libs/gnttab/linux.c                     |  2 +-
> tools/libs/guest/xg_core_arm.c                |  2 +-
> tools/libs/guest/xg_cpuid_x86.c               |  2 +-
> tools/libs/guest/xg_dom_arm.c                 |  2 +-
> tools/libs/guest/xg_dom_bzimageloader.c       |  2 +-
> tools/libs/guest/xg_dom_x86.c                 |  2 +-
> tools/libs/guest/xg_sr_common.c               |  2 +-
> tools/libs/light/libxl_internal.h             |  2 +-
> tools/libs/light/libxl_psr.c                  |  2 +-
> tools/libs/stat/xenstat_linux.c               |  2 +-
> tools/libs/vchan/init.c                       |  7 +-----
> tools/misc/xen-access.c                       |  2 +-
> tools/misc/xen-cpuid.c                        |  2 +-
> tools/misc/xen-diag.c                         |  2 +-
> tools/misc/xen-hptool.c                       |  2 +-
> tools/misc/xen-livepatch.c                    |  2 +-
> tools/misc/xen-mfndump.c                      |  2 +-
> tools/misc/xenpm.c                            |  2 +-
> tools/ocaml/libs/mmap/xenmmap_stubs.c         |  2 +-
> tools/ocaml/libs/xc/xenctrl_stubs.c           |  2 +-
> tools/python/xen/lowlevel/xc/xc.c             |  2 +-
> tools/tests/cpu-policy/test-cpu-policy.c      |  2 +-
> .../paging-mempool/test-paging-mempool.c      |  2 +-
> tools/tests/resource/test-resource.c          |  2 +-
> tools/tests/tsx/test-tsx.c                    |  2 +-
> tools/tests/vhpet/emul.h                      | 16 +-------------
> tools/tests/vpci/emul.h                       | 22 +------------------
> tools/tests/x86_emulator/x86-emulate.h        |  7 +-----
> tools/tests/xenstore/test-xenstore.c          |  2 +-
> tools/xenstore/list.h                         |  6 ++---
> tools/xenstore/utils.h                        |  2 +-
> tools/xentrace/analyze.h                      |  2 +-
> tools/xl/xl_cmdtable.c                        |  2 +-
> xen/lib/x86/private.h                         |  2 +-
> 46 files changed, 68 insertions(+), 105 deletions(-)
> rename tools/include/xen-tools/{libs.h => common-macros.h} (74%)
> 
> -- 
> 2.35.3
> 

Acked-by: Christian Lindig <christian.lindig@cloud.com>