Skip to content

Commit 8b2818c

Browse files
John Garryjoergroedel
authored andcommitted
iova: Remove magazine BUG_ON() checks
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 <john.garry@huawei.com> Acked-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/1662557681-145906-3-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent a390bde commit 8b2818c

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/iommu/iova.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,6 @@ static unsigned long iova_magazine_pop(struct iova_magazine *mag,
694694
int i;
695695
unsigned long pfn;
696696

697-
BUG_ON(iova_magazine_empty(mag));
698-
699697
/* Only fall back to the rbtree if we have no suitable pfns at all */
700698
for (i = mag->size - 1; mag->pfns[i] > limit_pfn; i--)
701699
if (i == 0)
@@ -710,8 +708,6 @@ static unsigned long iova_magazine_pop(struct iova_magazine *mag,
710708

711709
static void iova_magazine_push(struct iova_magazine *mag, unsigned long pfn)
712710
{
713-
BUG_ON(iova_magazine_full(mag));
714-
715711
mag->pfns[mag->size++] = pfn;
716712
}
717713

0 commit comments

Comments
 (0)