• Jeff Layton's avatar
    cifs: silence compiler warnings showing up with gcc-4.7.0 · b2a3ad9c
    Jeff Layton authored
    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: default avatarJeff Layton <jlayton@redhat.com>
    Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
    b2a3ad9c
cifssmb.c 191 KB