From nobody Sat Feb 7 04:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1679486965; cv=none; d=zohomail.com; s=zohoarc; b=EUyP6t9zWxBS3z4Yv8GD0yM5dMwIWa5zpi+kiRT6oaa8plqgywYONrLIisbxOWzLHVCG21SCiaZwgFecAd63ny5ELVkZZ7zrJbJICV31XavcYkYDwjwY2wpKv0r52uSu9DLFHTD9B/3ncKfVjwyRElB+u5l7pEuDpGMuNpnBGsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679486965; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=P9SZJQ2l/SM9CqHAOm4kp4DfYnJzxAm8/FClRZGJjyA=; b=CMeB4eOQp7L/+dZTz0p5Wph0SkzJcbwGWyIMl9A/7xz/Fqd4qA8qvsftf24YgGxZYUX9Cas68Ut140jCmd8zL4fvZi/2dgDL7x7szHQ7LD5ANDDPfyfJ5bOA5eniYW7UpfiRQYZN43yCGDQLs6pOOY8T3kLvKISrmHs5ce8Nmpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1679486965132614.5886058229856; Wed, 22 Mar 2023 05:09:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513369.794237 (Exim 4.92) (envelope-from ) id 1pexGz-0000Bn-IC; Wed, 22 Mar 2023 12:08:57 +0000 Received: by outflank-mailman (output) from mailman id 513369.794237; Wed, 22 Mar 2023 12:08:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexGz-0000Bg-Fd; Wed, 22 Mar 2023 12:08:57 +0000 Received: by outflank-mailman (input) for mailman id 513369; Wed, 22 Mar 2023 12:08:56 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexGy-0008Jp-MQ for xen-devel@lists.xenproject.org; Wed, 22 Mar 2023 12:08:56 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5029a5c1-c8aa-11ed-b464-930f4c7d94ae; Wed, 22 Mar 2023 13:08:53 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3B9C433AA9; Wed, 22 Mar 2023 12:08:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E1CD513416; Wed, 22 Mar 2023 12:08:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id r4l8NdTvGmQITwAAMHmgww (envelope-from ); Wed, 22 Mar 2023 12:08:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5029a5c1-c8aa-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679486933; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P9SZJQ2l/SM9CqHAOm4kp4DfYnJzxAm8/FClRZGJjyA=; b=kjvVR+o58cgjc2f86NVx3+wlIrZTByTz/BM4TxpCu7lSNps+Y3hasEPHDhQFrLF6sUYQVD g352pkTHLRSSb8aqS68iUGoRliKyfnsAIaalS1r3dhUKmNqTPDY+6WJqdAwGxWMcyN0qmX fREQWn2xJcRaQpeHUJ7MMAj+FS9H5+o= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Julien Grall Subject: [PATCH v4 1/5] tools: add container_of() macro to xen-tools/common-macros.h Date: Wed, 22 Mar 2023 13:08:40 +0100 Message-Id: <20230322120844.19657-2-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322120844.19657-1-jgross@suse.com> References: <20230322120844.19657-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679486965951100001 Content-Type: text/plain; charset="utf-8" Instead of having 4 identical copies of the definition of a container_of() macro in different tools header files, add that macro to xen-tools/common-macros.h and use that instead. Delete the other copies of that macro. Signed-off-by: Juergen Gross Acked-by: Jan Beulich --- There is a similar macro CONTAINER_OF() defined in tools/include/xentoolcore_internal.h, which allows to not only use a type for the 2nd parameter, but a variable, too. I'd like to get rid of that macro as well, but there are lots of use cases especially in libxl. Any thoughts regarding that macro? I could either: - don't touch it at all - enhance container_of() like CONTAINER_OF() and replace all use cases of CONTAINER_OF() with container_of() - replace the few CONTAINER_OF() users outside libxl with container_of() and define CONTAINER_OF() in e.g. libxl_internal.h - replace all CONTAINER_OF() use cases with container_of(), including the change from (.., var, ..) to (.., type, ...). Signed-off-by: Juergen Gross --- tools/include/xen-tools/common-macros.h | 4 ++++ tools/tests/vpci/emul.h | 6 +----- tools/tests/x86_emulator/x86-emulate.h | 5 ----- tools/xenstore/list.h | 6 ++---- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-to= ols/common-macros.h index a372b9ecf2..b046ab48bf 100644 --- a/tools/include/xen-tools/common-macros.h +++ b/tools/include/xen-tools/common-macros.h @@ -76,4 +76,8 @@ #define __must_check __attribute__((__warn_unused_result__)) #endif =20 +#define container_of(ptr, type, member) ({ \ + typeof( ((type *)0)->member ) *__mptr =3D (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + #endif /* __XEN_TOOLS_COMMON_MACROS__ */ diff --git a/tools/tests/vpci/emul.h b/tools/tests/vpci/emul.h index f03e3a56d1..7169a2ea02 100644 --- a/tools/tests/vpci/emul.h +++ b/tools/tests/vpci/emul.h @@ -27,11 +27,7 @@ #include #include =20 -#define container_of(ptr, type, member) ({ \ - typeof(((type *)0)->member) *mptr =3D (ptr); \ - \ - (type *)((char *)mptr - offsetof(type, member)); \ -}) +#include =20 #define smp_wmb() #define prefetch(x) __builtin_prefetch(x) diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emula= tor/x86-emulate.h index 46d4e43cea..1af986f78d 100644 --- a/tools/tests/x86_emulator/x86-emulate.h +++ b/tools/tests/x86_emulator/x86-emulate.h @@ -56,11 +56,6 @@ =20 #define cf_check /* No Control Flow Integriy checking */ =20 -#define container_of(ptr, type, member) ({ \ - typeof(((type *)0)->member) *mptr__ =3D (ptr); \ - (type *)((char *)mptr__ - offsetof(type, member)); \ -}) - #define AC_(n,t) (n##t) #define _AC(n,t) AC_(n,t) =20 diff --git a/tools/xenstore/list.h b/tools/xenstore/list.h index b17d13e0ec..a464a38b61 100644 --- a/tools/xenstore/list.h +++ b/tools/xenstore/list.h @@ -3,6 +3,8 @@ /* Taken from Linux kernel code, but de-kernelized for userspace. */ #include =20 +#include + #undef LIST_HEAD_INIT #undef LIST_HEAD #undef INIT_LIST_HEAD @@ -15,10 +17,6 @@ #define LIST_POISON1 ((void *) 0x00100100) #define LIST_POISON2 ((void *) 0x00200200) =20 -#define container_of(ptr, type, member) ({ \ - typeof( ((type *)0)->member ) *__mptr =3D (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) - /* * Simple doubly linked list implementation. * --=20 2.35.3 From nobody Sat Feb 7 04:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1679486968; cv=none; d=zohomail.com; s=zohoarc; b=XtTh3ivBUVRs+RYnyvdMqnTDDuTI3krRInOWZKAi8wiw51zPxxIErM7n8Is1/SSYd/vLycADaNx55EKWZSoAc3V3PJkFUC5YMwO+T/aGBeqaa0WUUcFr6cqmSos3aamlVZxqy5Pj9Tu2vH0wGxM7LbKxOk+K7CBNC2MShm56Awo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679486968; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=suOiz4udjcsmoILWLrFfDzQ1cyAZXnKkjPEFbgxcutI=; b=M64/5gS+cyz/6Wc9pRQ/WwOIQ2zQvoaCDwWdW65D+jOlcMA1A2wkneN2+20m7DYFF8zigapbm+3rgaq08LEiku0YUHfuXI0htQ4eTgauGWPr8Ywe6F2ciEl0MkDfh+QZvhXxyommxKmJ8eg7KR6FvYsS5FCBFseRuVFFQOPnbYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1679486968903932.7587852950672; Wed, 22 Mar 2023 05:09:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513370.794248 (Exim 4.92) (envelope-from ) id 1pexH3-0000Zq-QM; Wed, 22 Mar 2023 12:09:01 +0000 Received: by outflank-mailman (output) from mailman id 513370.794248; Wed, 22 Mar 2023 12:09:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexH3-0000Zh-NS; Wed, 22 Mar 2023 12:09:01 +0000 Received: by outflank-mailman (input) for mailman id 513370; Wed, 22 Mar 2023 12:09:00 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexH2-0000Ws-Ue for xen-devel@lists.xenproject.org; Wed, 22 Mar 2023 12:09:00 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5391c5e9-c8aa-11ed-85db-49a42c6b2330; Wed, 22 Mar 2023 13:08:59 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F03FF20D4C; Wed, 22 Mar 2023 12:08:58 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ADD0613416; Wed, 22 Mar 2023 12:08:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jHAFKdrvGmQVTwAAMHmgww (envelope-from ); Wed, 22 Mar 2023 12:08:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5391c5e9-c8aa-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679486938; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=suOiz4udjcsmoILWLrFfDzQ1cyAZXnKkjPEFbgxcutI=; b=Mgx0UeP5T6p24ilFp2nB8LPyQ5/rvGblISqIATSZTzIOv4Bl3RJhjP0CEGxBVW46Jnay/h DUr1oe9+K3ynDLWDv4eFiwfMYd9+68PeKBfio3UvWl36lA0BBvhcX6J7ty65pWJei/B3Er 1QvBiGUNRjYZD7hYkdpEQB6t+mshR0c= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Anthony PERARD Subject: [PATCH v4 2/5] tools: get rid of additional min() and max() definitions Date: Wed, 22 Mar 2023 13:08:41 +0100 Message-Id: <20230322120844.19657-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322120844.19657-1-jgross@suse.com> References: <20230322120844.19657-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679486969886100001 Content-Type: text/plain; charset="utf-8" Defining min(), min_t(), max() and max_t() at other places than xen-tools/common-macros.h isn't needed, as the definitions in said header can be used instead. Same applies to BUILD_BUG_ON() in hvmloader. Signed-off-by: Juergen Gross --- tools/firmware/hvmloader/util.h | 8 ++------ tools/libs/vchan/init.c | 3 +-- tools/tests/vpci/Makefile | 2 +- tools/tests/vpci/emul.h | 16 ---------------- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/uti= l.h index 8d95eab28a..e04990ee97 100644 --- a/tools/firmware/hvmloader/util.h +++ b/tools/firmware/hvmloader/util.h @@ -9,6 +9,8 @@ #include #include "e820.h" =20 +#include + /* Request un-prefixed values from errno.h. */ #define XEN_ERRNO(name, value) name =3D value, enum { @@ -41,12 +43,6 @@ void __assert_failed(const char *assertion, const char *= file, int line) void __bug(const char *file, int line) __attribute__((noreturn)); #define BUG() __bug(__FILE__, __LINE__) #define BUG_ON(p) do { if (p) BUG(); } while (0) -#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)])) - -#define min_t(type,x,y) \ - ({ type __x =3D (x); type __y =3D (y); __x < __y ? __x: __y; }) -#define max_t(type,x,y) \ - ({ type __x =3D (x); type __y =3D (y); __x > __y ? __x: __y; }) =20 #define MB(mb) (mb##ULL << 20) #define GB(gb) (gb##ULL << 30) diff --git a/tools/libs/vchan/init.c b/tools/libs/vchan/init.c index 9195bd3b98..021e1f29e1 100644 --- a/tools/libs/vchan/init.c +++ b/tools/libs/vchan/init.c @@ -45,6 +45,7 @@ #include #include #include +#include =20 #include "vchan.h" =20 @@ -72,8 +73,6 @@ #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif =20 -#define max(a,b) ((a > b) ? a : b) - static int init_gnt_srv(struct libxenvchan *ctrl, int domain) { int pages_left =3D ctrl->read.order >=3D PAGE_SHIFT ? 1 << (ctrl->read.or= der - PAGE_SHIFT) : 0; diff --git a/tools/tests/vpci/Makefile b/tools/tests/vpci/Makefile index 5075bc2be2..62f21f341a 100644 --- a/tools/tests/vpci/Makefile +++ b/tools/tests/vpci/Makefile @@ -11,7 +11,7 @@ run: $(TARGET) ./$(TARGET) =20 $(TARGET): vpci.c vpci.h list.h main.c emul.h - $(HOSTCC) -g -o $@ vpci.c main.c + $(HOSTCC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c =20 .PHONY: clean clean: diff --git a/tools/tests/vpci/emul.h b/tools/tests/vpci/emul.h index 7169a2ea02..8c5bcadd5f 100644 --- a/tools/tests/vpci/emul.h +++ b/tools/tests/vpci/emul.h @@ -106,22 +106,6 @@ typedef union { #define BUG() assert(0) #define ASSERT_UNREACHABLE() assert(0) =20 -#define min(x, y) ({ \ - const typeof(x) tx =3D (x); \ - const typeof(y) ty =3D (y); \ - \ - (void) (&tx =3D=3D &ty); \ - tx < ty ? tx : ty; \ -}) - -#define max(x, y) ({ \ - const typeof(x) tx =3D (x); \ - const typeof(y) ty =3D (y); \ - \ - (void) (&tx =3D=3D &ty); \ - tx > ty ? tx : ty; \ -}) - #endif =20 /* --=20 2.35.3 From nobody Sat Feb 7 04:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1679486975; cv=none; d=zohomail.com; s=zohoarc; b=da15Mjs9OVrXvjgCURGCgdjeLZLZl1TINI2dfJPyisPHhLBXS67Y8hzSYxMF4JNDTpMFEKtWKCSfHoq4MzcN7LO5p+MJhd9ld8eY/hAk4Ul33nNXvmbeUIOSyUpFYuSB8dtcXdJTL4tOV1BaK4NNQq8mV4dkc5N1P6rbDePjgvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679486975; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Tnwj4SkxnHy4amvMB/ppif2VnlwKSRyDYISvivee9EU=; b=F78B9xavqCEfupLHA/Nvs2vf3h8yGTkeNQD4SbwrOF/f/mpfvNLKrG9LSvTqh1n9tvxgV1tur5IgsfWjwwGP8ltWy/6wtOBezOOPNixk4hcGxl4zb6UsaDVO+QArfrwAW/zuurYBEd5xx6MdPHvaMn4X8f/49LM+lbcKKf8q19M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1679486975592612.2148710937607; Wed, 22 Mar 2023 05:09:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513373.794258 (Exim 4.92) (envelope-from ) id 1pexHA-00010s-2n; Wed, 22 Mar 2023 12:09:08 +0000 Received: by outflank-mailman (output) from mailman id 513373.794258; Wed, 22 Mar 2023 12:09:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexH9-00010l-Vy; Wed, 22 Mar 2023 12:09:07 +0000 Received: by outflank-mailman (input) for mailman id 513373; Wed, 22 Mar 2023 12:09:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexH8-0008Jp-FJ for xen-devel@lists.xenproject.org; Wed, 22 Mar 2023 12:09:06 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 57057e99-c8aa-11ed-b464-930f4c7d94ae; Wed, 22 Mar 2023 13:09:05 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BB07B20D4C; Wed, 22 Mar 2023 12:09:04 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6955513416; Wed, 22 Mar 2023 12:09:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4GolGODvGmQsTwAAMHmgww (envelope-from ); Wed, 22 Mar 2023 12:09:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 57057e99-c8aa-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679486944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tnwj4SkxnHy4amvMB/ppif2VnlwKSRyDYISvivee9EU=; b=PrJwija0qWsbPZwKAKv0CQlaFdxCPAY9wauY1p+yiTXZEaAZ853lUZk2HTKRj5n61VsN8a vT3d5SDHMoJn9EoX4kgEDC5o1aOdOxtaab5/cap23chsiWjZoCnQts7Jq+qcB+aeOvaYRL AiLLxTCmKPNrN0f2vPOwb8Yi6rmUchM= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Anthony PERARD Subject: [PATCH v4 3/5] tools/hvmloader: remove private offsetof() definition Date: Wed, 22 Mar 2023 13:08:42 +0100 Message-Id: <20230322120844.19657-4-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322120844.19657-1-jgross@suse.com> References: <20230322120844.19657-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679486977757100001 Content-Type: text/plain; charset="utf-8" util.h contains a definition of offsetof(), which isn't needed. Remove it. Signed-off-by: Juergen Gross Acked-by: Jan Beulich --- V4: - new patch --- tools/firmware/hvmloader/util.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/uti= l.h index e04990ee97..7249773eeb 100644 --- a/tools/firmware/hvmloader/util.h +++ b/tools/firmware/hvmloader/util.h @@ -30,9 +30,6 @@ enum { #define SEL_DATA32 0x0020 #define SEL_CODE64 0x0028 =20 -#undef offsetof -#define offsetof(t, m) ((unsigned long)&((t *)0)->m) - #undef NULL #define NULL ((void*)0) =20 --=20 2.35.3 From nobody Sat Feb 7 04:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1679486979; cv=none; d=zohomail.com; s=zohoarc; b=jpbeaycQi19WMTUgEtV2ds59gcrfKJUV9xYUrtwRIhUcYYmNpnjM5TvBCO82vIVjBZdKNsMq6Vb/UC4mdIzVQptYJzoo4A8X5qZRMrV1yHa60wgTFPhxxprGlHmFVjJsmLzC7io3i8MEfvr7qjPQmKuOF73APF9hag9dfc2XXHk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679486979; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=afC9LuDOI4S1LmIJPeS//2B8HX3QZZNvVY/3xGApvhI=; b=WCAmAbcoP+auXz+TaaAAN4xPdHRZvjh/LOI74+GMgHIeYucDVnndmMElBMw0x6GZeZmfVZl+AyuZtmlGZHX5NzFVhzdLyExKSqvNxF11/9K5rB1vR3CAZUBA4MjxxhzO8meMRv++h440DATi0QpiddBqNu99ac2HXbdEVYngfvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1679486979949902.7757515201376; Wed, 22 Mar 2023 05:09:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513374.794268 (Exim 4.92) (envelope-from ) id 1pexHG-0001Tz-AP; Wed, 22 Mar 2023 12:09:14 +0000 Received: by outflank-mailman (output) from mailman id 513374.794268; Wed, 22 Mar 2023 12:09:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexHG-0001Tq-7S; Wed, 22 Mar 2023 12:09:14 +0000 Received: by outflank-mailman (input) for mailman id 513374; Wed, 22 Mar 2023 12:09:12 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexHE-0008Jp-Ag for xen-devel@lists.xenproject.org; Wed, 22 Mar 2023 12:09:12 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5a5b3cbb-c8aa-11ed-b464-930f4c7d94ae; Wed, 22 Mar 2023 13:09:10 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 58EB333AA9; Wed, 22 Mar 2023 12:09:10 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 31EA213416; Wed, 22 Mar 2023 12:09:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vOmdCubvGmRLTwAAMHmgww (envelope-from ); Wed, 22 Mar 2023 12:09:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5a5b3cbb-c8aa-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679486950; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=afC9LuDOI4S1LmIJPeS//2B8HX3QZZNvVY/3xGApvhI=; b=ssEDpoBuEnwP30B5l08mfrpuyXCplYaFseHcDSO8k7yAqv9kKPzecOWam6vZaPdij/vQiV bcyuiVg6a9iyh7jYkPsYslmCO3g2Yf1wDoEXxKWMClylUb18QY4AHvyvtARKJgIjDX2vrV ZQlnVg02ABY0Ar7xWjtYPh5ssJmkBPw= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v4 4/5] tools/libfsimage: remove private offsetof() definition Date: Wed, 22 Mar 2023 13:08:43 +0100 Message-Id: <20230322120844.19657-5-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322120844.19657-1-jgross@suse.com> References: <20230322120844.19657-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679486981804100001 Content-Type: text/plain; charset="utf-8" xfs/fsys_xfs.c is defining offsetof privately. Remove that definition and just use stddef.h instead. Signed-off-by: Juergen Gross --- V4: - new patch --- tools/libfsimage/xfs/fsys_xfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/libfsimage/xfs/fsys_xfs.c b/tools/libfsimage/xfs/fsys_xf= s.c index d735a88e55..b8b4ca928c 100644 --- a/tools/libfsimage/xfs/fsys_xfs.c +++ b/tools/libfsimage/xfs/fsys_xfs.c @@ -17,6 +17,7 @@ * along with this program; If not, see . */ =20 +#include #include #include "xfs.h" =20 @@ -182,9 +183,6 @@ fsb2daddr (xfs_fsblock_t fsbno) (xfs_agblock_t)(fsbno & mask32lo(xfs.agblklog))); } =20 -#undef offsetof -#define offsetof(t,m) ((size_t)&(((t *)0)->m)) - static inline int btroot_maxrecs (fsi_file_t *ffi) { --=20 2.35.3 From nobody Sat Feb 7 04:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1679486984; cv=none; d=zohomail.com; s=zohoarc; b=OOsfTKADIult0eXw1XHHUiqlwH8nOi2GvDG7Y5TTFjYvOy2bpOjeHt9wwHQmw4ElLrYW86VQ4bDXpWQwGz8pKCucAMOgwIAGYJ9FuyAexeEAFmcRk8H0ZqzUFaAYiv5w8pk+FNEIhvKSlVlh8l3WDqMoTYWPe6XoS+H4U65BHus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679486984; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j3ZkLxPJUvo+zj64n5geObIPSNljnDCOHNBqeqoIUno=; b=QaAX5U5UNtJgn6vTM4mtxVqrI39wgsBbqo/4CRKgL9zYa/23iwfdsMlmaI/YKHH3Yaf/O8bnXQNBTmhhIMA7+GK7xtzmSz4RHRAIJ+luLEeNvjuhC1smJB7Z85GsAjt/dzIGqAs+IwOJ6MzJH4igSFXNDmEKfzQGaVowQSYpF1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1679486984724476.9341069235569; Wed, 22 Mar 2023 05:09:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513377.794277 (Exim 4.92) (envelope-from ) id 1pexHL-0001vz-JY; Wed, 22 Mar 2023 12:09:19 +0000 Received: by outflank-mailman (output) from mailman id 513377.794277; Wed, 22 Mar 2023 12:09:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexHL-0001vs-G6; Wed, 22 Mar 2023 12:09:19 +0000 Received: by outflank-mailman (input) for mailman id 513377; Wed, 22 Mar 2023 12:09:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pexHJ-0008Jp-Ky for xen-devel@lists.xenproject.org; Wed, 22 Mar 2023 12:09:17 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5dac9b35-c8aa-11ed-b464-930f4c7d94ae; Wed, 22 Mar 2023 13:09:16 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E422133AB2; Wed, 22 Mar 2023 12:09:15 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BCEE513416; Wed, 22 Mar 2023 12:09:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id W6y8LOvvGmRkTwAAMHmgww (envelope-from ); Wed, 22 Mar 2023 12:09:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5dac9b35-c8aa-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679486955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j3ZkLxPJUvo+zj64n5geObIPSNljnDCOHNBqeqoIUno=; b=W9YS8reMntWblbZK2gVcAw1KYqnXHccn95nPIItbO+l1UTzL9AszuB9ecZp9hNEnZyru0q joxmeDlfB5KYO5H1C5C80yDcC/ANESFrsIqN/T5kZzL/Ujt5MRZLnx127ikDfNsJ3ac+XR mq7gO7BMMZahIRpcxO+8qpUC9Jg/M7A= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v4 5/5] tools/libs/vchan: remove private offsetof() definition Date: Wed, 22 Mar 2023 13:08:44 +0100 Message-Id: <20230322120844.19657-6-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322120844.19657-1-jgross@suse.com> References: <20230322120844.19657-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679486985754100001 Content-Type: text/plain; charset="utf-8" vchan/init.c is defining offsetof privately. Remove that definition and just use stddef.h instead. Signed-off-by: Juergen Gross --- V4: - new patch --- tools/libs/vchan/init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/libs/vchan/init.c b/tools/libs/vchan/init.c index 021e1f29e1..a081dd4c9a 100644 --- a/tools/libs/vchan/init.c +++ b/tools/libs/vchan/init.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -69,10 +70,6 @@ #define MAX_RING_SHIFT 20 #define MAX_RING_SIZE (1 << MAX_RING_SHIFT) =20 -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - static int init_gnt_srv(struct libxenvchan *ctrl, int domain) { int pages_left =3D ctrl->read.order >=3D PAGE_SHIFT ? 1 << (ctrl->read.or= der - PAGE_SHIFT) : 0; --=20 2.35.3