From patchwork Mon Aug 26 06:34:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2849399 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EBE039F2F4 for ; Mon, 26 Aug 2013 06:34:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9FAC201FB for ; Mon, 26 Aug 2013 06:34:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CC7E201FA for ; Mon, 26 Aug 2013 06:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756008Ab3HZGes (ORCPT ); Mon, 26 Aug 2013 02:34:48 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:52412 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755843Ab3HZGes (ORCPT ); Mon, 26 Aug 2013 02:34:48 -0400 Received: by mail-bk0-f45.google.com with SMTP id mx11so925997bkb.4 for ; Sun, 25 Aug 2013 23:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=+Z/LTkHnBV7+j6I0TSDzh6GR7kK0drvzzZRoqWUbcFA=; b=0aS8UNqNXP4SS5iqauOFa1esEiJemjRVLCm+QJaTJ3sp5SMz1XbsszjWH3gSkOFd8W krUE8cia/FdPzo+8FljlK7a58xV70KDTe3VC/CRbRq2jT43mkFMD6iVuncK7iI5I7dR2 14ls2LoCKO0j78/Fw5trPh5hFPbgrW8FzURGeEuyrUx/s1rxRcvEk/U59S1TRYyJbRAx HDU/tTIvvwsDnO7nrioO9zWODVNhUK4yQ7r30GR2BcC1E7sQ//h6TBRVko9Dnc3ilu4R iv4Q3PYVvDHOpYhd1763GWjos4xcVj/Jg7e8Ik/bvy/0SLEclhEXyGSfx3aPHbsCwhT4 WZkg== MIME-Version: 1.0 X-Received: by 10.205.10.200 with SMTP id pb8mr9011622bkb.16.1377498886946; Sun, 25 Aug 2013 23:34:46 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Sun, 25 Aug 2013 23:34:46 -0700 (PDT) Date: Mon, 26 Aug 2013 14:34:46 +0800 Message-ID: Subject: [PATCH] CIFS: convert to use le32_add_cpu() From: Wei Yongjun To: sfrench@samba.org Cc: yongjun_wei@trendmicro.com.cn, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Convert cpu_to_le32(le32_to_cpu(E1) + E2) to use le32_add_cpu(). Signed-off-by: Wei Yongjun Acked-by: Shirish Pargaonkar --- fs/cifs/smb2pdu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index abc9c28..4ce66bc 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -939,9 +939,7 @@ add_lease_context(struct kvec *iov, unsigned int *num_iovec, __u8 *oplock) req->CreateContextsOffset = cpu_to_le32( sizeof(struct smb2_create_req) - 4 + iov[num - 1].iov_len); - req->CreateContextsLength = cpu_to_le32( - le32_to_cpu(req->CreateContextsLength) + - sizeof(struct create_lease)); + le32_add_cpu(&req->CreateContextsLength, sizeof(struct create_lease)); inc_rfc1001_len(&req->hdr, sizeof(struct create_lease)); *num_iovec = num + 1; return 0; @@ -967,9 +965,7 @@ add_durable_context(struct kvec *iov, unsigned int *num_iovec, req->CreateContextsOffset = cpu_to_le32(sizeof(struct smb2_create_req) - 4 + iov[1].iov_len); - req->CreateContextsLength = - cpu_to_le32(le32_to_cpu(req->CreateContextsLength) + - sizeof(struct create_durable)); + le32_add_cpu(&req->CreateContextsLength, sizeof(struct create_durable)); inc_rfc1001_len(&req->hdr, sizeof(struct create_durable)); *num_iovec = num + 1; return 0;