From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E96104014B2; Wed, 27 May 2026 14:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779892888; cv=none; b=ensPPKTmae0CH7eSzy9Tpb2Sg1TTi/mXPmYWKWtizZl7wHs8WpQfsaSWiXraYTNMByduNMADrxfTBNdyJVOzp5ovg/Srt68G9sUPtVzmSvU/6ysvfQs5o5UGzYe/5m9kqo4RSZ2Joj4syVWP+BASw126KtBbIE03NhgRpFY/LIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779892888; c=relaxed/simple; bh=O9dF5ZEfJNpQgmZIBOVHmn07Ohic32zxhXXlKJXsZmc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=JL/KLwD3kOUuSKU7RJkOwJLQOU2Mtye9Gi3rfb5NWqNqPoRbT+KUfAvuU4vdDLg+m/dF2R5ujkfoVPt+ejnTgrd1lXxKezuKWzIHoDJ1Z2uabEkZTTtiNv4xiHc1pHih8lAOpdBD73HB2QZkJUNj1W3ELArjcFaJqvSoh0sdO9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=nbYKXuDa; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="nbYKXuDa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1779892887; x=1811428887; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=O9dF5ZEfJNpQgmZIBOVHmn07Ohic32zxhXXlKJXsZmc=; b=nbYKXuDa9LJp1RhEafJ1G6vziQSiQADKvpJu6d+ler+5JSWfQEs43Ktk srW0Nbj6hH5YFVAR+Ea8bMIPPhFEQ0noDdhNBIfeFQz3D6jGPCF0/fNUp iKHzv3bw9XFwl3tMDPslRKCqlGuHdq8LG6THMykBWSzqGHBwRin7Zqkzx IhplcYsLp977kP+HZ4jN+21m77VRTd37sCHL9Uvw7BuyX5btaRS0U0TWY 13Cnp4kw3xkEFMesZECVKg2IdYnPjOPaSWJsCjPYhR2/IwkhhxFexAd8S OblSoqwk5wDfcnBb3HmlJBdv9jjh5+fFfX8jsNF/3ufPgJDOMHAdO9v8d w==; X-CSE-ConnectionGUID: G1pshg5NRriwkIlwEHTZbQ== X-CSE-MsgGUID: rqgfLAxBSeyiVaOpOA/9Kw== X-IronPort-AV: E=Sophos;i="6.24,171,1774335600"; d="scan'208";a="58541474" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 May 2026 07:41:26 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Wed, 27 May 2026 07:41:25 -0700 Received: from [127.0.0.1] (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Wed, 27 May 2026 07:41:22 -0700 From: Balakrishnan Sambath Date: Wed, 27 May 2026 20:10:56 +0530 Subject: [PATCH 07/12] media: ths8200: use string_choices helpers 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="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20260527-cleanup-string-choices-media-i2c-v1-7-e8f7d2284288@microchip.com> References: <20260527-cleanup-string-choices-media-i2c-v1-0-e8f7d2284288@microchip.com> In-Reply-To: <20260527-cleanup-string-choices-media-i2c-v1-0-e8f7d2284288@microchip.com> To: Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab , Tim Harvey , Hans Verkuil CC: , , Balakrishnan Sambath X-Mailer: b4 0.14.3 Replace open-coded boolean-to-string ternaries with the standard helpers from . No functional change. Signed-off-by: Balakrishnan Sambath --- drivers/media/i2c/ths8200.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index 808ef16ec..88d826a03 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -127,10 +128,10 @@ static int ths8200_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "----- Chip status -----\n"); v4l2_info(sd, "version: %u\n", state->chip_version); - v4l2_info(sd, "power: %s\n", (reg_03 & 0x0c) ? "off" : "on"); - v4l2_info(sd, "reset: %s\n", (reg_03 & 0x01) ? "off" : "on"); + v4l2_info(sd, "power: %s\n", str_off_on(reg_03 & 0x0c)); + v4l2_info(sd, "reset: %s\n", str_off_on(reg_03 & 0x01)); v4l2_info(sd, "test pattern: %s\n", - (reg_03 & 0x20) ? "enabled" : "disabled"); + str_enabled_disabled(reg_03 & 0x20)); v4l2_info(sd, "format: %ux%u\n", ths8200_read(sd, THS8200_DTG2_PIXEL_CNT_MSB) * 256 + ths8200_read(sd, THS8200_DTG2_PIXEL_CNT_LSB), @@ -146,7 +147,7 @@ static int ths8200_s_power(struct v4l2_subdev *sd, int on) { struct ths8200_state *state = to_state(sd); - v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, on ? "on" : "off"); + v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, str_on_off(on)); state->power_on = on; -- 2.34.1