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

Juergen Gross posted 5 patches 2 years, 10 months ago
[PATCH v5 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 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(-)

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