Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b43e0d8a authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Joerg Roedel
Browse files

iommu/ipmmu-vmsa: Make IPMMU_CTX_MAX unsigned



Make the IPMMU_CTX_MAX constant unsigned, to match the type of
ipmmu_features.number_of_contexts.

This allows to use plain min() instead of type-casting min_t().

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 82576aa8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#define arm_iommu_detach_device(...)	do {} while (0)
#endif

#define IPMMU_CTX_MAX 8
#define IPMMU_CTX_MAX 8U

struct ipmmu_features {
	bool use_ns_alias_offset;
@@ -1060,8 +1060,7 @@ static int ipmmu_probe(struct platform_device *pdev)
	if (mmu->features->use_ns_alias_offset)
		mmu->base += IM_NS_ALIAS_OFFSET;

	mmu->num_ctx = min_t(unsigned int, IPMMU_CTX_MAX,
			     mmu->features->number_of_contexts);
	mmu->num_ctx = min(IPMMU_CTX_MAX, mmu->features->number_of_contexts);

	irq = platform_get_irq(pdev, 0);