Message ID | 5c7da4c21a8ba72422567dd157533d062b75024c.1679382779.git.petr.tesarik.ext@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1661379wrt; Tue, 21 Mar 2023 01:47:26 -0700 (PDT) X-Google-Smtp-Source: AK7set+RT1aP/nP9YP3qoWYkPLAdp7Tu51fK7ynDa/LHfke2JkWHV1Kl4Wf1Xj1A9J+tO9iCuwwb X-Received: by 2002:a17:90a:45:b0:23a:8f25:7fd6 with SMTP id 5-20020a17090a004500b0023a8f257fd6mr1822362pjb.29.1679388445790; Tue, 21 Mar 2023 01:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679388445; cv=none; d=google.com; s=arc-20160816; b=iG8QkTkQOidcRTWLKJCl9HaQDew3h/Vf5diUNaLnP4eMqkw7jUtFNs0DXIfTYTXDIR bNNVwaKudRlVfp/NxLi/9e38+ZQxr2aMtUgFcOSuSTGzrDVrdHjYdiZ+0wt/eUDVFseF ejkpNETqEh9Sc/SyEBBr0SucRbONjfgqKbJUU2mT5IjCLU/fxYWSLEfxMjxrHtffqzfh wi5Zm1CJFACMW9F5cDrDDEPGY9LMAP/qyMXDKGc+DsYz0yApKVCWYtqNQTkj1c1q7LMz a3fbOWrd2MdrZ4epmpw8wrla9NX3C5ASHUNdhCSQwMdOjXSU8z03UfDZc3WZWAXSZRjw qnDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wCHf6Vl/DiOs0YULVS18Pfdiu2CU7RdKGztoG6GXQyw=; b=E3wRCAUie2F/Es+v8AnX6UPfc+6m9kSGjlZ1TdMETaIoMCVAeFFUG+m3+ayQU14Xlj Bi2m+qgYcZ8a6/p9vd8IhxL1RdiWx+nu9dSAfnhWlOyxTfYxzVLIObZPysMQoy+9iNwB rS2k3NrCX5BzfmzqZCQR08NJ9MSZCAxwn8IBeBUwHoEAV0o9idWzFxpXMcl3ilUMFeLU ztfgKSG+gUPKmGr0rc5e4axZF7vb6NAuH8D9m5ToiIprunygfnA1VZdfFOjwPLOl4uHt aLiWjhQPM2+CEPQ1XiNNEMLhA0988neXSFowOwnY3xWobIp3j+lCDh46Pl4y4gjefdP0 8ITw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v20-20020a17090a899400b0023ef9514233si12317085pjn.116.2023.03.21.01.47.10; Tue, 21 Mar 2023 01:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjCUIdn (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Tue, 21 Mar 2023 04:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbjCUIdP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Mar 2023 04:33:15 -0400 Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD1618A92 for <linux-kernel@vger.kernel.org>; Tue, 21 Mar 2023 01:32:28 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.227]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4Pgl320Ftzz9v7Yh for <linux-kernel@vger.kernel.org>; Tue, 21 Mar 2023 16:22:38 +0800 (CST) Received: from A2101119013HW2.china.huawei.com (unknown [10.48.151.252]) by APP2 (Coremail) with SMTP id GxC2BwBHHGNkaxlkK1q2AQ--.49312S3; Tue, 21 Mar 2023 09:31:55 +0100 (CET) From: Petr Tesarik <petrtesarik@huaweicloud.com> To: Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, Jianxiong Gao <jxgao@google.com>, David Stevens <stevensd@chromium.org>, Joerg Roedel <jroedel@suse.de>, iommu@lists.linux.dev (open list:DMA MAPPING HELPERS), linux-kernel@vger.kernel.org (open list) Cc: Roberto Sassu <roberto.sassu@huawei.com>, petr@tesarici.cz Subject: [PATCH v1 1/2] swiotlb: Use wrap_area_index() instead of open-coding it Date: Tue, 21 Mar 2023 09:31:26 +0100 Message-Id: <5c7da4c21a8ba72422567dd157533d062b75024c.1679382779.git.petr.tesarik.ext@huawei.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <cover.1679382779.git.petr.tesarik.ext@huawei.com> References: <cover.1679382779.git.petr.tesarik.ext@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GxC2BwBHHGNkaxlkK1q2AQ--.49312S3 X-Coremail-Antispam: 1UD129KBjvdXoWruw1fJw15GF18Ww13AFyxXwb_yoW3KFg_ZF WxXrWv9r4DZr4xZr1xur4ruF4vqw4SgFyfu345XFWUJw1UZr95Z398WF1ktrZxWF1xWF90 vr98Wr4DtF1agjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbHxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4j 6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V C0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j 6r4UM4x0Y48IcxkI7VAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7MxkF7I0En4kS14v26r 1q6r43MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCF54CYxVCY1x0262kK e7AKxVWUtVW8ZwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIx AIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jxsqXUUUUU= X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760966419113271125?= X-GMAIL-MSGID: =?utf-8?q?1760966419113271125?= |
Series |
swiotlb: Cleanup and alignment fix
|
|
Commit Message
Petr Tesarik
March 21, 2023, 8:31 a.m. UTC
From: Petr Tesarik <petr.tesarik.ext@huawei.com> No functional change, just use an existing helper. Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com> --- kernel/dma/swiotlb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 91454b513db0..3856e2b524b4 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -695,10 +695,7 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index, /* * Update the indices to avoid searching in the next round. */ - if (index + nslots < mem->area_nslabs) - area->index = index + nslots; - else - area->index = 0; + area->index = wrap_area_index(mem, index + nslots); area->used += nslots; spin_unlock_irqrestore(&area->lock, flags); return slot_index;