From nobody Mon Apr 6 18:49:23 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 08DA3ECAAA1 for ; Mon, 5 Sep 2022 09:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237453AbiIEJSA (ORCPT ); Mon, 5 Sep 2022 05:18:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237150AbiIEJR5 (ORCPT ); Mon, 5 Sep 2022 05:17:57 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17FEE3D589 for ; Mon, 5 Sep 2022 02:17:56 -0700 (PDT) Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLjW76yYLz689NN; Mon, 5 Sep 2022 17:13:55 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml707-chm.china.huawei.com (10.206.15.35) 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:54 +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:51 +0100 From: John Garry To: , , CC: , , , John Garry Subject: [PATCH v2 2/2] iova: Remove magazine BUG_ON() checks Date: Mon, 5 Sep 2022 17:11:23 +0800 Message-ID: <1662369083-238529-3-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" Two of the magazine helpers have BUG_ON() checks, as follows: - iova_magazine_pop() - here we ensure that the mag is not empty. However we already ensure that in the only caller, __iova_rcache_get(). - iova_magazine_push() - here we ensure that the mag is not full. However we already ensure that in the only caller, __iova_rcache_insert(). As described, the two bug checks are pointless so drop them. Signed-off-by: John Garry Acked-by: Robin Murphy Reviewed-by: Jerry Snitselaar size - 1; mag->pfns[i] > limit_pfn; i--) if (i =3D=3D 0) @@ -710,8 +708,6 @@ static unsigned long iova_magazine_pop(struct iova_maga= zine *mag, =20 static void iova_magazine_push(struct iova_magazine *mag, unsigned long pf= n) { - BUG_ON(iova_magazine_full(mag)); - mag->pfns[mag->size++] =3D pfn; } =20 --=20 2.35.3