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)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 28 Feb 2016 01:55:13 +0000 (03:55 +0200)
commitabd055c1d280a628f425b2bd1f6fa59be90f3a00
tree82039d8e9857cbb3cb893a68004c84f1965dd43a
parenta7254e99066b2f71d014f144d86d08635b5b1398
cifs: silence compiler warnings showing up with gcc-4.7.0

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>
fs/cifs/cifssmb.c