Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp569153imm; Wed, 26 Sep 2018 03:29:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV60mP+WTbjELSC/oHwdtZiWUoy3a9kfP+bA6N07wSVSrH0277xBc5NGH8UUbg3dWP1Vx4CN/ X-Received: by 2002:a63:db04:: with SMTP id e4-v6mr3771645pgg.280.1537957756058; Wed, 26 Sep 2018 03:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537957756; cv=none; d=google.com; s=arc-20160816; b=yX1PJm/ChqikiKGeBjSZXwAI5yZGD+EWPT7eIdvstnHSk/aK45236thZnyfryyTNls MuUV5cNGgCm7CJ/rvAFZ7EAgZan+MA3qpZ7Mak1d5jiLJcl34F88J36XWkelrISmAy8s vL3bRJbaYrMMUO5AnF4b//K8pAP/VcR+xlvA6YbSy/86UhPVYJL1MVb3RryeYkHIhEvu fzyvx8Zib/5jjInas4pW28WXZnoDYYLJrL79ExHBzof2rAjYrj6JR2kyE3ceWQsshx/+ hVOv1/V443Z6VatCw6o4yJ+wYrTYz9OxynhEqtRFHTjbR6pVGozVt0OXwK5MRGenCaY5 xIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=aT+qGx80oV3U4gNJ3mmaMcozHd2vSvhIRWHP/6yVOxI=; b=YfTgFSyqODE/Ju+ZumhcmuRzs/shN+2PL1GQhfH6k7Hqo1k8q6gQ7dAU9b4bWxWtbI /0UAoD8kVUJDjb5PBNVCnOcqCRL8wWDfbm/Hmnqa24As6Xmy2drr7jxZDjJioVTU74qO rImaC93WeG0QpMAxGGXpkgUT5m7iFW9O23vUlJ9wuspjkn8R1V795/IdyvqZKEqwtbnM gS7eD7hgxMXZwqmlqTazCO4GR+s5WCUeAwXjaY7tsFILta3bXcN0OZgde/JpBPOXeDPW cdOXEAusYLj5uZp6wCveap2H3hvtJfq9cn/c2QHbcrHzKEAyC7rAli9RP6X/Oh2NdA43 5DMw== ARC-Authentication-Results: i=1; mx.google.com; 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 k185-v6si4857589pgd.523.2018.09.26.03.29.00; Wed, 26 Sep 2018 03:29:16 -0700 (PDT) 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; 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 S1727244AbeIZQlH (ORCPT + 99 others); Wed, 26 Sep 2018 12:41:07 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42464 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726937AbeIZQlH (ORCPT ); Wed, 26 Sep 2018 12:41:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 497BA18A; Wed, 26 Sep 2018 03:28:50 -0700 (PDT) Received: from [10.4.13.85] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DE6023F5BD; Wed, 26 Sep 2018 03:28:48 -0700 (PDT) Subject: Re: [PATCH 02/10] irqchip/gic-v3-its: Consolidate LPI_PENDBASE_SZ usage To: Suzuki K Poulose , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Jeremy Linton , Jeffrey Hugo , Thomas Gleixner , Jason Cooper References: <20180921195954.21574-1-marc.zyngier@arm.com> <20180921195954.21574-3-marc.zyngier@arm.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <1fe9460d-c90a-a6ce-b0ce-754e22d834e1@arm.com> Date: Wed, 26 Sep 2018 11:28:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/09/18 11:33, Suzuki K Poulose wrote: > Hi Marc, > > On 21/09/18 20:59, Marc Zyngier wrote: >> LPI_PENDING_SZ is always used in conjunction with a max(). Let's >> factor this in the definition of the macro, and simplify the rest >> of the code. >> >> Signed-off-by: Marc Zyngier >> --- >> drivers/irqchip/irq-gic-v3-its.c | 12 ++++-------- >> 1 file changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c >> index c2df341ff6fa..ed6aab11e019 100644 >> --- a/drivers/irqchip/irq-gic-v3-its.c >> +++ b/drivers/irqchip/irq-gic-v3-its.c >> @@ -62,7 +62,7 @@ static u32 lpi_id_bits; >> */ >> #define LPI_NRBITS lpi_id_bits >> #define LPI_PROPBASE_SZ ALIGN(BIT(LPI_NRBITS), SZ_64K) >> -#define LPI_PENDBASE_SZ ALIGN(BIT(LPI_NRBITS) / 8, SZ_64K) >> +#define LPI_PENDBASE_SZ max_t(u32, SZ_64K, ALIGN(BIT(LPI_NRBITS) / 8, SZ_64K)) > > minor nit: The ALIGN() already aligns the given value up to the required > alignment. So, if the LPI_NRBITS is guaranteed to be non-zero, > we could simply drop the max_t(). Yeah, that's a brain fart on my part. I've fixed up. Thanks, M. -- Jazz is not dead. It just smells funny...