From patchwork Mon Sep 30 12:04:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816078 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFB6CCF6497 for ; Mon, 30 Sep 2024 12:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=2J8j/9lq3I4+YDc5yQTfLgYLD+ VY8m/TzrhmACM9JIXuOSBYSMA4d8TfBDMaVVXe8JQxyPIsOzc8J2HW+CFyfOC/z9JlWGYYg/ezhbm oUzORrLauKorQEyKzWdpPMktYL9wkKWMMO5NrGn4rJITg1Zke6bUhkgJoHzQeDzqd7hK4XEqkbML3 zPj0pWCAEX+nYVm/6Gebcump9iXVsJ0UkWWMXCka8scSFpYInELRFLPzY1/4/YdIj9My15wQiNqow DTsCurHLIBt++lSdOV3wA5SotoW22YEHgFlLeSB4JCm/DbMblFDHnBH6WUJ4aU65nNj4n9Fa0cJXc 1n1dnutg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svFMl-0000000H0N2-1KcS; Mon, 30 Sep 2024 12:19:03 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svF8r-0000000GwNL-26LV for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 12:04:43 +0000 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-6cb2d2a7d48so30196696d6.3 for ; Mon, 30 Sep 2024 05:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697880; x=1728302680; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=cdVvdgu7a9HLygYD+4ooYrQ6XfOxCDQphu7kQ73/7v12Of1hE155lutnB7QZzqtjCz NqMMrhu3ZWqchwQvr6cCvZFUcznnlRBYDO4MK++itLb+QHijfrYWhaqXUVfJSSf60r8p bhCAZCm0noFSb5QRzasi6fJW8Sy2WP0TWP+Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697880; x=1728302680; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qO3qqbTfvsnj8f4B9o9/p9r5ocz9pMXhz3VcGEq7myc=; b=f7relWq9rV6GCaPsfN67PJ4b0mZTXZMLLlWmxXQweQbQiVIM4Gbys8wlMBAAffc7vB i6mSJekW6o6O2AO5BEuvHTOtAgDW2DqxY12MXXBknsDtIP8mJ0QygG+RlzdPvzHACKwk B6jkzED+5LKftThj6iyIMm6GKDHk7M3SrCz6OFJMV67FQLB814O4eMMSDDzaOn90nxCa Esh1eCDwdcwwRITrXPkMPDNT+A0UOcJIy5jwJXAwo1HD7NyUJypoL67pEYVloAv2u1hg F5tr+gtwD7P7SrNaOFiPts/GbqKXZ/4gCiyeble/67EkVQfhlKvJjPBq/ERMFaeVXr3F U6Vg== X-Forwarded-Encrypted: i=1; AJvYcCV+qr7DPSIfjQ+kmEwnCM3osmBVTW0zp5QwkPNimG8GQBwwNBLR2ocVkJSLvN4HM3uxnkWGC6gLa3ngHbrEWQ6f@lists.infradead.org X-Gm-Message-State: AOJu0YwxVTMS0SFEkpKVof9erZeFzbu2aJgEYHIfDryDFkV3wx5chHNV 7zbu45iQjhNgtu125c5cI8uyNsoEG44bSdV4zt43rG2tq4Skm+YynlkNZ6gmTg== X-Google-Smtp-Source: AGHT+IF/X+sGDFBK/b7MOemtir5qM4qeQwBGu/ooPVVD2yNCkIbVJsvPbz9WJQ+49WCJsrC1J8x5UQ== X-Received: by 2002:a05:6214:4901:b0:6cb:4b47:e4a9 with SMTP id 6a1803df08f44-6cb4b47e5ffmr151055736d6.2.1727697880010; Mon, 30 Sep 2024 05:04:40 -0700 (PDT) Received: from denia.c.googlers.com (76.224.245.35.bc.googleusercontent.com. [35.245.224.76]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6cb3b694369sm38822536d6.144.2024.09.30.05.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:38 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:12 +0000 Subject: [PATCH 17/45] media: bttv: Use string_choices helpers MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-17-81e137456ce0@chromium.org> References: <20240930-cocci-opportunity-v1-0-81e137456ce0@chromium.org> In-Reply-To: <20240930-cocci-opportunity-v1-0-81e137456ce0@chromium.org> To: Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans de Goede , Andy Shevchenko , Hans Verkuil , Mike Isely , Olli Salonen , Maxim Levitsky , Sean Young , Sergey Kozlov , Abylay Ospan , Jemma Denson , Patrick Boettcher , Ming Qian , Zhou Peng , Andy Walls , Laurent Pinchart , Michal Simek , Jean-Christophe Trotin , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Eddie James , Joel Stanley , Andrew Jeffery , Hans Verkuil , Tomasz Figa , Marek Szyprowski , Tim Harvey , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, openbmc@lists.ozlabs.org, linux-aspeed@lists.ozlabs.org, Ricardo Ribalda X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_050441_581072_3359F88F X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The following cocci warnings are fixed: drivers/media/pci/bt8xx/bttv-driver.c:2988:5-31: opportunity for str_yes_no(dstat & BT848_DSTATUS_HLOC) drivers/media/pci/bt8xx/bttv-driver.c:2992:5-31: opportunity for str_yes_no(dstat & BT848_DSTATUS_PRES) drivers/media/pci/bt8xx/bttv-cards.c:3039:13-22: opportunity for str_yes_no(has_radio) drivers/media/pci/bt8xx/bttv-cards.c:3040:2-12: opportunity for str_yes_no(has_remote) drivers/media/pci/bt8xx/bttv-cards.c:3043:2-21: opportunity for str_yes_no(has_tda9820_tda9821) drivers/media/pci/bt8xx/bttv-cards.c:3044:2-17: opportunity for str_yes_no(is_capture_only) drivers/media/pci/bt8xx/bttv-cards.c:3042:13-20: opportunity for str_yes_no(is_lr90) drivers/media/pci/bt8xx/bttv-cards.c:4080:8-19: opportunity for str_yes_no(tuner_tv_fm) drivers/media/pci/bt8xx/bttv-cards.c:3140:24-38: opportunity for str_yes_no(btv -> has_radio) drivers/media/pci/bt8xx/bttv-cards.c:4081:8-23: opportunity for str_yes_no(btv -> has_remote) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/bt8xx/bttv-cards.c | 16 ++++++++-------- drivers/media/pci/bt8xx/bttv-driver.c | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index 867c1308de23..f989b5ed28fd 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c @@ -3036,12 +3036,12 @@ static void flyvideo_gpio(struct bttv *btv) tuner_type = TUNER_ABSENT; /* No tuner present */ pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", - btv->c.nr, has_radio ? "yes" : "no", - has_remote ? "yes" : "no", tuner_type, gpio); + btv->c.nr, str_yes_no(has_radio), + str_yes_no(has_remote), tuner_type, gpio); pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", - btv->c.nr, is_lr90 ? "yes" : "no", - has_tda9820_tda9821 ? "yes" : "no", - is_capture_only ? "yes" : "no"); + btv->c.nr, str_yes_no(is_lr90), + str_yes_no(has_tda9820_tda9821), + str_yes_no(is_capture_only)); if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ btv->tuner_type = tuner_type; @@ -3137,7 +3137,7 @@ static void miro_pinnacle_gpio(struct bttv *btv) if (-1 != msp) btv->c.type = BTTV_BOARD_PINNACLEPRO; pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n", - btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); + btv->c.nr, id, info, str_yes_no(btv->has_radio)); btv->tuner_type = TUNER_MT2032; } } @@ -4077,8 +4077,8 @@ static void avermedia_eeprom(struct bttv *btv) } else pr_cont("Unknown type"); pr_cont(" radio:%s remote control:%s\n", - tuner_tv_fm ? "yes" : "no", - btv->has_remote ? "yes" : "no"); + str_yes_no(tuner_tv_fm), + str_yes_no(btv->has_remote)); } /* diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 511f013cc338..fdad666d3d0f 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -2985,12 +2985,10 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) bttv_print_irqbits(stat,astat); if (stat & BT848_INT_HLOCK) pr_cont(" HLOC => %s", - dstat & BT848_DSTATUS_HLOC - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_HLOC)); if (stat & BT848_INT_VPRES) pr_cont(" PRES => %s", - dstat & BT848_DSTATUS_PRES - ? "yes" : "no"); + str_yes_no(dstat & BT848_DSTATUS_PRES)); if (stat & BT848_INT_FMTCHG) pr_cont(" NUML => %s", dstat & BT848_DSTATUS_NUML