2024-04-17 08:01:18

by Saurabh Singh Sengar

[permalink] [raw]
Subject: [PATCH] tools: hv: suppress the invalid warning for packed member alignment

Packed struct vmbus_bufring is 4096 byte aligned and the reporting
warning is for the first member of that struct which shouldn't add
any offset to create alignment issue.

Suppress the warning by adding -Wno-address-of-packed-member flag to
gcc.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Saurabh Sengar <[email protected]>
---
tools/hv/Makefile | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index bb52871da341..2e60e2c212cd 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -17,6 +17,7 @@ endif
MAKEFLAGS += -r

override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += -Wno-address-of-packed-member

ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
ifneq ($(ARCH), aarch64)
--
2.34.1



2024-04-17 08:17:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] tools: hv: suppress the invalid warning for packed member alignment

On Wed, Apr 17, 2024 at 01:00:48AM -0700, Saurabh Sengar wrote:
> Packed struct vmbus_bufring is 4096 byte aligned and the reporting
> warning is for the first member of that struct which shouldn't add
> any offset to create alignment issue.
>
> Suppress the warning by adding -Wno-address-of-packed-member flag to
> gcc.
>
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Saurabh Sengar <[email protected]>

What commit id does this fix?

thanks,

greg k-h

2024-04-17 08:22:08

by Saurabh Singh Sengar

[permalink] [raw]
Subject: Re: [PATCH] tools: hv: suppress the invalid warning for packed member alignment

On Wed, Apr 17, 2024 at 10:17:21AM +0200, Greg KH wrote:
> On Wed, Apr 17, 2024 at 01:00:48AM -0700, Saurabh Sengar wrote:
> > Packed struct vmbus_bufring is 4096 byte aligned and the reporting
> > warning is for the first member of that struct which shouldn't add
> > any offset to create alignment issue.
> >
> > Suppress the warning by adding -Wno-address-of-packed-member flag to
> > gcc.
> >
> > Reported-by: kernel test robot <[email protected]>
> > Closes: https://lore.kernel.org/all/[email protected]/
> > Signed-off-by: Saurabh Sengar <[email protected]>
>
> What commit id does this fix?

Fixes: 45bab4d74651 ("tools: hv: Add vmbus_bufring")

- Saurabh