Trivial endian fixes
authorSteve French <smfrench@gmail.com>
Wed, 19 Sep 2012 16:19:39 +0000 (09:19 -0700)
committerSteve French <smfrench@gmail.com>
Tue, 25 Sep 2012 02:46:34 +0000 (21:46 -0500)
Some trivial endian fixes for the SMB2 code. One
warning remains which I asked Pavel to look at.

Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/smb2misc.c
fs/cifs/smb2ops.c

index cd31715f03f4e497195e83a3ebd4bcae321e8b60..7b1c5e3287fb513a35056b59fc199845f57c0ffd 100644 (file)
@@ -422,7 +422,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
        struct cifs_pending_open *open;
        struct smb2_lease_break_work *lw;
        bool found;
-       int ack_req = rsp->Flags & SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED;
+       int ack_req = le32_to_cpu(rsp->Flags &
+                                 SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED);
 
        lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL);
        if (!lw) {
@@ -524,7 +525,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
        if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
                return false;
 
-       if (le16_to_cpu(rsp->StructureSize) !=
+       if (rsp->StructureSize !=
                                smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) {
                if (le16_to_cpu(rsp->StructureSize) == 44)
                        return smb2_is_valid_lease_break(buffer, server);
index 630156f98cc70489b55065e1ca140601cd9a31d5..2183bb343edd157e924ea2f892ec3e42b06ea1b4 100644 (file)
@@ -496,7 +496,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)
 {
        struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
 
-       if (le32_to_cpu(hdr->Status) != STATUS_PENDING)
+       if (hdr->Status != STATUS_PENDING)
                return false;
 
        if (!length) {