netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib: packing: Include necessary headers
@ 2025-06-24 13:50 Nathan Lynch via B4 Relay
  2025-06-25 21:00 ` Vladimir Oltean
  2025-06-25 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Lynch via B4 Relay @ 2025-06-24 13:50 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: netdev, linux-kernel, Nathan Lynch

From: Nathan Lynch <nathan.lynch@amd.com>

packing.h uses ARRAY_SIZE(), BUILD_BUG_ON_MSG(), min(), max(), and
sizeof_field() without including the headers where they are defined,
potentially causing build failures.

Fix this in packing.h and sort the result.

Signed-off-by: Nathan Lynch <nathan.lynch@amd.com>
---
 include/linux/packing.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/packing.h b/include/linux/packing.h
index 0589d70bbe0434c418f41b842f92b3300a107762..20ae4d452c7bb4069eb625ba332d617c2a840193 100644
--- a/include/linux/packing.h
+++ b/include/linux/packing.h
@@ -5,8 +5,12 @@
 #ifndef _LINUX_PACKING_H
 #define _LINUX_PACKING_H
 
-#include <linux/types.h>
+#include <linux/array_size.h>
 #include <linux/bitops.h>
+#include <linux/build_bug.h>
+#include <linux/minmax.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
 
 #define GEN_PACKED_FIELD_STRUCT(__type) \
 	struct packed_field_ ## __type { \

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250624-packing-includes-5d544b1efd86

Best regards,
-- 
Nathan Lynch <nathan.lynch@amd.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: packing: Include necessary headers
  2025-06-24 13:50 [PATCH] lib: packing: Include necessary headers Nathan Lynch via B4 Relay
@ 2025-06-25 21:00 ` Vladimir Oltean
  2025-06-25 22:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2025-06-25 21:00 UTC (permalink / raw)
  To: nathan.lynch, Jakub Kicinski, Paolo Abeni; +Cc: netdev, linux-kernel

On Tue, Jun 24, 2025 at 08:50:44AM -0500, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathan.lynch@amd.com>
> 
> packing.h uses ARRAY_SIZE(), BUILD_BUG_ON_MSG(), min(), max(), and
> sizeof_field() without including the headers where they are defined,
> potentially causing build failures.
> 
> Fix this in packing.h and sort the result.
> 
> Signed-off-by: Nathan Lynch <nathan.lynch@amd.com>
> ---
>  include/linux/packing.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/packing.h b/include/linux/packing.h
> index 0589d70bbe0434c418f41b842f92b3300a107762..20ae4d452c7bb4069eb625ba332d617c2a840193 100644
> --- a/include/linux/packing.h
> +++ b/include/linux/packing.h
> @@ -5,8 +5,12 @@
>  #ifndef _LINUX_PACKING_H
>  #define _LINUX_PACKING_H
>  
> -#include <linux/types.h>
> +#include <linux/array_size.h>
>  #include <linux/bitops.h>
> +#include <linux/build_bug.h>
> +#include <linux/minmax.h>
> +#include <linux/stddef.h>
> +#include <linux/types.h>
>  
>  #define GEN_PACKED_FIELD_STRUCT(__type) \
>  	struct packed_field_ ## __type { \
> 
> ---
> base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
> change-id: 20250624-packing-includes-5d544b1efd86
> 
> Best regards,
> -- 
> Nathan Lynch <nathan.lynch@amd.com>
> 
> 

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

I assume this patch is not necessary for stable kernels, I haven't
noticed any build breakage report in the packing integrations thus far.

Netdev maintainers, can you pick this patch up via net-next? All past
contributions to packing went through networking. Let me see if I can
revive it in patchwork.

pw-bot: under-review

Nathan, if netdev maintainers don't respond within 24 hours, can you
please post a v2 of this patch explicitly targeting the net-next tree,
as per Documentation/process/maintainer-netdev.rst?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: packing: Include necessary headers
  2025-06-24 13:50 [PATCH] lib: packing: Include necessary headers Nathan Lynch via B4 Relay
  2025-06-25 21:00 ` Vladimir Oltean
@ 2025-06-25 22:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-25 22:50 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: olteanv, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 24 Jun 2025 08:50:44 -0500 you wrote:
> From: Nathan Lynch <nathan.lynch@amd.com>
> 
> packing.h uses ARRAY_SIZE(), BUILD_BUG_ON_MSG(), min(), max(), and
> sizeof_field() without including the headers where they are defined,
> potentially causing build failures.
> 
> Fix this in packing.h and sort the result.
> 
> [...]

Here is the summary with links:
  - lib: packing: Include necessary headers
    https://git.kernel.org/netdev/net-next/c/8bd0af3154b2

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-25 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 13:50 [PATCH] lib: packing: Include necessary headers Nathan Lynch via B4 Relay
2025-06-25 21:00 ` Vladimir Oltean
2025-06-25 22:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).