xdrgen: Address some checkpatch whitespace complaints
Subsystems (3)
Chuck Lever
maintainerPATCH 1/1 xdrgen: Address some checkpatch whitespace complaints
From: Chuck Lever <[email protected]>
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.
--- 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(-)
tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 +0 -1
@@ -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);
tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 +1 -0
@@ -1,3 +1,4 @@ {# SPDX-License-Identifier: GPL-2.0 #} }; + typedef enum {{ name }} {{ name }};
tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 +1 -0
@@ -1,3 +1,4 @@ {# SPDX-License-Identifier: GPL-2.0 #} }; + typedef __be32 {{ name }};
tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 +1 -0
@@ -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 -%}
Signature · 1 line
2.52.0
Quoted 68 lines · Chuck Lever
From: Chuck Lever <[email protected]>
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
(quoted diff) +2
-0+}; +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
(quoted diff) +2
-0+ +Eliminate a source of checkpatch.pl warnings in xdrgen-generated C header files.
Signed-off-by Chuck Lever <[email protected]>--- 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(-)tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 +0
-1@@ -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);tools/net/sunrpc/xdrgen/templates/C/enum/definition/close.j2 +1
-0@@ -1,3 +1,4 @@ {# SPDX-License-Identifier: GPL-2.0 #} }; + typedef enum {{ name }} {{ name }};tools/net/sunrpc/xdrgen/templates/C/enum/definition/close_be.j2 +1
-0@@ -1,3 +1,4 @@ {# SPDX-License-Identifier: GPL-2.0 #} }; + typedef __be32 {{ name }};tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 +0
-0
tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 line 9
Quoted 7 lines
tools/net/sunrpc/xdrgen/templates/C/union/definition/close.j2 +1
-0@@ -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 -%}