diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifspdu.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index 291d735abaac..de3aa285de03 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -428,9 +428,12 @@ struct smb_hdr { | |||
428 | __u8 WordCount; | 428 | __u8 WordCount; |
429 | } __attribute__((packed)); | 429 | } __attribute__((packed)); |
430 | 430 | ||
431 | /* given a pointer to an smb_hdr retrieve a char pointer to the byte count */ | 431 | /* given a pointer to an smb_hdr, retrieve a void pointer to the ByteCount */ |
432 | #define BCC(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + \ | 432 | static inline void * |
433 | (2 * (smb_var)->WordCount)) | 433 | BCC(struct smb_hdr *smb) |
434 | { | ||
435 | return (void *)smb + sizeof(*smb) + 2 * smb->WordCount; | ||
436 | } | ||
434 | 437 | ||
435 | /* given a pointer to an smb_hdr retrieve the pointer to the byte area */ | 438 | /* given a pointer to an smb_hdr retrieve the pointer to the byte area */ |
436 | #define pByteArea(smb_var) (BCC(smb_var) + 2) | 439 | #define pByteArea(smb_var) (BCC(smb_var) + 2) |