NFSD: hide unused svcxdr_dupstr()
Subsystems (2)
PATCH 1/1 NFSD: hide unused svcxdr_dupstr()
There is now only one caller left for svcxdr_dupstr() and this is inside of an #ifdef, so we can get a warning when the option is disabled:
fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used [-Werror=unused-function]
This adds another #ifdef around the definition.
--- fs/nfsd/nfs4xdr.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfsd/nfs4xdr.c +2 -0
@@ -237,6 +237,7 @@ svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, u32 len)* Note null-terminating in place usually isn't safe since the * buffer might end on a page boundary. */ +#ifdef CONFIG_NFSD_V4_SECURITY_LABEL static char *svcxdr_dupstr (struct nfsd4_compoundargs *argp,void *buf,u32 len) {
@@ -248,6 +249,7 @@ svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len) p[len] ='\0' ; return p; } +#endif /** * savemem - duplicate a chunk of memory for later processing
Signature · 1 line
2.9.0
Quoted 5 lines · Arnd Bergmann
=20
There is now only one caller left forsvcxdr_dupstr()and this is =
inside
Quoted 3 lines
of an #ifdef, so we can get a warning when the option is disabled:
=20fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used =
[-Werror=3Dunused-function]
Quoted 5 lines
=20
This adds another #ifdef around the definition.
=20Fixes e40d99e6183e ("NFSD: Clean up symlink argument XDR decoders")Signed-off-by Arnd Bergmann <[email protected]>
Seems OK to me, and sorry for the noise.
fs/nfsd/nfs4xdr.c svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, =
Quoted 9 lines
---
fs/nfsd/nfs4xdr.c| 2 ++1 file changed, 2 insertions(+)=20
fs/nfsd/nfs4xdr.c +0
-0@@ -237,6 +237,7 @@ svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, =
u32 len)
fs/nfsd/nfs4xdr.c svcxdr_dupstr(struct nfsd4_compoundargs *argp, =
Quoted 8 lines
fs/nfsd/nfs4xdr.c +1
-0* Note null-terminating in place usually isn't safe since the * buffer might end on a page boundary. */ +#ifdef CONFIG_NFSD_V4_SECURITY_LABEL static char *
svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len){fs/nfsd/nfs4xdr.c +0
-0@@ -248,6 +249,7 @@ svcxdr_dupstr(struct nfsd4_compoundargs *argp, =
void *buf, u32 len)
Quoted 4 lines
fs/nfsd/nfs4xdr.c +1
-0p[len] =3D '\0'; return p; } +#endif
Quoted 8 lines
=20
/**
* savemem - duplicate a chunk of memory for later processing
--=20
2.9.0
=20
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Chuck Lever
Quoted 9 lines · Chuck Lever
Quoted 9 lines · Arnd Bergmann
There is now only one caller left for
svcxdr_dupstr()and this is inside of an #ifdef, so we can get a warning when the option is disabled:
fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used [-Werror=unused-function]
Quoted 8 lines
Quoted 4 lines
This adds another #ifdef around the definition.
Fixes e40d99e6183e ("NFSD: Clean up symlink argument XDR decoders")Signed-off-by Arnd Bergmann <[email protected]>Seems OK to me, and sorry for the noise.
Reviewed-by Chuck Lever <[email protected]>
Thanks!
--b.
Quoted 38 lines
Quoted 33 lines
---
fs/nfsd/nfs4xdr.c| 2 ++1 file changed, 2 insertions(+)fs/nfsd/nfs4xdr.c +1
-0@@ -237,6 +237,7 @@ svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, u32 len)* Note null-terminating in place usually isn't safe since the * buffer might end on a page boundary. */ +#ifdef CONFIG_NFSD_V4_SECURITY_LABEL static char *
svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len){fs/nfsd/nfs4xdr.c +1
-0@@ -248,6 +249,7 @@ svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len) p[len] ='\0' ; return p; } +#endif /** * savemem - duplicate a chunk of memory for later processing Signature · 6 lines
2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html--
Chuck Lever
Quoted 6 lines · Arnd Bergmann
There is now only one caller left for
svcxdr_dupstr()and this is inside of an #ifdef, so we can get a warning when the option is disabled:
fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used [-Werror=unused-function]This adds another #ifdef around the definition.
Why not instead do
-#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
- if (bmval[2] & FATTR4_WORD2_SECURITY_LABEL) {
+ if (IS_ENABLED(CONFIG_NFSD_V4_SECURITY_LABEL) && bmval[2] &FATTR4_WORD2_SECURITY_LABEL)
(sorry for whitespace damage, not a real patch).
Rasmus
Quoted 15 lines · Rasmus Villemoes
Quoted 6 lines · Arnd Bergmann
There is now only one caller left for
svcxdr_dupstr()and this is inside of an #ifdef, so we can get a warning when the option is disabled:
fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used [-Werror=unused-function]This adds another #ifdef around the definition.
Why not instead do
(quoted diff) +1
-2-#ifdef CONFIG_NFSD_V4_SECURITY_LABEL - if (bmval[2] & FATTR4_WORD2_SECURITY_LABEL) { + if (IS_ENABLED(CONFIG_NFSD_V4_SECURITY_LABEL) && bmval[2] &
FATTR4_WORD2_SECURITY_LABEL)
Quoted 1 line
(sorry for whitespace damage, not a real patch).
That'd be OK with me too.
--b.