From patchwork Sat Apr 22 01:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 9694051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A16606038E for ; Sat, 22 Apr 2017 01:22:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91AC228689 for ; Sat, 22 Apr 2017 01:22:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79A4728687; Sat, 22 Apr 2017 01:22:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16BB828687 for ; Sat, 22 Apr 2017 01:22:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1042353AbdDVBWg (ORCPT ); Fri, 21 Apr 2017 21:22:36 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35423 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1427308AbdDVBWb (ORCPT ); Fri, 21 Apr 2017 21:22:31 -0400 Received: by mail-it0-f65.google.com with SMTP id e132so1403325ite.2; Fri, 21 Apr 2017 18:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TxA1iMMtPAqvmjhaRvWEpHB4Ga9uR9lB3ooBl7833+4=; b=ZgA4drsPgEP9hnWxWEBtnvw913wPRB9TS7oiPVQHPlZY1i2mMaVE2IAbenyx4/mVx9 RQffFDuuANkv1FKiumlPzZzVAuKpfmMvXe4Yr0lIrheu3HOSkCklQoIYPvIqIz0ABXiM jT+IZZf7jIvGH9aAeHL4HeaYOb2cXr1LXC8HuKiqwoRF52QDGX2sInSRcO+r3u+MVKPy AYTA/mvX8zlP1zQojXtURWixS87oZi/lQJR+NN9dhVtOI712C+l7zdJ6TS3ITLZxd1jL ECcBfWfbFa0TBOt0TPJuKztZOHiivY+PrFrpOxZut/2kQGxkkvE6A+lHvwNnOJ1n1ytr lWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TxA1iMMtPAqvmjhaRvWEpHB4Ga9uR9lB3ooBl7833+4=; b=di5/UouAVyohNXBpgcu2xJzgl/mr4XlSeKJQ2GWiF/CdPJI1Qk5tuEhlQfcCYuowZB tc2cOftR1PKRysWCb/CYlYxN7uHKga5AhIntFfH+SVcofeBmgoSdNKHC2ipRhbCFjg+a zzcm0HAcngZ8p0fwwrGTgf5bhjpsP7t65XNVuzioj8DjwlY0UOjGNgX3dLsTDjaph2Yp a0ImKwSHo+9mfutm9NIUEtztrtmJW9gYoEtZvHZmM0e6iTCJJyT51Btt/IYiybQM8rqZ 2Av61v2e1rMfo8WWKi/LoSaZF4AyvIWNOli2g4nSoPn/ZDSZWuNqTiDpAUG/JBMDSbg1 1ZPw== X-Gm-Message-State: AN3rC/6U7f4vyZS6ssslm2Nobo2lExp6kR5MfIdlKDrbiwil/0FTbCE9 RuEt62cXy1eZtw== X-Received: by 10.84.241.1 with SMTP id a1mr5788792pll.117.1492824146020; Fri, 21 Apr 2017 18:22:26 -0700 (PDT) Received: from localhost ([162.211.125.117]) by smtp.gmail.com with ESMTPSA id d82sm18051544pfl.124.2017.04.21.18.22.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Apr 2017 18:22:25 -0700 (PDT) From: Geliang Tang To: Juergen Gross , Boris Ostrovsky , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Geliang Tang , xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] xen/scsifront: use offset_in_page() macro Date: Sat, 22 Apr 2017 09:21:13 +0800 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: <4dbc77ccaaed98b183cf4dba58a4fa325fd65048.1492758503.git.geliangtang@gmail.com> References: <4dbc77ccaaed98b183cf4dba58a4fa325fd65048.1492758503.git.geliangtang@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use offset_in_page() macro instead of open-coding. Signed-off-by: Geliang Tang Reviewed-by: Juergen Gross --- drivers/scsi/xen-scsifront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 9aa1fe1..a6a8b60 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -434,7 +434,7 @@ static int map_data_for_request(struct vscsifrnt_info *info, if (seg_grants) { page = virt_to_page(seg); - off = (unsigned long)seg & ~PAGE_MASK; + off = offset_in_page(seg); len = sizeof(struct scsiif_request_segment) * data_grants; while (len > 0) { bytes = min_t(unsigned int, len, PAGE_SIZE - off);