diff mbox series

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

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

Commit Message

Jürgen Groß March 22, 2023, 12:08 p.m. UTC
util.h contains a definition of offsetof(), which isn't needed.

Remove it.

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

Comments

Jan Beulich March 22, 2023, 12:42 p.m. UTC | #1
On 22.03.2023 13:08, Juergen Gross wrote:
> util.h contains a definition of offsetof(), which isn't needed.

While true, this is also ambiguous in the context of this series: It isn't
"not needed" because common-macros.h has another definition, but it is
actually unused in hvmloader code. So perhaps s/needed/used/?

> Remove it.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
Jürgen Groß March 22, 2023, 12:47 p.m. UTC | #2
On 22.03.23 13:42, Jan Beulich wrote:
> On 22.03.2023 13:08, Juergen Gross wrote:
>> util.h contains a definition of offsetof(), which isn't needed.
> 
> While true, this is also ambiguous in the context of this series: It isn't
> "not needed" because common-macros.h has another definition, but it is
> actually unused in hvmloader code. So perhaps s/needed/used/?

Fine with me.

> 
>> Remove it.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 

Thanks,


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)