From nobody Tue Dec 16 05:58:58 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 68610206F1D for ; Tue, 14 Jan 2025 20:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736885245; cv=none; b=cGkyRgzhwwCEOOnKhgTgELYe2edxlVGVVs/8USp/yu2YcqQXVNQcwj0NZjYCMHc2J/u0114wsOWn0vEEJRWug4HUK4hEzODzrUuoXYF2zUvQCsIWBzHEhnYFWJonISvlg60pPkeDpDm8A++9oWWpDlfa5hFV6yVFB6TU+rgyHAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736885245; c=relaxed/simple; bh=CvW4khQ6vHl70GiNOhk5gbmrXwzLs1ymn4wa9CmkFYY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=j9IobF6AKTjTwwsng/RX0SpJW0GDpUfd2FKH3PrfpHPk6Fa4MMJqssn7QYqGhl1RrkP0PLj22tCbNOAe6UQLriaWunN1x2BLg91tamxNjQpLM6ke8fXNLF2v4s2o4Abybns5VkTsZVtdAqL8wpsufiDq4kp0LZPE86cgo+l7Zic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FYLcWYx1; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FYLcWYx1" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-434f398a171so6400635e9.2 for ; Tue, 14 Jan 2025 12:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736885242; x=1737490042; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wz3rX4Je09/J+8Ei/25Zrj8Kfz/o7SKbn92nTSq0sP4=; b=FYLcWYx1FxGrCKahddKggnhROrci4LLAfE5NoQBrppzw40dvAWswbrde6c1Q34PCTD sCjxnPhTZAWHBIaLbhq1K7oGNRwlWigkEtev6sKPeLkHp2ha7zycUoqnHxb566SzbcHF UZoLUdW9kiZwF2BgGaHLeS4O1RLGq/MQIH86LaCwuh2RwMFACpoz+WEJ+TumbiOSJi3g 6//hSinWYKjGxULYNJafW3+/mkq5hSVSL7jkPszcEfnXqoe4PR6ru1XRQ9TpvmYHD0hU j2fiwHhrTp8YUBhMrKQ/IGXiGpjXAVSJsnv9xkLiGomQaa5yn6si7snFfh0JmyghJ4eR ByIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736885242; x=1737490042; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wz3rX4Je09/J+8Ei/25Zrj8Kfz/o7SKbn92nTSq0sP4=; b=T4dv9Gcz26VJ2sxpUIwMEj48CmEwwEPGXpw4UlCOwhhSGDrDX7utUiE4AxYWQ/GISh m/edCnLtsSqN+lQ9AKbT24qrJLTH/z/fTNMrPGi9kF9uHWbqibZ4ejbcwp5OHsXaMMJH d79wWoOx75tRFSo4my/zDIZvoZJ7JS4cIxpcexDndFnUWBs6e8w5JH5x4sNiuaIX9uoZ Ph9vXqOGSSSuA8ngzgGV/ZNmDO5ECzIkFfpj53ldu4YbU9xs0LgtHrD83bB04uLgNcgI RB0cJZURYUvNCr0Ugfmz+nGnNOG1lCDAmrFBDIz9Q+eJnEzN1mE4yPP26qTzQyuShJMf UVuQ== X-Forwarded-Encrypted: i=1; AJvYcCV4ujU1ep5Yv1IZ2K3/p9qgniU9aGpS2rRL7ePye49haDuLcHsBSEnbnDf8ijeOPTQJFSWyVap+NHxWWZs=@vger.kernel.org X-Gm-Message-State: AOJu0YyS3aF3TOcFpC5wH5/WRa55/SQUTEHgjGUnu4dvB7aiXhpwI4rl WiaHWAHaifY9xGm2OzbIMRZFqN8ND0m6lsnnmIaAmP703wAGNURl5P/gJ/+bKg+3MWC0oS8TRSW c X-Gm-Gg: ASbGncsa+spCdXwioNRtF0p0vTxs9SvtQUoBcl6BF2Bu9zuc/bttLE3xjVJNo6py3jL 52V2JYlz9jR4nnYAFSyhbMDDUCBC//2KwarO8zyWqPaV1VK/DdAIuYT9io8l11lXwrGTxcF9WUB Tz34Am4XQzPet1P549nP29G+YcFaA4Uk6xBnAb7FZBzA2Zdjd/u8oM3hvT7EnUkh4FhapJTABP2 xPN/p6K7hCQlFtt8ElWSjRiJcuATcYxv75FCCuQtQQ2aWiQJu1ygv+aDCyBHb/7SNS3OXc= X-Google-Smtp-Source: AGHT+IE7Jj8lfNs/6Mawrj444oeAra8QM8Y3meAjqJpf/75OfBxvuzPW0rWmRWiybb+fzK9QvFi5qA== X-Received: by 2002:adf:b60c:0:b0:385:df73:2f43 with SMTP id ffacd0b85a97d-38a872c8972mr6632398f8f.2.1736885241685; Tue, 14 Jan 2025 12:07:21 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9df958dsm185199475e9.17.2025.01.14.12.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 12:07:21 -0800 (PST) From: Krzysztof Kozlowski To: Alim Akhtar , Avri Altman , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , Peter Wang , Stanley Jhu , Matthias Brugger , AngeloGioacchino Del Regno , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH] ufs: Use str_enable_disable-like helpers Date: Tue, 14 Jan 2025 21:07:16 +0100 Message-ID: <20250114200716.969457-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Alim Akhtar Reviewed-by: Peter Wang --- drivers/ufs/core/ufshcd.c | 11 ++++++----- drivers/ufs/host/ufs-mediatek.c | 7 +++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 27154a5dcb7b..5225d48a47f8 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1187,7 +1188,7 @@ static int ufshcd_scale_clks(struct ufs_hba *hba, uns= igned long freq, =20 out: trace_ufshcd_profile_clk_scaling(dev_name(hba->dev), - (scale_up ? "up" : "down"), + str_up_down(scale_up), ktime_to_us(ktime_sub(ktime_get(), start)), ret); return ret; } @@ -1549,7 +1550,7 @@ static int ufshcd_devfreq_target(struct device *dev, hba->clk_scaling.target_freq =3D *freq; =20 trace_ufshcd_profile_clk_scaling(dev_name(hba->dev), - (scale_up ? "up" : "down"), + str_up_down(scale_up), ktime_to_us(ktime_sub(ktime_get(), start)), ret); =20 out: @@ -6026,7 +6027,7 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) =20 hba->dev_info.wb_enabled =3D enable; dev_dbg(hba->dev, "%s: Write Booster %s\n", - __func__, enable ? "enabled" : "disabled"); + __func__, str_enabled_disabled(enable)); =20 return ret; } @@ -6044,7 +6045,7 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(stru= ct ufs_hba *hba, return; } dev_dbg(hba->dev, "%s: WB-Buf Flush during H8 %s\n", - __func__, enable ? "enabled" : "disabled"); + __func__, str_enabled_disabled(enable)); } =20 int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable) @@ -6064,7 +6065,7 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, b= ool enable) =20 hba->dev_info.wb_buf_flush_enabled =3D enable; dev_dbg(hba->dev, "%s: WB-Buf Flush %s\n", - __func__, enable ? "enabled" : "disabled"); + __func__, str_enabled_disabled(enable)); =20 return ret; } diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediate= k.c index 135cd78109e2..a7804fe387e9 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -19,6 +19,7 @@ #include #include #include +#include =20 #include #include "ufshcd-pltfrm.h" @@ -480,10 +481,8 @@ static int ufs_mtk_mphy_power_on(struct ufs_hba *hba, = bool on) } out: if (ret) { - dev_info(hba->dev, - "failed to %s va09: %d\n", - on ? "enable" : "disable", - ret); + dev_info(hba->dev, "failed to %s va09: %d\n", + str_enable_disable(on), ret); } else { host->mphy_powered_on =3D on; } --=20 2.43.0