Message ID | 20230323090859.25240-4-jgross@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | tools: use xen-tools/libs.h for common definitions | expand |
On 23.03.2023 10:08, Juergen Gross wrote:
> util.h contains a definition of offsetof(), which isn't used.
Coming back to my comment on the earlier version: "not used" isn't true,
but the earlier "not needed" also didn't make clear why it was not needed
(misleading me into making the [wrong] suggestion): The macro is used,
just not in hvmloader/ but in files living in libacpi/ and compiled here
(as well as elsewhere).
New suggestion (which I'm happy to apply while committing): "... which
isn't needed, as firmware/include/stddef.h's doesn't really need
overriding". (The same, btw, is true for NULL, so I guess I'll make a
follow-up patch to remove that one as well.)
Jan
On 23.03.23 11:09, Jan Beulich wrote: > On 23.03.2023 10:08, Juergen Gross wrote: >> util.h contains a definition of offsetof(), which isn't used. > > Coming back to my comment on the earlier version: "not used" isn't true, > but the earlier "not needed" also didn't make clear why it was not needed > (misleading me into making the [wrong] suggestion): The macro is used, > just not in hvmloader/ but in files living in libacpi/ and compiled here > (as well as elsewhere). Ah, okay, I only looked in hvmloader for users. > New suggestion (which I'm happy to apply while committing): "... which > isn't needed, as firmware/include/stddef.h's doesn't really need > overriding". (The same, btw, is true for NULL, so I guess I'll make a > follow-up patch to remove that one as well.) Fine with me. Juergen
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.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 -#undef offsetof -#define offsetof(t, m) ((unsigned long)&((t *)0)->m) - #undef NULL #define NULL ((void*)0)