Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp700385imp; Wed, 20 Feb 2019 07:32:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IaN2JLXNrN/jlVLW47mhGaE+oLyhgH0+RObyiESn6bJhp18sn48JR4bBtfRoOQngZrWx0I+ X-Received: by 2002:a62:6453:: with SMTP id y80mr35060524pfb.203.1550676751862; Wed, 20 Feb 2019 07:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550676751; cv=none; d=google.com; s=arc-20160816; b=Qacp/RXpSjCV6A3mJLV20bdKlZG9XWK4d4Myngq7qHee7B9xyZvhkSvbU5Ita3g9ad c2D+5w5nzu484JP+aQew02wrb2IRfwkxEEcUHAsmThd50E6vomte9xGpkWfOGOd5fZ6C 6BBJ7Eolb8B70OsFFAS4s9w1rMRiEGQPqmC/lbLI4Pz7RqN6rEbg3f3/7T5Hby4wLXNY KoNsixwiYcO1QS5GIdh2dtrP25BdaSDgBO8H3c05xp+IMvTbcbOhI4gA/+c4uZI8aZdw ik8jp9aVy7Lg7yzdrOWzuAqMcgNjclPdobqC/j9j0pNMirdK877g+GzykRyF3qAmLvcZ wZ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OoVnziCvVqbz7fof1lk+5ZmAZPTQq9L+mFGY+Sl9XVs=; b=VePZh1TY4hYXSTjgTEQLFXZCqw5eeKEPRFTs8JoHZ5gwJlcIHZJXX8xfVbBy7e+ch4 cU3fQ7i837K3y+1RHsUG0xszkI9Yu7ohr41WE84xLzv7XnimwhT9Jh77Crhcmn99khLK zxibXC8MtTU5Svaie+GvMTyK1KDmIc40VAD7HKSSuJtZN33tU6yI9z4aEA29wtSPfu1p 6yWF9PWQY4rBWXuq2TfjLpyEuM4hqdS8RGJpSqXKdVSIAAL89Q8bgSjdRkUv6xz56mM2 N+U0RlsYLj9UMyI9lKDEVDU9IEuN43aR87YNLQNQ3jci2kM5dGGOYsvnKeG+vJRzGsyG q57Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UJg0dHA3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si17388229pgv.244.2019.02.20.07.32.16; Wed, 20 Feb 2019 07:32:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UJg0dHA3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727661AbfBTPbk (ORCPT + 99 others); Wed, 20 Feb 2019 10:31:40 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:42144 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbfBTPbj (ORCPT ); Wed, 20 Feb 2019 10:31:39 -0500 Received: from pendragon.ideasonboard.com (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1E3992D1; Wed, 20 Feb 2019 16:31:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550676697; bh=JoraJcQ6MqFsIgkh7YJkuacZR5K+y+Q9v1vqMYM9Zjo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UJg0dHA38oxMH01UF9s+L+XcJNji1Fmx4Ngr2zrR9CAT38XURb+snR2AdHEGn7pQS WQPRoaFYqOzRIHdFvOUKhmzLKCjm3ysaZ+p1aEwqVf5GMznizWq4/kBuaux21TLb20 r40IFHd8bw6+3gE1mhzPU7CHb9PLimEP4SswlYjA= Date: Wed, 20 Feb 2019 17:31:33 +0200 From: Laurent Pinchart To: Geert Uytterhoeven Cc: Joerg Roedel , Magnus Damm , Laurent Pinchart , iommu@lists.linux-foundation.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/7] iommu/ipmmu-vmsa: Make IPMMU_CTX_MAX unsigned Message-ID: <20190220153133.GG3516@pendragon.ideasonboard.com> References: <20190220150531.2462-1-geert+renesas@glider.be> <20190220150531.2462-5-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190220150531.2462-5-geert+renesas@glider.be> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thank you for the patch. On Wed, Feb 20, 2019 at 04:05:28PM +0100, Geert Uytterhoeven wrote: > 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: Geert Uytterhoeven Reviewed-by: Laurent Pinchart > --- > drivers/iommu/ipmmu-vmsa.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 4d07c26c97848b65..4e3134a9a52f8d87 100644 > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -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); > -- Regards, Laurent Pinchart