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

Juergen Gross posted 5 patches 2 years, 10 months ago
There is a newer version of this series
[PATCH v4 3/5] tools/hvmloader: remove private offsetof() definition
Posted by Juergen Gross 2 years, 10 months ago
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(-)

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)
 
-- 
2.35.3
Re: [PATCH v4 3/5] tools/hvmloader: remove private offsetof() definition
Posted by Jan Beulich 2 years, 10 months ago
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>
Re: [PATCH v4 3/5] tools/hvmloader: remove private offsetof() definition
Posted by Juergen Gross 2 years, 10 months ago
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