diff mbox series

[v5,3/5] tools/hvmloader: remove private offsetof() definition

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

Commit Message

Jürgen Groß March 23, 2023, 9:08 a.m. UTC
util.h contains a definition of offsetof(), which isn't used.

Remove it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
V4:
- new patch
---
 tools/firmware/hvmloader/util.h | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jan Beulich March 23, 2023, 10:09 a.m. UTC | #1
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
Jürgen Groß March 23, 2023, 10:12 a.m. UTC | #2
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 mbox series

Patch

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)