]> git.baikalelectronics.ru Git - kernel.git/commit
iova: Remove some magazine pointer NULL checks
authorJohn Garry <john.garry@huawei.com>
Wed, 7 Sep 2022 13:34:39 +0000 (21:34 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 9 Sep 2022 07:27:02 +0000 (09:27 +0200)
commit5e9fb34862b9299aede5e7049f6bf69ecef165ca
tree9630d828a5efc5b8bb68f39678c0eb69b261d1fe
parentc57d6a53613ddaec961aff3097d185240a0e8909
iova: Remove some magazine pointer NULL checks

Since commit 0d5029d0a754 ("iommu/iova: Separate out rcache init") it
has not been possible to have NULL CPU rcache "loaded" or "prev" magazine
pointers once the IOVA domain has been properly initialized. Previously it
was only possible to have NULL pointers from failure to allocate the
magazines in the IOVA domain initialization. The only other two functions
to modify these pointers - __iova_rcache_{get, insert}() - would already
ensure that these pointers were non-NULL if initially non-NULL.

As such, the mag NULL pointer checks in iova_magazine_full(),
iova_magazine_empty(), and iova_magazine_free_pfns() may be dropped.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/1662557681-145906-2-git-send-email-john.garry@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iova.c