diff mbox series

[net-next,v2] net: gro: Fix a 'directive in macro's argument list' sparse warning

Message ID 20220217080755.19195-1-gal@nvidia.com (mailing list archive)
State Accepted
Commit 8467fadc115cb08bb1cbc7885cb7b7ef1871cae4
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: gro: Fix a 'directive in macro's argument list' sparse warning | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 60 this patch: 20
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 67 this patch: 25
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Gal Pressman Feb. 17, 2022, 8:07 a.m. UTC
Following the cited commit, sparse started complaining about:
../include/net/gro.h:58:1: warning: directive in macro's argument list
../include/net/gro.h:59:1: warning: directive in macro's argument list

Fix that by moving the defines out of the struct_group() macro.

Fixes: de5a1f3ce4c8 ("net: gro: minor optimization for dev_gro_receive()")
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Acked-by: Alexander Lobakin <alexandr.lobakin@intel.com>
---
Changelog -
v1->v2: https://lore.kernel.org/netdev/20220216103100.9489-1-gal@nvidia.com/
* Add a comment and fix alignment
---
 include/net/gro.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Paolo Abeni Feb. 17, 2022, 9:36 a.m. UTC | #1
On Thu, 2022-02-17 at 10:07 +0200, Gal Pressman wrote:
> Following the cited commit, sparse started complaining about:
> ../include/net/gro.h:58:1: warning: directive in macro's argument list
> ../include/net/gro.h:59:1: warning: directive in macro's argument list
> 
> Fix that by moving the defines out of the struct_group() macro.
> 
> Fixes: de5a1f3ce4c8 ("net: gro: minor optimization for dev_gro_receive()")
> Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
> Signed-off-by: Gal Pressman <gal@nvidia.com>
> Acked-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> ---
> Changelog -
> v1->v2: https://lore.kernel.org/netdev/20220216103100.9489-1-gal@nvidia.com/
> * Add a comment and fix alignment
> ---
>  include/net/gro.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/gro.h b/include/net/gro.h
> index a765fedda5c4..867656b0739c 100644
> --- a/include/net/gro.h
> +++ b/include/net/gro.h
> @@ -35,6 +35,9 @@ struct napi_gro_cb {
>  	/* jiffies when first packet was created/queued */
>  	unsigned long age;
>  
> +/* Used in napi_gro_cb::free */
> +#define NAPI_GRO_FREE             1
> +#define NAPI_GRO_FREE_STOLEN_HEAD 2
>  	/* portion of the cb set to zero at every gro iteration */
>  	struct_group(zeroed,
>  
> @@ -55,8 +58,6 @@ struct napi_gro_cb {
>  
>  		/* Free the skb? */
>  		u8	free:2;
> -#define NAPI_GRO_FREE		  1
> -#define NAPI_GRO_FREE_STOLEN_HEAD 2
>  
>  		/* Used in foo-over-udp, set in udp[46]_gro_receive */
>  		u8	is_ipv6:1;

LGTM, thanks!

Acked-by: Paolo Abeni <pabeni@redhat.com>
patchwork-bot+netdevbpf@kernel.org Feb. 18, 2022, 11:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 17 Feb 2022 10:07:55 +0200 you wrote:
> Following the cited commit, sparse started complaining about:
> ../include/net/gro.h:58:1: warning: directive in macro's argument list
> ../include/net/gro.h:59:1: warning: directive in macro's argument list
> 
> Fix that by moving the defines out of the struct_group() macro.
> 
> Fixes: de5a1f3ce4c8 ("net: gro: minor optimization for dev_gro_receive()")
> Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
> Signed-off-by: Gal Pressman <gal@nvidia.com>
> Acked-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: gro: Fix a 'directive in macro's argument list' sparse warning
    https://git.kernel.org/netdev/net-next/c/8467fadc115c

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/gro.h b/include/net/gro.h
index a765fedda5c4..867656b0739c 100644
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -35,6 +35,9 @@  struct napi_gro_cb {
 	/* jiffies when first packet was created/queued */
 	unsigned long age;
 
+/* Used in napi_gro_cb::free */
+#define NAPI_GRO_FREE             1
+#define NAPI_GRO_FREE_STOLEN_HEAD 2
 	/* portion of the cb set to zero at every gro iteration */
 	struct_group(zeroed,
 
@@ -55,8 +58,6 @@  struct napi_gro_cb {
 
 		/* Free the skb? */
 		u8	free:2;
-#define NAPI_GRO_FREE		  1
-#define NAPI_GRO_FREE_STOLEN_HEAD 2
 
 		/* Used in foo-over-udp, set in udp[46]_gro_receive */
 		u8	is_ipv6:1;