From nobody Tue Dec 16 05:59:20 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 1DFEA14A60C for ; Tue, 14 Jan 2025 19:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736882844; cv=none; b=iQPBlJCuu3s22qJvImuEFW2G7d76epYo5lgQdKBBNoOWiSwXGkA0wOI/93FBxLYj18zz9hX8QY0XIzvxYXpZKUrEimlkEiLSe5rNx9xX5pRQG/Lrqd1nx8UcAjSiHOS73E6lIwuhHgeqepnZ+nA6DRiSbi2++ufoEC0hlPtJ6J0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736882844; c=relaxed/simple; bh=mJi6GnXy4LDsOlCNbk9P6FF1C8Z0lp8SctmxZWGHlS4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hlQVFJFDK3zkAdr+95ACb2qr9J0hl0GV0Wr2OZ8ZgBaYQEqYENLU0XS+z23eL5BuZbVDUPaxt8FFR0XyAWHduQJxYIMTejtOCk2TzsMFc2Nyy2FlxEgJgK5Rf8S3e2t2hmd4D7tSvWfgS/QFvXi7kqqtE59Gmas4YGRuHeuTDL8= 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=JDvgN8UM; arc=none smtp.client-ip=209.85.221.50 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="JDvgN8UM" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-385e44a1a2dso357606f8f.3 for ; Tue, 14 Jan 2025 11:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736882841; x=1737487641; 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=LPM5vD2x779JQ5NuhyYaXL78U9hXgGymUtmEf6+ZKWE=; b=JDvgN8UMu3cbKONzd/Wb3x0TwPjl2MXD7+OOrC5UJwZHcDdnRdMtEOymyHTaDrF/Jg fgJWYqJdoR/I8gl8KTT0b1WsyXX5qaxQtrhu0PgPPtGG/yC6aL+uexT+d4nW+yXBeyy2 GSHMKyuNeNtQh/PPKCt0Fp3v8tMoUexf5g2N4/qATEwCfFbRwzHSfLYyqhn8baMnPkGh kKYe6YpaEWMrFyp1yfBo6ul8oj23Q6jHNvMo2EL4/R9thSQVYMEb0+ZGNAJ4kD/pvJj7 1fKP1SpkE4h9Vkd8E+/jqSPWtMnKp3MAPQz2DzBetzAbaYV9MsZ3bDHle8t+BgGfC0TU MxBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736882841; x=1737487641; 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=LPM5vD2x779JQ5NuhyYaXL78U9hXgGymUtmEf6+ZKWE=; b=ufcEw/98Ks0EpnVFBEkEfcH+9g1XhkrCIhWUHSsWd1IrT3+xDKXZZuY2nOHlp9bY+y zNFbC6x1Qs31PCMOEmitLhYtLgOOYtFLMCkHjcbhiEJhtjRFS+olURh3IjHL3feIhCFU F7h0wQzL/fm2UITEQwLl2Udshzy045mgETpCHxBw9dbxBKCTrrSvY9Cy44fFEyd6l2r4 lPybEe+jGLOd1Mc22UOBC1DYtzrtzWP4f9MnJqdwwCVOGjnytlZtkCuI2UKtiCKvQftO Y8YhmZn3U4qwJ9R2lxlw4U486RjkVkz/RbqT5wMlPhUhNkJ637mJvX0KXQT7sic+CxPE 3hdg== X-Forwarded-Encrypted: i=1; AJvYcCWZbrLuS3hIWUHFl9ouTIlnydiqSzUKsPcnNf/e1GDz+ZdzHo0VsyisNeLLEtCYairAwYiT6dl3402/dqE=@vger.kernel.org X-Gm-Message-State: AOJu0YyjFkp0CJFXrfXWoElcfjX48SftONYXqledHMd0KGdYg5At3dY8 rlOGmgxw6A47HeDlp18Jg8Tt4ml2d8zYvkCVSUlDP7mE24Dzyub30IaQDrx+g+Y= X-Gm-Gg: ASbGnctFjJRp+b9GB3GiBuTvynU6RocS/ybncV4do1fTrmhZB9ILqB46b3C/B0GHs7f P8D1zvHb7IV+b4GYCoc3glWoc9R1VjbsAOMdLNpRXi3qA45wC5QIgI5nJv258WoLHsKjxUppFMC wnnHb8zMDnj2ZSkwuzatl/AgRhusP1N7sHRHkWmssfXnxKjK9Td/WV55ZBesMSk0NpwwSs9fPZm 4reQnaS20+6q5vxqepkyc8TqGjQLTOtNPHpCkziUSj9UQ9erOTTknwRuBi/O2wmxREFtP0= X-Google-Smtp-Source: AGHT+IFtXsffWVvFqei1fzzHQaLxwIUzUZSKHYSUinUBEyVTxZbD2VDGLWTq9GRwHabTVKS1bHaOpA== X-Received: by 2002:a05:6000:18a3:b0:385:edb7:69cc with SMTP id ffacd0b85a97d-38a87310a82mr8853782f8f.12.1736882841412; Tue, 14 Jan 2025 11:27:21 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d007sm15532253f8f.20.2025.01.14.11.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 11:27:20 -0800 (PST) From: Krzysztof Kozlowski To: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] iio: Use str_enable_disable-like helpers Date: Tue, 14 Jan 2025 20:27:16 +0100 Message-ID: <20250114192716.912476-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 --- drivers/iio/humidity/dht11.c | 3 ++- drivers/iio/proximity/irsd200.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c index c97e25448772..48c59d09eea7 100644 --- a/drivers/iio/humidity/dht11.c +++ b/drivers/iio/humidity/dht11.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -99,7 +100,7 @@ static void dht11_edges_print(struct dht11 *dht11) for (i =3D 1; i < dht11->num_edges; ++i) { dev_dbg(dht11->dev, "%d: %lld ns %s\n", i, dht11->edges[i].ts - dht11->edges[i - 1].ts, - dht11->edges[i - 1].value ? "high" : "low"); + str_high_low(dht11->edges[i - 1].value)); } } #endif /* CONFIG_DYNAMIC_DEBUG */ diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd20= 0.c index b09d15230111..b0ffd3574013 100644 --- a/drivers/iio/proximity/irsd200.c +++ b/drivers/iio/proximity/irsd200.c @@ -10,6 +10,7 @@ #include #include #include +#include =20 #include #include @@ -783,7 +784,7 @@ static int irsd200_set_trigger_state(struct iio_trigger= *trig, bool state) ret =3D regmap_field_write(data->regfields[IRS_REGF_INTR_DATA], state); if (ret) { dev_err(data->dev, "Could not %s data interrupt source (%d)\n", - state ? "enable" : "disable", ret); + str_enable_disable(state), ret); } =20 return ret; --=20 2.43.0