Skip to contentSkip to conversation

NFSD: hide unused svcxdr_dupstr()

PATCH Applied Arnd Bergmann 2 participants 2 messages Jan 22, 2018 – Jan 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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 changes the remaining caller to use a nicer IS_ENABLED() check, which lets the compiler drop the unused code silently.

Fixes e40d99e6183e ("NFSD: Clean up symlink argument XDR decoders")

---
v2: use IS_ENABLED() instead of an #ifdef

---
 fs/nfsd/nfs4xdr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/nfsd/nfs4xdr.c +2 -3
index f51c9cccaf78..86a1a2450376 100644
@@ -455,8 +455,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 	}
 
 	label->len = 0;
-#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) {
 		READ_BUF(4);
 		len += 4;
 		dummy32 = be32_to_cpup(p++); /* lfs: we don't use it */
@@ -476,7 +476,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 		if (!label->data)
 			return nfserr_jukebox;
 	}
-#endif
 	if (bmval[2] & FATTR4_WORD2_MODE_UMASK) {
 		if (!umask)
 			goto xdr_error;
Signature · 1 line
2.9.0
#1 lore raw

Thanks, applied.--b.

Quoted 42 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 changes the remaining caller to use a nicer IS_ENABLED() check, which lets the compiler drop the unused code silently.

Fixes e40d99e6183e ("NFSD: Clean up symlink argument XDR decoders")

---
v2: use IS_ENABLED() instead of an #ifdef

---
 fs/nfsd/nfs4xdr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/nfsd/nfs4xdr.c +2 -3
index f51c9cccaf78..86a1a2450376 100644
@@ -455,8 +455,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 	}
 
 	label->len = 0;
-#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) {
 		READ_BUF(4);
 		len += 4;
 		dummy32 = be32_to_cpup(p++); /* lfs: we don't use it */
@@ -476,7 +476,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
 		if (!label->data)
 			return nfserr_jukebox;
 	}
-#endif
 	if (bmval[2] & FATTR4_WORD2_MODE_UMASK) {
 		if (!umask)
 			goto xdr_error;
Signature · 1 line
2.9.0