From nobody Tue Dec 16 07:11:25 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 6CC5614A60C for ; Tue, 14 Jan 2025 19:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736882858; cv=none; b=fZOs4ipCPBBTzES903kV8KcWTgp9GQ0THNuxH1JAxVA+n7bonfQCrsUBdo4LpRWO9W04esqfgkzlj2+mA0LIEKSNZov1yGBg9wzVxcXnaUGx17PWu5rm6gslrC1EWIZ0gfR8zl1Bi94qBkc903xH7jOJiK/JIKWZSWtYrWpzYOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736882858; c=relaxed/simple; bh=325ny/V5Fo2KcFKVmmRWzF4eNXFlIjOzZfokrybllc8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IkVMxuuHxqwSyQyZyyIb/IBH6jZz46gdRbv5cl6BJyckGZ+a56+sAdnI27kwk5fXPdQiq6hbLxhRZjcYcZRiAZ8xy1Q9VJ84eixQ7XU2LUY/JKx59y8KFr6mSAXvH59QJqMKlIRGHM8EXJnDNIiX2NEIe303fK727p7ve/0YtZc= 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=lpra7N0Z; arc=none smtp.client-ip=209.85.128.44 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="lpra7N0Z" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-436284cdbe0so7390135e9.3 for ; Tue, 14 Jan 2025 11:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736882855; x=1737487655; 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=HTSJOfzZPahbxlAY3P7hXeWy8oLFvuzfh5AkQx6x1+I=; b=lpra7N0Zvw5GUHzKKmulqqebCt1yrwE6tNGElr88HoMTghz6lao9SXBqBgU1LdJ72S 8PDEnOLVIjDOjFMIhPUdO4qW/fQoC6yMqISrGBPYl/4tQX0TO/dpJ7Ao1MnHy6eKhrv0 YqRRy69DgKFB8mbpP3E0jAJIJ/GgmQlPIOUnffAbEfiH7iZmi3oEKDzzheXqt5IXz/SQ maJudqFtD1eWa7KEMhj2uoEAhMZ+v1mpurk3fgs7P67CS4GqR6B0aHkdpQLH5m5ZzCwn UG2MN4iJzvn+UukMAmyctrTjNejFcu4PdBxRYu8xs/q421Vxi6aqz4bUmh/nfJ72tOW7 Uwsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736882855; x=1737487655; 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=HTSJOfzZPahbxlAY3P7hXeWy8oLFvuzfh5AkQx6x1+I=; b=SFG/MzjlR2UKbysOQ7EDDLrQyiKGdJRrjHiUrGxa6ugFrfs/QgK0nAslXQzh6fo+me Sh0Bv63XdDmsBD1RRU7oxMVlTWVWFuDN8B4Lh8/zj9VDaagpMIhJUEAtWh5nH1BQlMy3 wPKI5G2pfxmsgsJpomfp3pkY8WQFJGqeQRbE5kjUuyaAxwtuocE46d+OS5Zst23quYF8 FlF6nAXtJuBHMzSJ3KDn/TS87SyVQw71thqkpJ9SQhqrjdlhSV8mqHcIkYnCJPwyngmC UzF4SfQzZ/K1+bjPXYQqG7W3gh1oWY8r6HLj/5JP6yTVP9pcTk5+3RztW/WQFgJbtiOd Vt1w== X-Forwarded-Encrypted: i=1; AJvYcCUVXcNYDw69AMZKrGIgGfnGQMF7ZXAxZIrzeCatQqQ51uldiKxaV3+TXxIOJUdOKen808n/aF4UCTF/gs4=@vger.kernel.org X-Gm-Message-State: AOJu0Yzix/6HtQqQkr3LITaFAW2dS641wDGn5qYW8JLWm5FslQs+FhnJ FFoJV/ygfWgnoOdn8STWJX5YoA8cqJlpYVBlO9xssT93PwN7VmAWmKJQZXwu5t4= X-Gm-Gg: ASbGncv0WCI1uFlhrYfxEM70V9/ATAsE8yMqpp9CpU1aJ3OONw3zAioPkvIjl8xQnSF E+YLOM8tqjg51LO683OEXY1pThQO+D8U8a/4sE2ImUArd7sWB5T9eeVxAQezgtxi6feBaf2Fd/E XpY4GVT8x0xBO8RmWD4sna5Ayi17xk0LaIwEQtGaFR19mYhEPgS/k8Lz0yhsEuQDPam09s23IId xA6yaMi0+aT+Nup2eVC0N1Z65e514wtTaMZ5nLLMOKoqCm3gQ5dWBbrsv4nI3s2iRTaMAs= X-Google-Smtp-Source: AGHT+IGQkcr1cTwSTvAF2YE99vpYPyDtXZhOFWe+GMekQEoYqOpL4CVdJ4pQ1l8pqB2eNnBi3aKDCg== X-Received: by 2002:a05:6000:1f86:b0:38a:9118:c07f with SMTP id ffacd0b85a97d-38a9118c3b0mr7163744f8f.13.1736882854533; Tue, 14 Jan 2025 11:27:34 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1b44sm15813124f8f.90.2025.01.14.11.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:27:33 -0800 (PST) From: Krzysztof Kozlowski To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] coresight: Use str_enable_disable-like helpers Date: Tue, 14 Jan 2025 20:27:30 +0100 Message-ID: <20250114192730.912515-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: James Clark --- drivers/hwtracing/coresight/coresight-config.c | 3 ++- drivers/hwtracing/coresight/coresight-cpu-debug.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-config.c b/drivers/hwtra= cing/coresight/coresight-config.c index 4723bf7402a2..d39887f22df5 100644 --- a/drivers/hwtracing/coresight/coresight-config.c +++ b/drivers/hwtracing/coresight/coresight-config.c @@ -4,6 +4,7 @@ * Author: Mike Leach */ =20 +#include #include #include "coresight-config.h" #include "coresight-priv.h" @@ -233,7 +234,7 @@ static int cscfg_prog_config(struct cscfg_config_csdev = *config_csdev, bool enabl feat_csdev =3D config_csdev->feats_csdev[i]; csdev =3D feat_csdev->csdev; dev_dbg(&csdev->dev, "cfg %s; %s feature:%s", config_csdev->config_desc= ->name, - enable ? "enable" : "disable", feat_csdev->feat_desc->name); + str_enable_disable(enable), feat_csdev->feat_desc->name); =20 if (enable) err =3D cscfg_set_on_enable(feat_csdev); diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hw= tracing/coresight/coresight-cpu-debug.c index 342c3aaf414d..d93d8d480e05 100644 --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include =20 @@ -496,7 +497,7 @@ static ssize_t debug_func_knob_write(struct file *f, =20 if (ret) { pr_err("%s: unable to %s debug function: %d\n", - __func__, val ? "enable" : "disable", ret); + __func__, str_enable_disable(val), ret); goto err; } =20 --=20 2.43.0