cifs: silence compiler warnings showing up with gcc-4.7.0
authorJeff Layton <jlayton@redhat.com>
Mon, 26 Mar 2012 13:55:29 +0000 (09:55 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:41 +0000 (13:34 +0000)
commit8434628c8fcfbce59c78b2a48d2e405e901c19d3
tree813ffc2564e18044d5f9722f09d105adf484f7e7
parentd30a95ae76d94760d8b8f9e5c244939772df14c2
cifs: silence compiler warnings showing up with gcc-4.7.0

commit b2a3ad9ca502169fc4c11296fa20f56059c7c031 upstream.

gcc-4.7.0 has started throwing these warnings when building cifs.ko.

  CC [M]  fs/cifs/cifssmb.o
fs/cifs/cifssmb.c: In function ‘CIFSSMBSetCIFSACL’:
fs/cifs/cifssmb.c:3905:9: warning: array subscript is above array bounds [-Warray-bounds]
fs/cifs/cifssmb.c: In function ‘CIFSSMBSetFileInfo’:
fs/cifs/cifssmb.c:5711:8: warning: array subscript is above array bounds [-Warray-bounds]
fs/cifs/cifssmb.c: In function ‘CIFSSMBUnixSetFileInfo’:
fs/cifs/cifssmb.c:6001:25: warning: array subscript is above array bounds [-Warray-bounds]

This patch cleans up the code a bit by using the offsetof macro instead
of the funky "&pSMB->hdr.Protocol" construct.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/cifssmb.c