Skip to content

Commit e609e38

Browse files
GustavoARSilvachucklever
authored andcommitted
NFSD: Avoid multiple -Wflex-array-member-not-at-end warnings
Replace flexible-array member with a fixed-size array. With this changes, fix many instances of the following type of warnings: fs/nfsd/nfsfh.h:79:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] fs/nfsd/state.h:763:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] fs/nfsd/state.h:669:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] fs/nfsd/state.h:549:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] fs/nfsd/xdr4.h:705:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] fs/nfsd/xdr4.h:678:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 3f3503a commit e609e38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfsd/nfsfh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct knfsd_fh {
5656
u8 fh_auth_type; /* deprecated */
5757
u8 fh_fsid_type;
5858
u8 fh_fileid_type;
59-
u32 fh_fsid[]; /* flexible-array member */
59+
u32 fh_fsid[NFS4_FHSIZE / 4 - 1];
6060
};
6161
};
6262
};

0 commit comments

Comments
 (0)