From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v1] xdrgen: Address some checkpatch whitespace complaints
Date: Mon, 01 Dec 2025 19:51:23 -0500 [thread overview]
Message-ID: <37a72949221d432c7cc48d700ceed03dc38ea32b.camel@kernel.org> (raw)
In-Reply-To: <20251201221946.2680-1-cel@kernel.org>
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>
prev parent reply other threads:[~2025-12-02 0:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 22:19 [PATCH v1] xdrgen: Address some checkpatch whitespace complaints Chuck Lever
2025-12-02 0:51 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37a72949221d432c7cc48d700ceed03dc38ea32b.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).