From nobody Wed May 8 08:42:23 2024 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=1679562577; cv=none; d=zohomail.com; s=zohoarc; b=LsydhYLuxCoWk/2Eb9NMY0WcbRybxp8yiyLPJhpIYpsMcm09OAjAj4AKhvY6KJbzq0aY6eAn5lpUmHwS6u7dJM4QQC8d9nDUvEyEEo1N+0Mt9C3cbIuQylZaKbItJQnZd5eYK6bjdkdzFN5N9UV2b+fPmETgi/X61u2Z8sZUVgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679562577; 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=tK/VfAs+HwoOwyc0XN0NF5mz6F3pkkpHh5nlaBVfidg=; b=RG2YqJtikG1Pl3XGD1UZ1+AdNgfaUgay6XCZbegBLBhVR6M+qSmMtZ+ntJVjMI/MMMFdIaHArg4kZucc7P9HQvthf177f9FBBq2/tmN6kr0UIwgEPm36Ba8izCLRjCUn7wsbx0FsHoPymg2svLEfuX6tytfQSPfHZfJ1stNNpds= 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 1679562577772162.4121010932745; Thu, 23 Mar 2023 02:09:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513691.795076 (Exim 4.92) (envelope-from ) id 1pfGwY-0004xw-8t; Thu, 23 Mar 2023 09:09:10 +0000 Received: by outflank-mailman (output) from mailman id 513691.795076; Thu, 23 Mar 2023 09:09:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfGwY-0004xp-6N; Thu, 23 Mar 2023 09:09:10 +0000 Received: by outflank-mailman (input) for mailman id 513691; Thu, 23 Mar 2023 09:09:08 +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 1pfGwW-0004iI-Ss for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 09:09:08 +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 5dc64794-c95a-11ed-85db-49a42c6b2330; Thu, 23 Mar 2023 10:09:07 +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 4B4125BF35; Thu, 23 Mar 2023 09:09:07 +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 46A5D13596; Thu, 23 Mar 2023 09:09:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id siHQDzMXHGQQPAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:09:07 +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: 5dc64794-c95a-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679562547; 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=tK/VfAs+HwoOwyc0XN0NF5mz6F3pkkpHh5nlaBVfidg=; b=Hm273TDuSugT/TtFetQzGJarVQ+BKeW4zz6s1JRyY7TPhjcaW5j/rMZhlXAfH8zbtU3yEm HZLXkc7J4C5UEw4X3rlWKyUjvqnGThunj+dMaocQFhi0VTQ5nvCBPMLyYn3edQyomeoYH3 QuFwP5066gzD19Nvd9f2aBBmDLKm8Fc= 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 v5 1/5] tools: get rid of additional min() and max() definitions Date: Thu, 23 Mar 2023 10:08:55 +0100 Message-Id: <20230323090859.25240-2-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323090859.25240-1-jgross@suse.com> References: <20230323090859.25240-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679562578539100002 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 Acked-by: Anthony PERARD Acked-by: Jan Beulich --- V5: - change patch sequence --- tools/firmware/hvmloader/util.h | 8 ++------ tools/libs/vchan/init.c | 3 +-- tools/tests/vpci/Makefile | 2 +- tools/tests/vpci/emul.h | 18 ++---------------- 4 files changed, 6 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 f03e3a56d1..d26e00b9d7 100644 --- a/tools/tests/vpci/emul.h +++ b/tools/tests/vpci/emul.h @@ -27,6 +27,8 @@ #include #include =20 +#include + #define container_of(ptr, type, member) ({ \ typeof(((type *)0)->member) *mptr =3D (ptr); \ \ @@ -110,22 +112,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 Wed May 8 08:42:23 2024 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=1679562576; cv=none; d=zohomail.com; s=zohoarc; b=GGTv2YCEfc1VAKN3g7yWeb9Kc7R7Z95eMI1Dj/9coCXu2U3JkcONZF3kJFCMrJo8mZalO4VdHL5V2w4G1ZYd15FrZ+qsSjbqsbWQcRbMRkA0nUWlQH8acD1dUTWMjz/S1b19qMw2JTZJxu7NgBh+2tFqcy9eb2WSYB5vuKcTSGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679562576; 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=NkU+UmJXMS1mAOT7n+HbFjDZMmGhTQh5NhcqjvLW5Rs=; b=BgCVmt6PPqy17Cg9pWFlCLUCExLgxbowda1IKw0grX2KCQmko1gwLnrNk6YMipE0EQv3k4k7Am/MGf3CAuZ8j1EIlITd/upGlQ6/4piFt0YOmDz4BIvW+8iIbkxBXnwMirDx8/JXMc4iY9wcQmf67k8Zceoa/OiyKs7oo64+pfI= 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 1679562576423301.79228344854755; Thu, 23 Mar 2023 02:09:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513692.795087 (Exim 4.92) (envelope-from ) id 1pfGwd-0005GF-I8; Thu, 23 Mar 2023 09:09:15 +0000 Received: by outflank-mailman (output) from mailman id 513692.795087; Thu, 23 Mar 2023 09:09:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfGwd-0005G8-Eb; Thu, 23 Mar 2023 09:09:15 +0000 Received: by outflank-mailman (input) for mailman id 513692; Thu, 23 Mar 2023 09:09:14 +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 1pfGwb-0004iI-R1 for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 09:09:13 +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 611f92b4-c95a-11ed-85db-49a42c6b2330; Thu, 23 Mar 2023 10:09:13 +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 E3ED15C086; Thu, 23 Mar 2023 09:09:12 +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 DB13713596; Thu, 23 Mar 2023 09:09:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5jQjNDgXHGQbPAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:09:12 +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: 611f92b4-c95a-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679562553; 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=NkU+UmJXMS1mAOT7n+HbFjDZMmGhTQh5NhcqjvLW5Rs=; b=DBNNT18yqkg5poH1g6gdwVoHcdxb7d824Q2VsU575k/HLFsfW5KGepgYQiPPjEhSUD6Y6Y TwFCp5m1UFBH/pkV8cP+7DTdKFyQWxn4tjsRVRBr4hd0mczbybo+N18drzn+9B9osK/rG2 4W1XfNrYl3AMWWR0OJneSRpvUX9vxzg= 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 v5 2/5] tools: add container_of() macro to xen-tools/common-macros.h Date: Thu, 23 Mar 2023 10:08:56 +0100 Message-Id: <20230323090859.25240-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323090859.25240-1-jgross@suse.com> References: <20230323090859.25240-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679562578533100001 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 Acked-by: Anthony PERARD --- V5: - change patch sequence - use offsetof() definition from tools/tests/x86_emulator/x86-emulate.h as template (Jan Beulich) --- tools/include/xen-tools/common-macros.h | 5 +++++ tools/tests/vpci/emul.h | 6 ------ tools/tests/x86_emulator/x86-emulate.h | 5 ----- tools/xenstore/list.h | 6 ++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-to= ols/common-macros.h index a372b9ecf2..76b55bf620 100644 --- a/tools/include/xen-tools/common-macros.h +++ b/tools/include/xen-tools/common-macros.h @@ -76,4 +76,9 @@ #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 d26e00b9d7..8c5bcadd5f 100644 --- a/tools/tests/vpci/emul.h +++ b/tools/tests/vpci/emul.h @@ -29,12 +29,6 @@ =20 #include =20 -#define container_of(ptr, type, member) ({ \ - typeof(((type *)0)->member) *mptr =3D (ptr); \ - \ - (type *)((char *)mptr - offsetof(type, member)); \ -}) - #define smp_wmb() #define prefetch(x) __builtin_prefetch(x) #define ASSERT(x) assert(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 Wed May 8 08:42:23 2024 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=1679562579; cv=none; d=zohomail.com; s=zohoarc; b=C05c3YvlXm29MmDc8/twBmvh+AjGKbwJz4ibRpzQnKUJKcEKLOxHhFVypnCxHWIJQT/kFMEGkzAF/S799t/I6OE5cr3O+nfFnuxbsnOo32piNgtiFveYsgNNt1sCSlKxANJOhLKZtVp5rv5ZxgFCSdpnyt/1B8eUDpQTXIw/Uh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679562579; 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=KekcHDT8sTSNNg7lix6UgmDeCEWrsQjl0v8SorJ5R/A=; b=IIiMM61gh5LvoZsF8FGSD2VzKFbOg625KAX6UjZFdQ+8Q9R1XsNyVbFaiXPvkZMpjolHIXCowGY3tpaCD4g/34rzVmQ1djiU+Aaebh7BPMiENWzPhD1BH6YhQ0c7X+S1vQTEncwVvPyyjZkT33XgKHh5P8Hd7sz7NdFCIpYzdvw= 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 1679562579867546.5124435895303; Thu, 23 Mar 2023 02:09:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513693.795096 (Exim 4.92) (envelope-from ) id 1pfGwi-0005ZE-RX; Thu, 23 Mar 2023 09:09:20 +0000 Received: by outflank-mailman (output) from mailman id 513693.795096; Thu, 23 Mar 2023 09:09:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfGwi-0005Z7-OV; Thu, 23 Mar 2023 09:09:20 +0000 Received: by outflank-mailman (input) for mailman id 513693; Thu, 23 Mar 2023 09:09:19 +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 1pfGwh-0004iI-Nn for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 09:09:19 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6481d08e-c95a-11ed-85db-49a42c6b2330; Thu, 23 Mar 2023 10:09:19 +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 C90CE3421D; Thu, 23 Mar 2023 09:09:18 +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 8520613596; Thu, 23 Mar 2023 09:09:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 33UrHz4XHGQ3PAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:09:18 +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: 6481d08e-c95a-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679562558; 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=KekcHDT8sTSNNg7lix6UgmDeCEWrsQjl0v8SorJ5R/A=; b=Zp/dpWSG6EYHkJVo9Url9+pkD5mzSEclEQp9bZMBvBpSFGs5R7MQPXrIbvzLb27NpZbxnh qe1soVQZuupx2i+eqP7HjGmXcQSR/zpqT7Zk2Xw1lDo2h2OnS0zp3lnBA/EDDGRLW8chhu eUmRGfHqcWBblDnmtoFJ0iN+UsT36dM= 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 v5 3/5] tools/hvmloader: remove private offsetof() definition Date: Thu, 23 Mar 2023 10:08:57 +0100 Message-Id: <20230323090859.25240-4-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323090859.25240-1-jgross@suse.com> References: <20230323090859.25240-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679562580207100005 Content-Type: text/plain; charset="utf-8" util.h contains a definition of offsetof(), which isn't used. 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 Wed May 8 08:42:23 2024 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=1679562584; cv=none; d=zohomail.com; s=zohoarc; b=kb1x3MjNAjdsG5TQMV+jRXMTgNZd+ngop83Kv1J3CTOm+RvB+7hf0quSPR5wAKP9h/Mn8fhn+EWNW2Q1I/7YdK0jm1ud9HJJhulSnEkxYyq01RFgkRIMxP0Bx6VO0jhGSyOECTx+p/WscQxUpymEGiR1Y7cTZpa2Djv7DeKmb0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679562584; 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=R/noKbyyITp0qtbZnvNVZt67nN08JNGw5baCpQGnI1xK2oTkp96jw81JplfhZ55hydaj8WkxSBx+N7CeSthp9Yn2a7KDmtEphqZbWUFSrcj2UdFLK5wZgpFbMAE6pn/5sgs3L/h5ApH7KR2WLj0hsWlK1XlEf+4mFfyhnhfE6d4= 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 1679562584840245.7513167346981; Thu, 23 Mar 2023 02:09:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513694.795107 (Exim 4.92) (envelope-from ) id 1pfGwq-0005x9-Ck; Thu, 23 Mar 2023 09:09:28 +0000 Received: by outflank-mailman (output) from mailman id 513694.795107; Thu, 23 Mar 2023 09:09:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfGwq-0005x0-6s; Thu, 23 Mar 2023 09:09:28 +0000 Received: by outflank-mailman (input) for mailman id 513694; Thu, 23 Mar 2023 09:09:26 +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 1pfGwo-0004eG-4H for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 09:09:26 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 67d4d568-c95a-11ed-b464-930f4c7d94ae; Thu, 23 Mar 2023 10:09:24 +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 2C6541FE54; Thu, 23 Mar 2023 09:09:24 +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 3B4A613596; Thu, 23 Mar 2023 09:09:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0XJDDUQXHGRKPAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:09:24 +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: 67d4d568-c95a-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679562564; 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=CdSL9jCe442uhJD96ljIEIaqVWzWUxhs69dU3Liv7jqnLJUuqM7jqzyTmk1HjvlpPPWLjV g3jsA5ITP69UJoaj4Kzp/obmkr6TojwUJF074EcYJcBsLU/W6gy4qfFXfi+9SZvynXREvK weMP7Y3TVBMGXpl4+ngcXKg57NzoVXI= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v5 4/5] tools/libfsimage: remove private offsetof() definition Date: Thu, 23 Mar 2023 10:08:58 +0100 Message-Id: <20230323090859.25240-5-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323090859.25240-1-jgross@suse.com> References: <20230323090859.25240-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679562586449100002 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 Acked-by: Anthony PERARD --- 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 Wed May 8 08:42:23 2024 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=1679562585; cv=none; d=zohomail.com; s=zohoarc; b=hO4ymPzVzlxfZQR00/lB9Vb/hsSMQn0UyzkSpzd8qpmQ2TxJ2oSZK9UO3U0TAwqxAhP4d3t4k399mXwV6r8f0T3O/GSKYIvxEoJKYT2bA3nF9Kwlm+BnYJYNFgjteCAlVMyeueGtm/MKOVzCOfv8reokFB5VnfjQRZx7EwQhRW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679562585; 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=NyQvuxEnP25hrINM4fGXRuomeIfw99MP94XIuukrvah20xc83DKXCHb+g64J7bODZG6Jhtx1NINRC1sqqOksP8f7wNsYBJ5y0bd8/N+QoT/a0Nf3wJq7iXrMX044Wl08NlsSO2oUtpGtNpkD5Dj/Z1EfnA26fvM61/PbP1Ficb0= 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 1679562585959681.7788599631117; Thu, 23 Mar 2023 02:09:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.513698.795116 (Exim 4.92) (envelope-from ) id 1pfGwt-0006Iv-Lp; Thu, 23 Mar 2023 09:09:31 +0000 Received: by outflank-mailman (output) from mailman id 513698.795116; Thu, 23 Mar 2023 09:09:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pfGwt-0006Ig-HZ; Thu, 23 Mar 2023 09:09:31 +0000 Received: by outflank-mailman (input) for mailman id 513698; Thu, 23 Mar 2023 09:09:30 +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 1pfGws-0004iI-J6 for xen-devel@lists.xenproject.org; Thu, 23 Mar 2023 09:09:30 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6b26617f-c95a-11ed-85db-49a42c6b2330; Thu, 23 Mar 2023 10:09:30 +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 EC9183421D; Thu, 23 Mar 2023 09:09:29 +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 C526413596; Thu, 23 Mar 2023 09:09:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 84OtLkkXHGRfPAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:09:29 +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: 6b26617f-c95a-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679562569; 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=GELWIzEVwFp9cZyFOHWJwkCjahL80Y0FQcsCu0lFxihPoSnv2gkGlh94yKxI1sfsh18w9H zscSzlmh81jKSi/Z9Z8Kfxv6ubzBJmymgZEj1qZqdHvEOc14rE0yfD9GrAg7bJIqZp14oO jxpn2s3MfgE8oIDo1Fww6YvRmYhrGyw= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v5 5/5] tools/libs/vchan: remove private offsetof() definition Date: Thu, 23 Mar 2023 10:08:59 +0100 Message-Id: <20230323090859.25240-6-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323090859.25240-1-jgross@suse.com> References: <20230323090859.25240-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1679562586449100001 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 Acked-by: Anthony PERARD --- 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