From ff88825fbb9f5a503164bb5ad4a8c65dabfa13e0 Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Mon, 6 Jan 2014 11:28:41 +0800 Subject: NFSD: fix compile warning without CONFIG_NFSD_V3 Without CONFIG_NFSD_V3, compile will get warning as, fs/nfsd/nfssvc.c: In function 'nfsd_svc': >> fs/nfsd/nfssvc.c:246:60: warning: array subscript is above array bounds [-Warray-bounds] return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); ^ Reported-by: kbuild test robot Signed-off-by: Kinglong Mee Signed-off-by: J. Bruce Fields --- fs/nfsd/nfssvc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/nfsd') diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 55b5b57b5715..9a4a5f9e7468 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -243,7 +243,11 @@ static void nfsd_shutdown_generic(void) static bool nfsd_needs_lockd(void) { +#if defined(CONFIG_NFSD_V3) return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); +#else + return (nfsd_versions[2] != NULL); +#endif } static int nfsd_startup_net(int nrservs, struct net *net) -- cgit v1.2.3