From patchwork Fri Sep 28 04:49:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1516881 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3BA21DF283 for ; Fri, 28 Sep 2012 04:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410Ab2I1Etw (ORCPT ); Fri, 28 Sep 2012 00:49:52 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:47927 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272Ab2I1Etw (ORCPT ); Fri, 28 Sep 2012 00:49:52 -0400 Received: by qchd3 with SMTP id d3so1648815qch.19 for ; Thu, 27 Sep 2012 21:49:51 -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=JrXtH5S+EU8SqTy9fIl+8WmjJ4MjB3VBLQ+3l0GDLp0=; b=xLg40kBcRXA1W+ns3cKaakUvanHX28vh6nlHDyyCjVJel3PJSfh5r8ObF1re8tRsDP F6tibMDo8z6AsC3/j2UGttxFVDKBy9AV70Ww34zdy8FfgcXyen575PRc2dQBOTSs+F4k +kkko6ZQPqsUK7RwyDFL324eNC117mPwkExdzlfYDvR8+F8vn6bLrDceKkTZMEVW/RT5 QO92veCVdkjU1b3LRVUxc+V0AololkIfaV+UDlVqr8CAMjw/hh4gfax9eqCuEjjzCcMz NNgaKmzzati8gad2II03KsDtz/BmJdm4McKvYSu6Mj6ILz7SwZR73R7G2tnoMNfVWFBk wOOw== MIME-Version: 1.0 Received: by 10.229.134.200 with SMTP id k8mr3832302qct.135.1348807791414; Thu, 27 Sep 2012 21:49:51 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 27 Sep 2012 21:49:51 -0700 (PDT) Date: Fri, 28 Sep 2012 12:49:51 +0800 Message-ID: Subject: [PATCH] CIFS: convert to use be32_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 From: Wei Yongjun Convert cpu_to_be32(be32_to_cpu(E1) + E2) to use be32_add_cpu(). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- fs/cifs/sess.c | 3 +-- fs/cifs/connect.c | 3 +-- 2 files changed, 2 insertions(+), 4 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/sess.c b/fs/cifs/sess.c index 382c06d..148ac5c 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -864,8 +864,7 @@ ssetup_ntlmssp_authenticate: iov[2].iov_len = (long) bcc_ptr - (long) str_area; count = iov[1].iov_len + iov[2].iov_len; - smb_buf->smb_buf_length = - cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count); + be32_add_cpu(&smb_buf->smb_buf_length, count); put_bcc(count, smb_buf); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 6df6fa1..e8e7011 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3863,8 +3863,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, bcc_ptr += strlen("?????"); bcc_ptr += 1; count = bcc_ptr - &pSMB->Password[0]; - pSMB->hdr.smb_buf_length = cpu_to_be32(be32_to_cpu( - pSMB->hdr.smb_buf_length) + count); + be32_add_cpu(&pSMB->hdr.smb_buf_length, count); pSMB->ByteCount = cpu_to_le16(count); rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,