From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1440B7603F for ; Thu, 16 Jan 2025 03:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736996712; cv=none; b=NisqPUhy6wUu7hs1ubjDm3DlZ1n8piEGfLqQDpTKGOTZJBP1kgrqDPMDV667sULMHLRgIXl3pHJ7tcMoZ90TNGfTVfVljyEGUyz2eEUQAULjQwRlWMQnrfbsZNanuCJYqcvMYhiC6yn2JvIhySAS/u/lTpGDNK9HzzHwnXQXSh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736996712; c=relaxed/simple; bh=ndokzHfK9DjzvnQLuIY2/EkLk5z5jVFlw8qOBGX6ASE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FYSP/hcOPY1jvYyzNuxcILHSDbHbkRx+E+AJ2DwJhICVNwl6S5rtxN5rbhNhjrPuQ6BGK111BD3+uklbzHS5RjeU3YSImEqwlL1r7w2JTzxzpWt6KN/sDei0Uscyx4fDWT8/FhV0mq7pgVrLjzPTGupc9poMpu56w/YDdx84uCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GUoWoAyp; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GUoWoAyp" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2163affd184so43475ad.1 for ; Wed, 15 Jan 2025 19:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736996710; x=1737601510; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7cuWckv2mg3iIR5MCaEBEb/4QCrqfrfbJmqZ9RuoMko=; b=GUoWoAyppWSoymU4lZVgvATPTMKVC7i97uci1/ZZhNIRM9Ms4KvXl3TepOx6GviiDf TycdBST6+H1tXGjgOpdW5FWfqdr2Z86ZPbff2ShyirX+d3TClJnpPcJmgoG2IfHQIZ2o k2mBFca4tsHp0NdWfap8KpKlC6/SorJf3IFJJKTmTSmNKomKv+hP54y19cuZjiZKMVYZ b433CyEtzK80sf7k8VcShTuTLHSbXpyj5unp5MsdDM6ybgHpyrHKcFUQ7KwMRnY0YY0d G3XZ7Irvvf1wptt4DZ2o//nba+lRyhrNMOx6ZmTOSkuL9heb4+viQE9vaKzRU1GuUmV9 KxXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736996710; x=1737601510; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7cuWckv2mg3iIR5MCaEBEb/4QCrqfrfbJmqZ9RuoMko=; b=oEPBL9Bz/YNBXLNQetRiDGn5K8SV3hGVfe6TkL+ll+aG3OOb9sGy7FaTHtgfWZ9pFN yj5HtzIpV+gyZh0hk8lWlDo1dkiWGXByykFXDbWtsXly2/YicCVlwMaiRXtG69aXeQij TU4ncivIqO6XyBHTpdpNhkQfPKYq0AgSGjmg2Vg5oF0gsYPx8g1MKnzGrppOQKa0JnyA TiJiyj7m60az1cHLjsRykY2RLREqW1YiYa9PGOf4QGwloaqWYfHlUSRhNrcq20QU39RQ +ed0uWA5bjqpIugjF036pkPVOLEG5j3qliLB6P2eLME73YVbpriHKvTfC1yiRSNCqZ8Q D/Rw== X-Forwarded-Encrypted: i=1; AJvYcCWSNA6p/AZ35o3Qbircftwvx+kZyamLM/QhZwQoxjpshdx6zWGoZ0XQLhOljTJsPJhAKnwgyGzaYoypOKs=@vger.kernel.org X-Gm-Message-State: AOJu0YyvE/yNibP+c54/VJVGPmszt4ZcZEpLQvltpB2dr/amT56scfSI LpbMf8re6UIGdfP6HFYHDbFny22NaIllmhlYdMVktX5L4kkcwczwvdp8kTOqpg== X-Gm-Gg: ASbGncswndse6DGdIx/Ges5ZdTiwFy4Z0l1GyRo0nMCh1m+8GBeqqDL+28JYQ5BOaal zuyE46goYjAFL03VWYYq+zh85qAO8+1uR5OosY86ZyGyCoeyHj9LpdyKveb21v9aU67GMQ1+gs+ eMmVCjdXFahB3dOliJwNJCqrs16A86lV4TLIyEnWazHP728+T6TQeVcxwNqFJrQbmFUNwhhgigO 7kE0XddEPttykiLALd5yB2VxDHt8G90tixnbkMJ20cWo91E8a/cbdpCAWbNRL04jS0O3pEXV1VL VKGU3/Cw8pLt X-Google-Smtp-Source: AGHT+IGgvey12XcQ8iP4n+eaUVK+cmvSLWMH2UIplRse6X8rSW8rrU74w2Bbqndq54XuqjUDHEawSg== X-Received: by 2002:a17:902:f785:b0:215:69a3:1c94 with SMTP id d9443c01a7336-21c12cfe139mr1268815ad.28.1736996710051; Wed, 15 Jan 2025 19:05:10 -0800 (PST) Received: from google.com (1.243.198.35.bc.googleusercontent.com. [35.198.243.1]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f72c151cbfsm2135397a91.6.2025.01.15.19.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 19:05:09 -0800 (PST) Date: Thu, 16 Jan 2025 03:05:00 +0000 From: Pranjal Shrivastava To: Krzysztof Kozlowski Cc: Will Deacon , Robin Murphy , Joerg Roedel , Yong Wu , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH] iommu: Use str_enable_disable-like helpers Message-ID: References: <20250114192642.912331-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250114192642.912331-1-krzysztof.kozlowski@linaro.org> On Tue, Jan 14, 2025 at 08:26:42PM +0100, Krzysztof Kozlowski wrote: > Replace ternary (condition ? "enable" : "disable") syntax with helpers > from string_choices.h because: > 1. Simple function call with one argument is easier to read. Ternary > operator has three arguments and with wrapping might lead to quite > long code. > 2. Is slightly shorter thus also easier to read. > 3. It brings uniformity in the text - same string. > 4. Allows deduping by the linker, which results in a smaller binary > file. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 ++- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 ++- > drivers/iommu/mtk_iommu.c | 9 +++++---- > drivers/iommu/mtk_iommu_v1.c | 3 ++- > drivers/iommu/rockchip-iommu.c | 3 ++- > 5 files changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index 0e4cbb2c64d7..358072b4e293 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include JFYI, this include was merged in the arm/smmu/updates branch recently, hence it shouldn't cause any trouble while merging. > #include > #include > > @@ -4321,7 +4322,7 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) > */ > if (!!(reg & IDR0_COHACC) != coherent) > dev_warn(smmu->dev, "IDR0.COHACC overridden by FW configuration (%s)\n", > - coherent ? "true" : "false"); > + str_true_false(coherent)); > > switch (FIELD_GET(IDR0_STALL_MODEL, reg)) { > case IDR0_STALL_MODEL_FORCE: > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 79afc92e1d8b..de205a34ffc6 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -34,6 +34,7 @@ > #include > #include > #include > +#include > > #include > > @@ -2106,7 +2107,7 @@ static void arm_smmu_rmr_install_bypass_smr(struct arm_smmu_device *smmu) > } > > dev_notice(smmu->dev, "\tpreserved %d boot mapping%s\n", cnt, > - cnt == 1 ? "" : "s"); > + str_plural(cnt)); > iort_put_rmr_sids(dev_fwnode(smmu->dev), &rmr_list); > } > For the arm-smmu part. Acked-by: Pranjal Shrivastava Thanks, Praan