From nobody Mon Apr 6 18:43:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6652FECAAA1 for ; Mon, 5 Sep 2022 09:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237015AbiIEJR5 (ORCPT ); Mon, 5 Sep 2022 05:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236681AbiIEJRy (ORCPT ); Mon, 5 Sep 2022 05:17:54 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95BCC3C8DB for ; Mon, 5 Sep 2022 02:17:53 -0700 (PDT) Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLjZv0Pn1z67xgN; Mon, 5 Sep 2022 17:17:11 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 11:17:51 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 10:17:49 +0100 From: John Garry To: , , CC: , , , John Garry Subject: [PATCH v2 1/2] iova: Remove some magazine pointer NULL checks Date: Mon, 5 Sep 2022 17:11:22 +0800 Message-ID: <1662369083-238529-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662369083-238529-1-git-send-email-john.garry@huawei.com> References: <1662369083-238529-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 32e92d9f6f87 ("iommu/iova: Separate out rcache init") it has not been possible to have NULL CPU rcache "loaded" or "prev" magazine pointers. As such, the checks in iova_magazine_full(), iova_magazine_empty(), and iova_magazine_free_pfns() may be dropped. Signed-off-by: John Garry Reviewed-by: Robin Murphy Reviewed-by: Jerry Snitselaar iova_rbtree_lock, flags); =20 for (i =3D 0 ; i < mag->size; ++i) { @@ -683,12 +680,12 @@ iova_magazine_free_pfns(struct iova_magazine *mag, st= ruct iova_domain *iovad) =20 static bool iova_magazine_full(struct iova_magazine *mag) { - return (mag && mag->size =3D=3D IOVA_MAG_SIZE); + return mag->size =3D=3D IOVA_MAG_SIZE; } =20 static bool iova_magazine_empty(struct iova_magazine *mag) { - return (!mag || mag->size =3D=3D 0); + return mag->size =3D=3D 0; } =20 static unsigned long iova_magazine_pop(struct iova_magazine *mag, --=20 2.35.3