* [PATCH v1] xdrgen: Address some checkpatch whitespace complaints
@ 2025-12-01 22:19 Chuck Lever
2025-12-02 0:51 ` Jeff Layton
0 siblings, 1 reply; 2+ messages in thread
From: Chuck Lever @ 2025-12-01 22:19 UTC (permalink / raw)
To: NeilBrown, Jeff Layton, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, Chuck Lever
From: Chuck Lever <chuck.lever@oracle.com>
This is a roll-up of three template fixes that eliminate noise from
checkpatch output so that it's easier to spot non-trivial problems.
To follow conventional kernel C style, when a union declaration is
marked with "pragma public", there should be a blank line between
the emitted "union xxx { ... };" and the decoder and encoder
function declarations.
---
CHECK: Please use a blank line after function/struct/union/enum declarations
+};
+typedef enum createmode3 createmode3;
Make xdrgen output more "checkpatch friendly" -- add a blank line
after enum definitions.
---
CHECK: Please don't use multiple blank lines
+
+
Eliminate a source of checkpatch.pl warnings in xdrgen-generated
C header files.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 | 1 -
tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 | 1 +
tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 | 1 +
tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 | 1 +
4 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
index d1405c7c5354..c7ae506076bb 100644
--- a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
+++ b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
@@ -1,4 +1,3 @@
{# SPDX-License-Identifier: GPL-2.0 #}
-
bool xdrgen_decode_{{ name }}(struct xdr_stream *xdr, {{ name }} *ptr);
bool xdrgen_encode_{{ name }}(struct xdr_stream *xdr, {{ name }} value);
diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
index a07586cbee17..446266ad6d17 100644
--- a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
+++ b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
@@ -1,3 +1,4 @@
{# SPDX-License-Identifier: GPL-2.0 #}
};
+
typedef enum {{ name }} {{ name }};
diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
index 2c18948bddf7..cfeee2287e68 100644
--- a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
+++ b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
@@ -1,3 +1,4 @@
{# SPDX-License-Identifier: GPL-2.0 #}
};
+
typedef __be32 {{ name }};
diff --git a/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 b/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
index 01d716d0099e..5fc1937ba774 100644
--- a/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
+++ b/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
@@ -3,6 +3,7 @@
};
{%- if name in public_apis %}
+
bool xdrgen_decode_{{ name }}(struct xdr_stream *xdr, struct {{ name }} *ptr);
bool xdrgen_encode_{{ name }}(struct xdr_stream *xdr, const struct {{ name }} *ptr);
{%- endif -%}
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v1] xdrgen: Address some checkpatch whitespace complaints
2025-12-01 22:19 [PATCH v1] xdrgen: Address some checkpatch whitespace complaints Chuck Lever
@ 2025-12-02 0:51 ` Jeff Layton
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2025-12-02 0:51 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, Chuck Lever
On Mon, 2025-12-01 at 17:19 -0500, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> This is a roll-up of three template fixes that eliminate noise from
> checkpatch output so that it's easier to spot non-trivial problems.
>
> To follow conventional kernel C style, when a union declaration is
> marked with "pragma public", there should be a blank line between
> the emitted "union xxx { ... };" and the decoder and encoder
> function declarations.
>
> ---
>
> CHECK: Please use a blank line after function/struct/union/enum declarations
> +};
> +typedef enum createmode3 createmode3;
>
> Make xdrgen output more "checkpatch friendly" -- add a blank line
> after enum definitions.
>
> ---
>
> CHECK: Please don't use multiple blank lines
> +
> +
>
> Eliminate a source of checkpatch.pl warnings in xdrgen-generated
> C header files.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 | 1 -
> tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 | 1 +
> tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 | 1 +
> tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 | 1 +
> 4 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
> index d1405c7c5354..c7ae506076bb 100644
> --- a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
> +++ b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2
> @@ -1,4 +1,3 @@
> {# SPDX-License-Identifier: GPL-2.0 #}
> -
> bool xdrgen_decode_{{ name }}(struct xdr_stream *xdr, {{ name }} *ptr);
> bool xdrgen_encode_{{ name }}(struct xdr_stream *xdr, {{ name }} value);
> diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
> index a07586cbee17..446266ad6d17 100644
> --- a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
> +++ b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2
> @@ -1,3 +1,4 @@
> {# SPDX-License-Identifier: GPL-2.0 #}
> };
> +
> typedef enum {{ name }} {{ name }};
> diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
> index 2c18948bddf7..cfeee2287e68 100644
> --- a/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
> +++ b/tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2
> @@ -1,3 +1,4 @@
> {# SPDX-License-Identifier: GPL-2.0 #}
> };
> +
> typedef __be32 {{ name }};
> diff --git a/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 b/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
> index 01d716d0099e..5fc1937ba774 100644
> --- a/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
> +++ b/tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2
> @@ -3,6 +3,7 @@
> };
> {%- if name in public_apis %}
>
> +
> bool xdrgen_decode_{{ name }}(struct xdr_stream *xdr, struct {{ name }} *ptr);
> bool xdrgen_encode_{{ name }}(struct xdr_stream *xdr, const struct {{ name }} *ptr);
> {%- endif -%}
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-02 0:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 22:19 [PATCH v1] xdrgen: Address some checkpatch whitespace complaints Chuck Lever
2025-12-02 0:51 ` Jeff Layton
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).