From patchwork Mon Sep 30 12:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815949 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.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 0140D18E354 for ; Mon, 30 Sep 2024 12:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697848; cv=none; b=C35jJMe/qcHYTuTyofLb5w8QqxfqKyhsajGmIug1VvU4LuMeqv1LxQgtkclceVlJUZYpVuqCWUQY4n35evA6qTYT8favy5IEhXbsyhtj2cAjcvonaM82O7STSETOD/tdj+YJijXXrcDxUECZl4UlopHWAX4AuHyp89tN+5n7E+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697848; c=relaxed/simple; bh=5CcZFwY67VUyfBGEeXQ3+4Q+ziORs1PEInvOEq+lE04=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ChMLxa/n0bPqNPkm/rQMipv9oMvgN8JtFSXoeht+QkU+eU0m2gpKMnqRnGEiV8/Ba4Lkq/TZunkmxV1AJe+RGsQ8ffEBnGbtXIMpmMGad/6XncNY6DWXFqsn3b8dn3uAXEb5GPUgZw3tHFcQuqSXI30r9m4HALb61XsLU869y7s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lpofV1T2; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lpofV1T2" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-710f0415ac8so2401678a34.1 for ; Mon, 30 Sep 2024 05:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697844; x=1728302644; darn=lists.linux.dev; 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=U/d/VxAIFFwk8ny3jYVhNIfPO7NwT5z32rk28KK4f8Y=; b=lpofV1T2EL6T+1tcJkFR9MC0Te4sqQFn3TjuiuL/MuRngfsSW9nNtvsfhWg/rloOU2 0dEClCyrTfw/KknsaWbOzCJ4WY700VuqxK362W66qKjtSXaR9M68srm1Eu3AgxNzBM5/ IrTnnr1bElnsHxiTqiDqjnZmFkC+OV8pP4Ilw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697844; x=1728302644; 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=U/d/VxAIFFwk8ny3jYVhNIfPO7NwT5z32rk28KK4f8Y=; b=w3CAxq4VAfVgAvzv857a3yFnNPIj9PYWq6zPzb9n4/ixsXj9qor0pjthePCCoWuGFw jFarXvd2G7kABmp+m79f+PwLpbfQP5N8Ifig+Q7jxyr4cMIUB3ws0Sy3r1I18lGylfFJ AWpXVlnZcP6z6x1UIj+7bONyFJ6rQQSh5W/kxZVxoyJtvqYl2RlXQqkpU/5iqmrInS95 grUOl1dEVgosd6s7fx44Mj5n3+XeHQ2q7KgDDC+IXLbti0G4XiYD8al0+tgUtszkDlZc f4niy/nBZqUUhNvS9dOiJ6a0ttYBhotPLF9VArFD+q04yGakd1/iSe7HgOdAuy1AAb7c jMpw== X-Forwarded-Encrypted: i=1; AJvYcCWuAOuft9YKTRuFR37ryoF/rVqHGXS2i7xQ11Pq2Pq2Q0dwmI3+7D3pcEZpIeW2EsYR+Ak=@lists.linux.dev X-Gm-Message-State: AOJu0YwKT8+wzi3+RVqWm9XOROv4bUHg2D6XlRMevpSOMhuj7k7nFb4A IM+AKOwZ2DWZL0NQmDyjhDSknCHQUOC/7ZdoonbIgtHzOGxvVh4ppCD2fkj4Nw== X-Google-Smtp-Source: AGHT+IG/KAG5rLZearz2Wa+2ErVyBcttWaRGk175qbpKywxFfy3PRamVmOosYeNbd61Fqm2746wGGw== X-Received: by 2002:a05:6358:4314:b0:1b1:ac2e:af69 with SMTP id e5c5f4694b2df-1becbd0a143mr332064355d.17.1727697843926; Mon, 30 Sep 2024 05:04:03 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:02 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:56 +0000 Subject: [PATCH 01/45] media: staging: ipu3: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-1-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 The following cocci warnings are fixed: drivers/staging/media/ipu3/ipu3-v4l2.c:290:3-31: opportunity for str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED) drivers/staging/media/ipu3/ipu3-v4l2.c:305:3-31: opportunity for str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED) Signed-off-by: Ricardo Ribalda --- drivers/staging/media/ipu3/ipu3-v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c index e7aee7e3db5b..443067ad0a50 100644 --- a/drivers/staging/media/ipu3/ipu3-v4l2.c +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c @@ -287,7 +287,7 @@ static int imgu_link_setup(struct media_entity *entity, WARN_ON(pad >= IMGU_NODE_NUM); dev_dbg(&imgu->pci_dev->dev, "pipe %u pad %u is %s", pipe, pad, - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe->nodes[pad].enabled = flags & MEDIA_LNK_FL_ENABLED; @@ -302,7 +302,7 @@ static int imgu_link_setup(struct media_entity *entity, __clear_bit(pipe, imgu->css.enabled_pipes); dev_dbg(&imgu->pci_dev->dev, "pipe %u is %s", pipe, - flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); + str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED)); return 0; } From patchwork Mon Sep 30 12:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815950 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.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 9EA9218E75A for ; Mon, 30 Sep 2024 12:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697849; cv=none; b=T9E2zrLxGo3+w/UgN6norGGd87U/6SMvpApEYN35agypKM4IbYixZDKbbbWrS4yTL0bZUSQ07KjN0DEkuw6Ean6PJA8UUzR54cHWKi0+5Rf34g2ltcRkMewbJWruxHdDc3PI/kJbNytjEpAtfl0eNSDFZ7KtcvgKIwxd2bMwMfw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697849; c=relaxed/simple; bh=6tsZ1NoeAxhaSKOEEQHt8kXuaM/4oPbiO7sTIQQ1WIA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CC/OrmaVD9SKJ+q615rTBR9OAFQIIGPDCmNCeIwC9Biy4lEhwazOkBp9wp9msBgl5qiDRhfHdJLgIU8Zcs/NlCCye5K92d9Gf3JbzqILSnlQLo2MEcaASwRffya+xeDohfCGi9WaVooLcLoDLLt49yWLOvfL32DT0svWX2HQg3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=iZkvGegp; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="iZkvGegp" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6cb54eef205so14796826d6.2 for ; Mon, 30 Sep 2024 05:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697846; x=1728302646; darn=lists.linux.dev; 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=RMPmE5TkHFd80YgqTri0+sfyqDiwarpX0eHsAVhj80Q=; b=iZkvGegpKvVgh3qX2Gu86vTl7kklbKFDHAsuCq5rOybBQbmWc4m0yrMkGZM9ngdO2W X7UrFuZKhvF07QBk6rz4SSsDTgH5Lcm9tEfZzpmk2GSi5nkTzwby2FpEsxSI/V+gshvl ouY86mMpE5XkAVeiZtJHz1L95+qSBqtFumRRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697846; x=1728302646; 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=RMPmE5TkHFd80YgqTri0+sfyqDiwarpX0eHsAVhj80Q=; b=VCjqwmEMzhZd9v7O14Nb5YEqYKcqkwBDEMdy40s4NNMvfMr6v9QdN5tKDzIbFPVCoy tWZdoCQzVC6KCHiHPf4Gm/B4Cxtt0tX482KBpHaI9VgI2ogf3Zsecn6rIGyX9pidYB2N RTzROT2mqBW54d23by4iX2XsyR60Wq4DydBMpvNBYHzm8Apj8s5tE4UdUr0rx7pWoUHf gA5flu5kUrUy45jQftawakTBVuHeZ0xCOiDjNwcvphecp4/gtVLtUZ5lN3wtgYojOVDn ejmPcYGrnCi0fBrobD8Ffe9RD2JmgieZyF4W5DPnd6O2C+4w8D14ZdupOT3YXLNGJBGA LycQ== X-Forwarded-Encrypted: i=1; AJvYcCW7Gwrs3qsA1kSkNr43Jtmksuq9/zV6TGlyUB5EF79kuClSbtVwz/2HegYsr394TPhl9Q4=@lists.linux.dev X-Gm-Message-State: AOJu0YxWcRDqla8LUJfFh5gqx2a40WcPILaEbixcBRMNljWyHSvVtY8v b+EdbNDwlwY/d7QhVYBKKdfR0uS53o3hRh1xV7DIK7k+peGjHfJkE97dF5mUqg== X-Google-Smtp-Source: AGHT+IH6/D/fn5XLACymMtvSYJn9uYVBCFXPJs1Z5DofbyQa884ygogtE2Qn3wPmK1ZC7+LIXRRj0g== X-Received: by 2002:a05:6214:4905:b0:6cb:4ee5:8a80 with SMTP id 6a1803df08f44-6cb4ee58e92mr128655486d6.34.1727697846439; Mon, 30 Sep 2024 05:04:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:57 +0000 Subject: [PATCH 02/45] media: staging: atomisp: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-2-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 The following cocci warnings are fixed: drivers/staging/media/atomisp/pci/sh_css.c:1490:16-19: opportunity for str_true_false(map) drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:855:2-8: opportunity for str_enable_disable(enable) drivers/staging/media/atomisp/pci/atomisp_v4l2.c:542:40-46: opportunity for str_on_off(enable) drivers/staging/media/atomisp/pci/atomisp_v4l2.c:584:48-54: opportunity for str_on_off(enable) drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1006:2-4: opportunity for str_on_off(on) drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1019:3-5: opportunity for str_on_off(on) drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c:394:9-19: opportunity for str_low_high(active_low) drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1253:3-35: opportunity for str_true_false(xcandidate -> sp . enable . continuous) Signed-off-by: Ricardo Ribalda --- drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c | 2 +- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 4 ++-- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 4 ++-- drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c | 2 +- drivers/staging/media/atomisp/pci/sh_css.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index a62a5c0b3c00..34e68ea1b1f4 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -852,7 +852,7 @@ int atomisp_css_irq_enable(struct atomisp_device *isp, { dev_dbg(isp->dev, "%s: css irq info 0x%08x: %s (%d).\n", __func__, info, - enable ? "enable" : "disable", enable); + str_enable_disable(enable), enable); if (ia_css_irq_enable(info, enable)) { dev_warn(isp->dev, "%s:Invalid irq info: 0x%08x when %s.\n", __func__, info, diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c index 6abda358a72f..7d1905791b9a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c @@ -391,7 +391,7 @@ static int atomisp_csi2_handle_acpi_gpio_res(struct acpi_resource *ares, void *_ acpi_handle_info(data->adev->handle, "%s: %s crs %d %s pin %u active-%s\n", dev_name(&data->adev->dev), name, data->res_count - 1, agpio->resource_source.string_ptr, - pin, active_low ? "low" : "high"); + pin, str_low_high(active_low)); return 1; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index e176483df301..85e7d14ef394 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -1003,7 +1003,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) return 0; dev_dbg(subdev->dev, "Setting power state to %s\n", - on ? "on" : "off"); + str_on_off(on)); if (on) ret = acpi_device_set_power(adev, @@ -1016,7 +1016,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) gs->clock_on = on; else dev_err(subdev->dev, "Couldn't set power state to %s\n", - on ? "on" : "off"); + str_on_off(on)); return ret; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index c9984f1557b0..6fd18217df1e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -539,7 +539,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) u32 val = enable ? MRFLD_ISPSSPM0_IUNIT_POWER_ON : MRFLD_ISPSSPM0_IUNIT_POWER_OFF; - dev_dbg(isp->dev, "IUNIT power-%s.\n", enable ? "on" : "off"); + dev_dbg(isp->dev, "IUNIT power-%s.\n", str_on_off(enable)); /* WA for P-Unit, if DVFS enabled, ISP timeout observed */ if (IS_CHT && enable && !isp->pm_only) { @@ -581,7 +581,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) usleep_range(100, 150); } while (1); - dev_err(isp->dev, "IUNIT power-%s timeout.\n", enable ? "on" : "off"); + dev_err(isp->dev, "IUNIT power-%s timeout.\n", str_on_off(enable)); return -EBUSY; } diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c index 7ce2b2d6da11..7e295bc83464 100644 --- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c @@ -1250,7 +1250,7 @@ int ia_css_binary_find(struct ia_css_binary_descr *descr, struct ia_css_binary * dev_dbg(atomisp_dev, "Using binary %s (id %d), type %d, mode %d, continuous %s\n", xcandidate->blob->name, xcandidate->sp.id, xcandidate->type, xcandidate->sp.pipeline.mode, - xcandidate->sp.enable.continuous ? "true" : "false"); + str_true_false(xcandidate->sp.enable.continuous)); if (err) dev_err(atomisp_dev, "Failed to find a firmware binary matching the pipeline parameters\n"); diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index ca97ea082cf4..89a694453e6f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1487,7 +1487,7 @@ map_sp_threads(struct ia_css_stream *stream, bool map) enum ia_css_pipe_id pipe_id; IA_CSS_ENTER_PRIVATE("stream = %p, map = %s", - stream, map ? "true" : "false"); + stream, str_true_false(map)); if (!stream) { IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL); From patchwork Mon Sep 30 12:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815951 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 5079E18EFF5 for ; Mon, 30 Sep 2024 12:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697851; cv=none; b=jD9wtTcKkq+FgzaeaM2LmOrc8rj27iXpmyhUQ1XCGYPgnlwNYgiIQIWurRgfSaH0ifB8yGDkNqX4FWA2fv8fF150UiUgM05F0rof6xXqqmqXv0hWXRYP69KvaxhYkWyEBfIFY3+nVmrViQYgoUNcCBRR0RNlGaecpMi8M4+2CWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697851; c=relaxed/simple; bh=JRVPAXt8pgkLV9kf8+kVySmbvl1AqLOgaMkZBH8WTjc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RMICrFuraMd99tXa3tLl9SpxE0roBgYRirypviDIK9/feTBNoILATnksPcxK0fA/oBqMda/s4MvQxYloFymAKP7PiC9eEZlSYV6WuZkrKIJsV4epbIymIAxUDU1I9RPpK0Y4L7PyDNFgbcDZluGnKLynxt1cu4KFeoFthPnNR3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=DWs8xvLm; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="DWs8xvLm" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6cb4c013b78so18076336d6.1 for ; Mon, 30 Sep 2024 05:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697849; x=1728302649; darn=lists.linux.dev; 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=4cqERgoR9OlhV9bZcAYTWgDv58ZKeW9/q+4TIB0lCLc=; b=DWs8xvLmWh/dIxNX98UGLJ5+tvpzRYntdC8I1sjznbJgTwD3GbY7NV7Z7v5Wd4L6Dx DZEjkukABMyxtM1EzfGvM1PEcujGH7+GKEg2FkO7RiyZ6J/qXPYODSSaUtmG0M5GYABC uNur+YGwyttN7nKMvxsUKrMqHHCfwLw/QN/K4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697849; x=1728302649; 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=4cqERgoR9OlhV9bZcAYTWgDv58ZKeW9/q+4TIB0lCLc=; b=Opge+muT8JEk+jmem/I4nm6pvKC9IoLiMUZXalgIYIgM7+SSsFx7hY5PP4beqUtYw5 4270KWhUcBLCKXUamS9LULqxsHyLujdNmHwoldDKTCvMuAzbW5FHv6OyERfvOvRVmikt +Y9IPMAAFj4HtV2AKxU4tJGtPjxTVreruOf2mlP8+5qMwgoQEk08DlEsgFkkKeP347dc ZLRCgjZO5tFsc+yRz2ppM+fo6mkDqjW7wA/BPSQGrCBmi1s6jxsJX6uTu49wiPhxwam3 toniJ07/G2pMZnNW2v3XHRQunknA7ZrJNDQFbHlrRL52obeCTmjKk9OHlC956pKkuk9p ohfw== X-Forwarded-Encrypted: i=1; AJvYcCWcYXGnkW5VkTTOxCoYWej1U3cZLP/nBKgcv+/IDT2WVQrxrGh7FFbDORWWqS719Cp36V0=@lists.linux.dev X-Gm-Message-State: AOJu0YwSmAZJJRFyuyZu1U3ne90v+TofvfW2umljJEOquKcunNWichel eR4knKaXISFx6YEYJGmK4bfuABTHjInmXFa8bnYK/gxd9bcJsY6Huh/LfLM3Uw== X-Google-Smtp-Source: AGHT+IGdCSwCLQh27OqCiMv81An8yCyEXTlCQao91e2evQ6yJY9lhvUOeYdfvxJFC6O2qm9bRDYGaQ== X-Received: by 2002:a05:6214:5247:b0:6c5:166e:566c with SMTP id 6a1803df08f44-6cb3b5f06c1mr193464746d6.28.1727697848951; Mon, 30 Sep 2024 05:04:08 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:07 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:58 +0000 Subject: [PATCH 03/45] media: core: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-3-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 The following cocci warnings are fixed: drivers/media/v4l2-core/v4l2-fwnode.c:282:32-33: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:290:32-33: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:298:37-38: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:329:31-32: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:356:40-41: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-fwnode.c:364:38-39: opportunity for str_high_low(v) drivers/media/v4l2-core/v4l2-ctrls-core.c:272:16-26: opportunity for str_true_false(* ptr . p_s32) Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-ctrls-core.c | 3 ++- drivers/media/v4l2-core/v4l2-fwnode.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index eeab6a5eb7ba..f303c70dffae 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,7 @@ void v4l2_ctrl_type_op_log(const struct v4l2_ctrl *ctrl) pr_cont("%d", *ptr.p_s32); break; case V4L2_CTRL_TYPE_BOOLEAN: - pr_cont("%s", *ptr.p_s32 ? "true" : "false"); + pr_cont("%s", str_true_false(*ptr.p_s32)); break; case V4L2_CTRL_TYPE_MENU: pr_cont("%s", ctrl->qmenu[*ptr.p_s32]); diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index f19c8adf2c61..92dc17179018 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -279,7 +279,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_HSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_HSYNC_ACTIVE_HIGH : V4L2_MBUS_HSYNC_ACTIVE_LOW; - pr_debug("hsync-active %s\n", v ? "high" : "low"); + pr_debug("hsync-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "vsync-active", &v)) { @@ -287,7 +287,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_VSYNC_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH : V4L2_MBUS_VSYNC_ACTIVE_LOW; - pr_debug("vsync-active %s\n", v ? "high" : "low"); + pr_debug("vsync-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "field-even-active", &v)) { @@ -295,7 +295,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_FIELD_EVEN_LOW); flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH : V4L2_MBUS_FIELD_EVEN_LOW; - pr_debug("field-even-active %s\n", v ? "high" : "low"); + pr_debug("field-even-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) { @@ -326,7 +326,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_DATA_ACTIVE_LOW); flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH : V4L2_MBUS_DATA_ACTIVE_LOW; - pr_debug("data-active %s\n", v ? "high" : "low"); + pr_debug("data-active %s\n", str_high_low(v)); } if (fwnode_property_present(fwnode, "slave-mode")) { @@ -353,7 +353,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW); flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH : V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW; - pr_debug("sync-on-green-active %s\n", v ? "high" : "low"); + pr_debug("sync-on-green-active %s\n", str_high_low(v)); } if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v)) { @@ -361,7 +361,7 @@ v4l2_fwnode_endpoint_parse_parallel_bus(struct fwnode_handle *fwnode, V4L2_MBUS_DATA_ENABLE_LOW); flags |= v ? V4L2_MBUS_DATA_ENABLE_HIGH : V4L2_MBUS_DATA_ENABLE_LOW; - pr_debug("data-enable-active %s\n", v ? "high" : "low"); + pr_debug("data-enable-active %s\n", str_high_low(v)); } switch (bus_type) { From patchwork Mon Sep 30 12:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815952 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 1DD5C18F2FD for ; Mon, 30 Sep 2024 12:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697853; cv=none; b=LWL9E0UzDlx9K5aFJ7lxYjHcVTjtC6+7HbBsrY7EcfX7EOxWPfUFQmi9X9xiJQL/V+tbG1zexY/l4XcekMKURnK413UU4lfBKrWKyVvoqv49CF0KDiLOytEZEKWJGWJqrMbIwztj9BC931Ds6YpA8BNnfcdhktM0KCuPDThGd3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697853; c=relaxed/simple; bh=TBylZ8SaoziYjUVhpT7D5LPjCQTvsm3WiWvgxJj6GRA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DHjdUBFHFtXxncjt9//p+vl/nl/1PWgy1vc7PZQjW6FsI/SDmmk4K99db+iXvIOTXN9qqUUThS6+aM2L97WF1cytaCtXj1mPwCWPKZANhkBO+aOwtIKaTTBOAuJzlX09CtPnXbBW0ycqjUm6YA9k/+RgOg/jRGNEPZOYofAG2Zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=OAxdEwfd; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OAxdEwfd" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cb2ad51162so36881076d6.3 for ; Mon, 30 Sep 2024 05:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697851; x=1728302651; darn=lists.linux.dev; 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=uHKPhMgVbBroKUSOZVkcpmjIQRoUB/Pllvr3HK97AsI=; b=OAxdEwfdVNPWJLJWLBxywAhAudd89kUuhhYuYkNQwvaM7vk+WGqdK6Yg6fALapCrH4 v2qlfxS57SSrDhDXKDsXzMEHgscLK6XcFAKE16pxRZH+7mCfeYfvZmydaEyySP6z5Ovb 3Nyz0V3dDUjU+mnR4ofqZ6x4YxaB/x3PB/GRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697851; x=1728302651; 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=uHKPhMgVbBroKUSOZVkcpmjIQRoUB/Pllvr3HK97AsI=; b=uKFw7FOMj1jLEbRVvN8L/EGaDFS6v74C5trWL2uTZFhlt5Hwl2/IzijqM7UFf6agtx 0g8c/mhdo5PDWt/AB72qL1/duiM5h7c+fAZfYwu0gn9sPKttWIe7B2y37D8rBIJlKHys zl+Dz4rdeKm7mTcFEujD+o67K/ugNUYXHsZhPjxNK8XY2NpLhr0BXqmIvaea7wxg+Td0 R6umorkANBHTVxDi3/Jfxi7RbsTt7hlt1vx93WFEIOeqBZmhSN0scTUkaQx35+U8RV91 5bGZKyjYpQIvn4jytOz22M8sXXQlwBogI496C58I8s9oIRAGK7omTmyuG3FM3O/psEz0 D2ag== X-Forwarded-Encrypted: i=1; AJvYcCXbqy9vc1YwMgmXgTYw0r6/EKj6aY7AYLtKdTCQJ0IGz6XhmGXz3Uds3go94+B4FrnXx3g=@lists.linux.dev X-Gm-Message-State: AOJu0YxsXY5Zqo6MI1k7GKKJNtJRg7c+4m/zDmpYxMefJ9OSB+cZA0zS Fo7x9j0mN/O7NgDQ84/TZt3GNDMinVb2nKExO24v1hBYHUZtITzImLxC7Uvpow== X-Google-Smtp-Source: AGHT+IEk2U+7gH+P0zkQD3jLvaacsDuUtudGo2qx4V1eWgV4awKOL7SjyupKFoxi8Ld99dzK+gKdEQ== X-Received: by 2002:a05:6214:4a89:b0:6cb:2adf:751e with SMTP id 6a1803df08f44-6cb3b646986mr155979836d6.31.1727697850717; Mon, 30 Sep 2024 05:04:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:10 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:03:59 +0000 Subject: [PATCH 04/45] media: pwc-ctl: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-4-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 The following cocci warning is fixed: drivers/media/usb/pwc/pwc-ctrl.c:492:5-10: opportunity for str_on_off(power) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pwc/pwc-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/pwc/pwc-ctrl.c b/drivers/media/usb/pwc/pwc-ctrl.c index cff64d872058..a1b4eeb41cfe 100644 --- a/drivers/media/usb/pwc/pwc-ctrl.c +++ b/drivers/media/usb/pwc/pwc-ctrl.c @@ -489,7 +489,7 @@ void pwc_camera_power(struct pwc_device *pdev, int power) SET_POWER_SAVE_MODE_FORMATTER, pdev->ctrl_buf, 1); if (r < 0) PWC_ERROR("Failed to power %s camera (%d)\n", - power ? "on" : "off", r); + str_on_off(power), r); } int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value) From patchwork Mon Sep 30 12:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815953 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 A755518FDB4 for ; Mon, 30 Sep 2024 12:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697856; cv=none; b=II6hvubOz+4yCbApekh29V8/rbRfL8VnWe5zRkokMAYeAjUsBpyQghO3VKmAYfE2jykgfBezBpvQV5L6eLQEEIFVmA7yg62o7zx0nKuyEXm7vQSCVHr219rftrk4Y+i14SW8NTX+nwn9dPAznFHDq2+BX/wO87TjKUKYI41yAZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697856; c=relaxed/simple; bh=4EPc3t0RKZkMLoHchmo/OHohT6ryeJ4Oca6zFWLr0gY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CQuWHlVHwGOaynai+cQtTlJVGP71M9gu8AIh5CUlaFtrNJ55YPF4K/zFfV665Y3WcoOnSi0ruf5S1XdkUphUiDrhKEHV40kFPy46ZfROsD3CfaCLas54wbjVtoFWEdAUkK37S6BpmkJwWIGNk6UiwEcg3GKr7xwq5bSkDzzJU6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=glUVGZjF; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="glUVGZjF" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7acb0499ffeso407381685a.1 for ; Mon, 30 Sep 2024 05:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697853; x=1728302653; darn=lists.linux.dev; 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=Vb+rHfycpw6eqzxAcjL5Q/NM2Cf8FBszS0leZkajSd4=; b=glUVGZjFwttEkUGVD/rkxj/t8kHutkg1dbYi+/S7ejmFyx3TrwdSLdCAG+3bp2piTQ 4GsOByM6JIkJvSrjxXdOizPgk/cJ6qOMPclxXAJ2lQtDSkAezrr5C9HCriJ7KmW2j7VZ SPmzxk1euccZTY5oqW3dCmIl39Indc8kZFUXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697853; x=1728302653; 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=Vb+rHfycpw6eqzxAcjL5Q/NM2Cf8FBszS0leZkajSd4=; b=uL723PXg1AekUfK6o9jOZYfmTvjaccQZdVgSAFq8+phlr/atEvBuOsT1MxuzsG/3eG Rsm0Jn/kIRwuwEW0fVz4ya4HneICQiAvUzVhFpEkGNMixNdV1lMK2bRHV/KZB/OGjUQd cA6G6RvSI17HhP8rLzp7GvNby9WvLRcoiZNUQz/zTmZdieJghCRkzwsf3X9LYJXTsb6G kndNML7yV90JMLNBNiLFbYBKuaNacsr69fs60l8Fh6kh7w3/0FMbHqVxyT7G5UHBJHdE /jbpKG1eCM/1X0b7iWMqUB7RjY3BdTGoB10yd6S16qbUGmk8muPnYYN45R5eKvk9v9lA 5sUA== X-Forwarded-Encrypted: i=1; AJvYcCWN+tziczAbS+0Cz6dhtrlznha4ThsaUsq+S+9FS5sHwr518MI+iiVEDFC+WtDKekO2AQc=@lists.linux.dev X-Gm-Message-State: AOJu0YwqsXe9E+nSuF9F/vPoTuwKYeVF+QXNdWcCVGNDElC+YElNRqgY i5Swjp3slqpnCPmN/IXr/p/AzjCPQtO1YMK52cqr6C3Uo/WUS5HsdUSo7LL/wQ== X-Google-Smtp-Source: AGHT+IERK7kGfru4Q7d82RuyPjgoS6CBbu4N/h9Q+YkCupy/y3EuDtqtjn9iCQgLe1Tq04yD8BYOEQ== X-Received: by 2002:a05:6214:4a8e:b0:6c5:5418:a055 with SMTP id 6a1803df08f44-6cb3b5f2781mr194666026d6.30.1727697853291; Mon, 30 Sep 2024 05:04:13 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:12 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:00 +0000 Subject: [PATCH 05/45] media: pvrusb2:Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-5-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 The following cocci warnings are fixed: drivers/media/usb/pvrusb2/pvrusb2-hdw.c:341:11-14: opportunity for str_true_false(val) drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1727:6-17: opportunity for str_enable_disable(enable_flag) drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1663:6-14: opportunity for str_on_off(enablefl) drivers/media/usb/pvrusb2/pvrusb2-encoder.c:265:8-29: opportunity for str_true_false(hdw -> state_encoder_ok) drivers/media/usb/pvrusb2/pvrusb2-encoder.c:271:9-33: opportunity for str_true_false(hdw -> state_encoder_runok) drivers/media/usb/pvrusb2/pvrusb2-ctrl.c:524:35-38: opportunity for str_true_false(val) drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:475:11-37: opportunity for str_read_write(msgs [ idx ] . flags & I2C_M_RD) drivers/media/usb/pvrusb2/pvrusb2-debugifc.c:151:4-31: opportunity for str_on_off(pvr2_hdw_get_streaming ( hdw )) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pvrusb2/pvrusb2-ctrl.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-debugifc.c | 3 ++- drivers/media/usb/pvrusb2/pvrusb2-encoder.c | 5 ++--- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 6 +++--- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c b/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c index 8ae3ad80cccb..b6c9bda214c8 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-ctrl.c @@ -521,7 +521,7 @@ int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *cptr, *len = scnprintf(buf,maxlen,"%d",val); ret = 0; } else if (cptr->info->type == pvr2_ctl_bool) { - *len = scnprintf(buf,maxlen,"%s",val ? "true" : "false"); + *len = scnprintf(buf, maxlen, "%s", str_true_false(val)); ret = 0; } else if (cptr->info->type == pvr2_ctl_enum) { const char * const *names; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c b/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c index 81d711269ab5..9e4eb03133c9 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c @@ -5,6 +5,7 @@ */ #include +#include #include "pvrusb2-debugifc.h" #include "pvrusb2-hdw.h" #include "pvrusb2-debug.h" @@ -148,7 +149,7 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, bcnt += ccnt; acnt -= ccnt; buf += ccnt; ccnt = scnprintf(buf,acnt,"Streaming is %s\n", - pvr2_hdw_get_streaming(hdw) ? "on" : "off"); + str_on_off(pvr2_hdw_get_streaming(hdw))); bcnt += ccnt; acnt -= ccnt; buf += ccnt; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c index c8102772344b..8a2464744e5b 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-encoder.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-encoder.c @@ -262,14 +262,13 @@ rdData[0]); pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", "state_encoder_ok", - (hdw->state_encoder_ok ? "true" : "false")); + str_true_false(hdw->state_encoder_ok)); if (hdw->state_encoder_runok) { hdw->state_encoder_runok = 0; pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", "state_encoder_runok", - (hdw->state_encoder_runok ? - "true" : "false")); + str_true_false(hdw->state_encoder_runok)); } pvr2_trace( PVR2_TRACE_ERROR_LEGS, diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 29cc207194b9..761d718478ca 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -338,7 +338,7 @@ static void trace_stbit(const char *name,int val) { pvr2_trace(PVR2_TRACE_STBITS, "State bit %s <-- %s", - name,(val ? "true" : "false")); + name, str_true_false(val)); } static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) @@ -1660,7 +1660,7 @@ static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl) anyway, just in case somebody else wants to hear the command... */ pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 stream=%s", - (enablefl ? "on" : "off")); + str_on_off(enablefl)); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl); v4l2_device_call_all(&hdw->v4l2_dev, 0, audio, s_stream, enablefl); if (hdw->decoder_client_id) { @@ -1724,7 +1724,7 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) hdw->state_pipeline_req = enable_flag != 0; pvr2_trace(PVR2_TRACE_START_STOP, "/*--TRACE_STREAM--*/ %s", - enable_flag ? "enable" : "disable"); + str_enable_disable(enable_flag)); } pvr2_hdw_state_sched(hdw); LOCK_GIVE(hdw->big_lock); diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c index 63db04fe12d3..60a0df018334 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c @@ -472,8 +472,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, idx+1,num, msgs[idx].addr, cnt, - (msgs[idx].flags & I2C_M_RD ? - "read" : "write")); + str_read_write(msgs[idx].flags & I2C_M_RD)); if ((ret > 0) || !(msgs[idx].flags & I2C_M_RD)) { if (cnt > 8) cnt = 8; pr_cont(" ["); From patchwork Mon Sep 30 12:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815954 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 4F29C190051 for ; Mon, 30 Sep 2024 12:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697858; cv=none; b=EY2u9/gDSWo0og0jRbsDWgosVf0MsFvAaEJ9tkaY9gPMBko+Y3VcHqOjf+wDgrH2Ssb0DurwaqE77Nr642xt5YAPA/KETAf2Muvo3fHJXyjHbDghJQesNefbYlczopnXOwB+KwKjrHdZTyp1fyXHQ/zPkDZJdC3lVwDPsDHoHJo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697858; c=relaxed/simple; bh=8MgT7dP1g3olMOrBUhOPMpyuDlnQim8dCackH8O66yY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Cu5CG5uUPW/Fap+N5j+GpfbPvajankZTPtVBvnaoqfGDYV0zfoLJMZ3cp3Vu661G2OOU0Uc3Az8h/zJjJM1NUlYiI/3pO4c5OoSfiRUq88MotohzD2dTK4XBZIgi7mvN39uOOYa+4HjCrT8XDxQg8jQi+wFvV/IIbSw9XqXSyHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=eX539iI7; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eX539iI7" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6cb3ba0a9a2so23997916d6.2 for ; Mon, 30 Sep 2024 05:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697855; x=1728302655; darn=lists.linux.dev; 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=qsuMyrkoVqVku50v1nfIbGtDSp7S7nG6aU9K9Rp04Bk=; b=eX539iI7gOXOtdSGVCztQ4c8ClmR8IwQIAXtuWoERMAKFz+gCNLQcWYv0sDgcx/yTF e5N1AvbYY/LCWwXCNJVyEr6Thoxqj0sBsT7Y29jWUI0BMCOzLYqSOjgYXErrVAn1pIxi 6onnyFnh/jX7w1gJWTnVH8XHM1GSU3eqegdhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697855; x=1728302655; 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=qsuMyrkoVqVku50v1nfIbGtDSp7S7nG6aU9K9Rp04Bk=; b=Fre5pKbOA9i1QkfqoUYsEc2PQ3lz2rB8lSNTt61V9DnmF4q5TGwM44DzH0TnV9Pk2O adjCu8fWtgsx4N9zsCY+GlAQVDP9x+aafiQylfJLaJVVIe+Q3ZLoVJsYAnxeYtQP77/C h4V42yQCOM6zhV7lKy9rumYbawcFwdQgiHW05h9r2eVCFI9D+HfTQG4gugwUycA/Y9Em +H+gaOGKQG4YPTm3lrPrPRpnMKQdtp4YiwZMtKG152kTlEybQel1PTKEg8SdaBS5TCOJ kRnBGt3XDoQJcNWtPas9WGWTleupN/uLTHVqw9AlR317HnKs0tIHhUpJq9b4Po28SxmK wMZw== X-Forwarded-Encrypted: i=1; AJvYcCXenihIoS2wiVK/E3Qh8Ec9vNAWT+hrMr9kCKe2K3h+3c3/cqcBIejU7zDRVtakTytbwvU=@lists.linux.dev X-Gm-Message-State: AOJu0YyS7xbkmR8koQWhWHWfpznjUC+kg+54l5dxzOaMhH3cNnZ/r/Sz gF6/tD847tw1lrypX2Y4IagMo8M7pCdQrAjUwdIHVk0E7UZ3nn64eYxmlQLmpA== X-Google-Smtp-Source: AGHT+IGbIk2oHMQ7FRb0GeJel1Jh9P6FVq0oOGmExjq89yc9rCz3p632i5Dvmp6LRIkRrX30gKUAOQ== X-Received: by 2002:a05:6214:5990:b0:6cb:3925:ec95 with SMTP id 6a1803df08f44-6cb3b66d1a1mr155459916d6.53.1727697855060; Mon, 30 Sep 2024 05:04:15 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:13 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:01 +0000 Subject: [PATCH 06/45] media: em28xx: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-6-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 The following cocci warnings are fixed: drivers/media/usb/em28xx/em28xx-i2c.c:579:3-29: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/em28xx/em28xx-i2c.c:590:2-28: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/em28xx/em28xx-video.c:941:4-9: opportunity for str_enabled_disabled(flags) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/em28xx/em28xx-i2c.c | 4 ++-- drivers/media/usb/em28xx/em28xx-video.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index a7eb11f7fb34..62fe49876a32 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -576,7 +576,7 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, goto error; dprintk(2, "%s %s addr=%02x len=%d: %*ph\n", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len, msgs[i].len, msgs[i].buf); @@ -587,7 +587,7 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, error: dprintk(2, "%s %s addr=%02x len=%d: %sERROR: %i\n", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len, (rc == -ENODEV) ? "no device " : "", diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 4aef584e21da..ff017c187aff 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -938,7 +938,7 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev) dev_err(&dev->intf->dev, "Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } From patchwork Mon Sep 30 12:04:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815955 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 B7F2119048F for ; Mon, 30 Sep 2024 12:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697860; cv=none; b=cI9wwB15YF9KK1tT5UtBHu74FKXpH97qaT4E1whMn90n8Uj3lNVK5XtrL/S4cyfrHe5LL69268Ad7qKBog4kmCjZC3LMh2S/Gu0Nssde7Nsw/PK86Bz7yTtOG084R/8/dgDnAVjHAdNBsU5Vk6HQjXs9GyTHPcKa35iwP2wnsGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697860; c=relaxed/simple; bh=ICSsuBtQWRmVw7s3R+cDaXaHD1gfa1jDUFcDWE5NTRk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fOnabcLYFQrmZnT3OUzotvD9s40zVQ7Ag2gkp/WydMVnSBU/k0g9pbPqDjnUbgqQQYZsvPVDTFlFweMBwl+V5w16I71j8vQpiGCDonD0dziiDXRejYb6w+N/KXfSIMQTJ4Fg6gul0+7eACFbaYUe0hBC/IG1CL82z31OLxPhBbI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=aky6wAgs; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="aky6wAgs" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7a99e4417c3so373676085a.1 for ; Mon, 30 Sep 2024 05:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697858; x=1728302658; darn=lists.linux.dev; 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=Oi1bEzb1SAt3y006RY0yDL5v/D/r838jI6u8v0CE/P0=; b=aky6wAgsPPVRcAYWeaOmO8gtuvvNmII+DVrkiiMqqbwZ78K2/dAUTjlKYtl3ZNGVeh m8S0BxaP975nIMhguffn5o55y5auE6/5ClakAn9rCksuwhh2JPRLIj3hFmd/mhMEXvz5 97koMc7WubTms4IxS6QAiJLFHw1WKN/v55srQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697858; x=1728302658; 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=Oi1bEzb1SAt3y006RY0yDL5v/D/r838jI6u8v0CE/P0=; b=lIXWjfUyxLmEnPYul3A0E6HuGJq4PvwuhvaB3XFzt+wa6tGI3/Z7urN+LjJZBLwGKz ZjEIV4SeBLGdcviubesLcSfxXMPn00eECJqfAKC5n2awMSGyX0OE/9hrYRRtwBV+5Eb7 LDbUtHWEeVEMHVJll26bbrJzcgc/Ou+3QAH2m7HSA7wBnRtbSOXxavCZehPEtEcUwS7K ku5Mwo8HujMEViJIuxiwUdaNzYNB/QIyd9YP2TW7gDywLWTyW5LSWCb/fyf4IG5z4fQh HX7ccp8sRgRqrRuXPuItGG9nZtXyLIy09Cz4IpNMUgjGl9odtZT0JgQ8wJ8HFe3P5GPd sUlQ== X-Forwarded-Encrypted: i=1; AJvYcCVuz7Bddqnpqsfkl855+4KWcw3dIEeqSppI+95oiaMqEbA9q5U/JQu21kH0FVHaiRoN7J8=@lists.linux.dev X-Gm-Message-State: AOJu0YxXYfryGSWf6xMKfHgV1c4wwbwIC3TPcGA4K/ZQ4JWF6d9zn9Sp E0J1XsPFfJfx6oOWml1RNOoj9yIBlZTUhaNuKMDvijOymD6zMCAj19lJbZp7Qw== X-Google-Smtp-Source: AGHT+IEfJSXK0Wsel23PY6RuLEcqGR+eVsnaqOIyvQM277nf0XUs151BJ1cKdgq24SPhmJrtG19jVA== X-Received: by 2002:a05:6214:488f:b0:6cb:5fba:e006 with SMTP id 6a1803df08f44-6cb5fbae166mr61875236d6.29.1727697857240; Mon, 30 Sep 2024 05:04:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:15 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:02 +0000 Subject: [PATCH 07/45] media: dvb-usb: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-7-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 The following cocci warnings are fixed: drivers/media/usb/dvb-usb/opera1.c:326:26-31: opportunity for str_enable_disable(onoff) drivers/media/usb/dvb-usb/opera1.c:310:3-8: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/opera1.c:283:19-24: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/opera1.c:296:23-28: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/dvb-usb-dvb.c:49:21-26: opportunity for str_on_off(onoff) drivers/media/usb/dvb-usb/dvb-usb-dvb.c:47:2-46: opportunity for str_yes_no(adap -> fe_adap [ adap -> active_fe ] . pid_filtering) drivers/media/usb/dvb-usb/af9005-fe.c:1282:27-31: opportunity for str_high_low(temp) drivers/media/usb/dvb-usb/af9005-fe.c:790:30-32: opportunity for str_on_off(on) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/dvb-usb/af9005-fe.c | 4 ++-- drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 6 +++--- drivers/media/usb/dvb-usb/opera1.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/dvb-usb/af9005-fe.c b/drivers/media/usb/dvb-usb/af9005-fe.c index 404e56b32145..ea3aaf3a56cb 100644 --- a/drivers/media/usb/dvb-usb/af9005-fe.c +++ b/drivers/media/usb/dvb-usb/af9005-fe.c @@ -787,7 +787,7 @@ static int af9005_fe_power(struct dvb_frontend *fe, int on) struct af9005_fe_state *state = fe->demodulator_priv; u8 temp = on; int ret; - deb_info("power %s tuner\n", on ? "on" : "off"); + deb_info("power %s tuner\n", str_on_off(on)); ret = af9005_send_command(state->d, 0x03, &temp, 1, NULL, 0); return ret; } @@ -1279,7 +1279,7 @@ static int af9005_fe_get_frontend(struct dvb_frontend *fe, if (ret) return ret; /* if temp is set = high priority */ - deb_info("PRIORITY %s\n", temp ? "high" : "low"); + deb_info("PRIORITY %s\n", str_high_low(temp)); /* high coderate */ ret = diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 0a7f8ba90992..b663c3dff25c 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -44,9 +44,9 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) /* activate the pid on the device specific pid_filter */ deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n", - adap->fe_adap[adap->active_fe].pid_filtering ? - "yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid, - dvbdmxfeed->index, onoff ? "on" : "off"); + str_yes_no(adap->fe_adap[adap->active_fe].pid_filtering), + dvbdmxfeed->pid, dvbdmxfeed->pid, + dvbdmxfeed->index, str_on_off(onoff)); if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER && adap->fe_adap[adap->active_fe].pid_filtering && adap->props.fe[adap->active_fe].pid_filter != NULL) diff --git a/drivers/media/usb/dvb-usb/opera1.c b/drivers/media/usb/dvb-usb/opera1.c index 268f05fc8691..8412b64660d8 100644 --- a/drivers/media/usb/dvb-usb/opera1.c +++ b/drivers/media/usb/dvb-usb/opera1.c @@ -280,7 +280,7 @@ static int opera1_power_ctrl(struct dvb_usb_device *d, int onoff) u8 val = onoff ? 0x01 : 0x00; if (dvb_usb_opera1_debug) - info("power %s", onoff ? "on" : "off"); + info("power %s", str_on_off(onoff)); return opera1_xilinx_rw(d->udev, 0xb7, val, &val, 1, OPERA_WRITE_MSG); } @@ -293,7 +293,7 @@ static int opera1_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) {.addr = ADDR_B1A6_STREAM_CTRL,.buf = onoff ? buf_start : buf_stop,.len = 2}, }; if (dvb_usb_opera1_debug) - info("streaming %s", onoff ? "on" : "off"); + info("streaming %s", str_on_off(onoff)); i2c_transfer(&adap->dev->i2c_adap, start_tuner, 1); return 0; } @@ -307,7 +307,7 @@ static int opera1_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, }; if (dvb_usb_opera1_debug) info("pidfilter index: %d pid: %d %s", index, pid, - onoff ? "on" : "off"); + str_on_off(onoff)); b_pid[0] = (2 * index) + 4; b_pid[1] = onoff ? (pid & 0xff) : (0x00); b_pid[2] = onoff ? ((pid >> 8) & 0xff) : (0x00); @@ -323,7 +323,7 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff) {.addr = ADDR_B1A6_STREAM_CTRL,.buf = b_pid,.len = 3}, }; if (dvb_usb_opera1_debug) - info("%s hw-pidfilter", onoff ? "enable" : "disable"); + info("%s hw-pidfilter", str_enable_disable(onoff)); for (; u < 0x7e; u += 2) { b_pid[0] = u; b_pid[1] = 0; From patchwork Mon Sep 30 12:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815956 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 BF91E19047E for ; Mon, 30 Sep 2024 12:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697862; cv=none; b=eVLJsGlwdMrrzcU75+gXIIwOIq6P5T1Cl/9/pfMYy2MPU5pUfMJBeeioY75d+APV53XuYiTlLFB5t2SUg+8Oryjcy6dZM4fnPlFXWHmhKQUj+5Hef1wWgdRkilpWGMfsxu9K05pKFOChdMjWYO05FsrrSsqzuqBg/1NqZPjCoRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697862; c=relaxed/simple; bh=BvA7+CDkEDbwQNrCD6szhKebs9WzOh0Xxj8N0zINlEg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MNCknhFT/Uq/ph2aiDV+egrc7+EgiRFs1fS1y8A+mRpXuDU6vWt49nCsTugo1pzkYo2nBP+h0j8ypvPw4ULv3+TLRFGvXWuEvEqx7ysn1nawfboYDfuQHO+yk9buUcJ9YnoaMV8T0PpAzJS5IrB7yYRrGnhKaOrP+F3+qEccGT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=C3A5heir; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="C3A5heir" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-710fe5c3b44so2523505a34.0 for ; Mon, 30 Sep 2024 05:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697860; x=1728302660; darn=lists.linux.dev; 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=oyq88t8pWb3nvRMsH4SWW8lN0+v/o8BALR3Lyr5Ymdo=; b=C3A5heirkURS+pl7kVHEHQ7ZhCnzlzLmc24bYqz+g2NhENAcmVEsXmDmi1jGwNTJAn N0mVV/8yr6Uv+sIc2rfezBeGay8GTvWfXTrHxYKcsUVAmNsm2IaG0O9lHiIER4hTpknQ Y6ufnubil9L86M1+xcxbFvMRRSLO50N+LZjOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697860; x=1728302660; 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=oyq88t8pWb3nvRMsH4SWW8lN0+v/o8BALR3Lyr5Ymdo=; b=C8+67YGBXDi803WVcccpAthZ50eIs9w0PyQuOjne6DcPy1ewvpvgf5JWL/B8OUoRbr Pl8TMMUXPFLis1pp9nKJLeYcod/Q/0lNdcwfJGbUUlW153jEirq4Y2IRcVyCgXhAHKUG 1WbDGtVrnJ7nhPmQfY5WumjtcKwzLxOJxQCJm5tlU8wEcfqnKzllIWZCFDFMw3JS6QJ2 duSi1dc6grG7csWAFvVEHGfTyrDc9j0qqSEizt/lU4/qfgMevbvPy4L+oTTopLSnGAf9 sL7dCGIWTxKYDyk+ltoWFWjWzpCnqEQEDxUuAngnLJ5nvFVWRfZ+7wYilUpATPktxsBm CA+w== X-Forwarded-Encrypted: i=1; AJvYcCVTx8OWHIrc5DhV3yfGH57WSii/XNR/o+sjK9E34dxMJQZM5fnbYnLp2lfvl0JmjOpLLt8=@lists.linux.dev X-Gm-Message-State: AOJu0YwOSg5PE62Xkh6aMfRyk3vGuTcxtOhrS2mtmfCmO5WyzaoPNr8m zwo8eqDFjFrj5QQ8une1XQuqt3yslzEC1lCjekaKBt99tcCBdLeIXRzT7osqGg== X-Google-Smtp-Source: AGHT+IGlFIIrabSCXdg/bJ9e3MVgi6gfLFZpzZGyv3CgenARKjE0A4bquSvob8woJ1CdObZm4BjrEg== X-Received: by 2002:a05:6359:8488:b0:1bc:d1ba:225 with SMTP id e5c5f4694b2df-1becbb8fbe2mr306353155d.10.1727697859596; Mon, 30 Sep 2024 05:04:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:18 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:03 +0000 Subject: [PATCH 08/45] media: dvb-usb-v2: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-8-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 The following cocci warnings are fixed: drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:250:3-22: opportunity for str_yes_no(adap -> pid_filtering) drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:337:3-22: opportunity for str_yes_no(adap -> pid_filtering) drivers/media/usb/dvb-usb-v2/az6007.c:82:32-38: opportunity for str_enable_disable(enable) drivers/media/usb/dvb-usb-v2/az6007.c:192:32-37: opportunity for str_enable_disable(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/dvb-usb-v2/az6007.c | 4 ++-- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index 2410054ddb2c..1e9f946193a6 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -79,7 +79,7 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) struct dvb_usb_adapter *adap = fe->sec_priv; int status = 0; - pr_debug("%s: %s\n", __func__, enable ? "enable" : "disable"); + pr_debug("%s: %s\n", __func__, str_enable_disable(enable)); if (!adap || !st) return -EINVAL; @@ -189,7 +189,7 @@ static int az6007_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct dvb_usb_device *d = fe_to_d(fe); - pr_debug("%s: %s\n", __func__, onoff ? "enable" : "disable"); + pr_debug("%s: %s\n", __func__, str_enable_disable(onoff)); return az6007_write(d, 0xbc, onoff, 0, NULL, 0); } diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index f1c79f351ec8..c0a40112d043 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -247,7 +247,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: %04x (%04d) at index %d\n", __func__, adap->id, adap->active_fe, dvbdmxfeed->type, - adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, + str_yes_no(adap->pid_filtering), dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index); /* wait init is done */ @@ -334,7 +334,7 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: %04x (%04d) at index %d\n", __func__, adap->id, adap->active_fe, dvbdmxfeed->type, - adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, + str_yes_no(adap->pid_filtering), dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index); if (adap->active_fe == -1) From patchwork Mon Sep 30 12:04:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815957 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 920C5191F88 for ; Mon, 30 Sep 2024 12:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697864; cv=none; b=VAik+4qgT6lEsBLpYVjTfh6MisON3y35SPwJdhxgAnWYFIoNWhZVEnP67/tefvc21I9HSYLf6tqrMbHwEpIgMyxY1vFLuiRamDLeQtJX5pvvM8bCodYWisjLVHMnFI7DvFwvzdpSo3lHV48FHgbyuFthnvYaiyU2S4cw0HALZR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697864; c=relaxed/simple; bh=GRNRTE3KFYZCTqmHqSQFYdbDtQolStbwq9AxxoNYcUM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tlLCBJHOTq5crtCdgVjTQtHYOCMrao1LOJ1Gss6KdxdPI7jMAYYodvGPB0/9ciOxzrgWMRltSIasYcNnbkn47wDs7wlyzz9BTtxGBphKnj5KXOTPbVjyWrNezZkjha/rIITfuUlUcPkSpqKbdMPfGqEfOLUow7PTO+EbbfhaEa4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=FwYyskmE; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FwYyskmE" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6c3f12d3930so37215076d6.3 for ; Mon, 30 Sep 2024 05:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697861; x=1728302661; darn=lists.linux.dev; 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=o0DduMWqX0LlLrfJFzeOwfQDx0mBLtEZV9WrRhA8PwA=; b=FwYyskmEE7n0nyFQn5vKKQ7xvvJfMweRl4Jj3eqq01hZXdzy3XKbc/4tZDjQGdoO9k iTYz+XPfG8J/PJ/PXi+2Lqi+ajmUntgUaipP55fLrTqlNspjEIZvT61ImVySPpQDBBIH yLWSd5h8XBr4zzhAqPE9KanwGpjxKFChcECck= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697861; x=1728302661; 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=o0DduMWqX0LlLrfJFzeOwfQDx0mBLtEZV9WrRhA8PwA=; b=s0SI3vchJqnDthAW3c2TQaI0tOyqiUyadSkxwXfy/+v2AHDDcRRYf6TbqwDF5i8uFE /LWwa47/2W37/KUpSbJCoZsh4F4s0yNTVs0dmc12+1x+eSpWlK1K9lZ1TcjzL3yyOPY/ sXJ0bBp5UvLa4lJBrOaoT9aW5Z7ORLVbBiUTQUEmRbzUM9sVblkRaDLBpWSElwrrdBzi is5dcmDYoIVYqoTM2E7u8VjyAeakkczyES1MUc/48vWE6aWFgiPd/s3PuLpq5tegz1Ii Ee32dWbFqiiuX28A8sCI+UQiUhRXCXFyTtwBdiuxRkQdq2PYYHTUBhpvsBZh8pePk/ma VUGg== X-Forwarded-Encrypted: i=1; AJvYcCXGhiX3Xl+Nau6wPtWQyU3A7RHa4XqepOHGltNo6VI+RGSS4pzD9BnK/Jq5HQZrj6px8dg=@lists.linux.dev X-Gm-Message-State: AOJu0YyXGSdI2CRD4zo267b5S3Fq8CilG0UbLUJ37DA/OH4wJ9KNKIED BU516l+SCY2Ki9RHlwXbRgcgdarX1jEtgGSZGY+2uNpgfT8fpyY49FjqIuTqrw== X-Google-Smtp-Source: AGHT+IFW5o76WLto1m5OIr01yojLQTVPsUEplusVOtBKeM+zgF4Mr8Jjm4ekkrZvP/8oEpp3jj7xuA== X-Received: by 2002:a05:6214:3a88:b0:6cb:35ea:a343 with SMTP id 6a1803df08f44-6cb3b5b60c5mr157899696d6.5.1727697861311; Mon, 30 Sep 2024 05:04:21 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:20 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:04 +0000 Subject: [PATCH 09/45] media: cx231xx: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-9-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 The following cocci warnings are fixed: drivers/media/usb/cx231xx/cx231xx-video.c:144:4-9: opportunity for str_enabled_disabled(flags) drivers/media/usb/cx231xx/cx231xx-i2c.c:373:4-30: opportunity for str_read_write(( msgs [ i ] . flags & I2C_M_RD )) drivers/media/usb/cx231xx/cx231xx-i2c.c:402:4-32: opportunity for str_read_write(( msgs [ i + 1 ] . flags & I2C_M_RD )) Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-i2c.c | 4 ++-- drivers/media/usb/cx231xx/cx231xx-video.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index 6da8e7943d94..6d8b70562f6d 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -370,7 +370,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, addr = msgs[i].addr; dprintk2(2, "%s %s addr=0x%x len=%d:", - (msgs[i].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i].flags & I2C_M_RD), i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len); if (!msgs[i].len) { /* no len: check only for device presence */ @@ -399,7 +399,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, } /* read bytes */ dprintk2(2, "plus %s %s addr=0x%x len=%d:", - (msgs[i+1].flags & I2C_M_RD) ? "read" : "write", + str_read_write(msgs[i + 1].flags & I2C_M_RD), i+1 == num - 1 ? "stop" : "nonstop", addr, msgs[i+1].len); rc = cx231xx_i2c_recv_bytes_with_saddr(i2c_adap, &msgs[i], diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 435eb0b32cb1..4cdcfe635ad7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -141,7 +141,7 @@ static int cx231xx_enable_analog_tuner(struct cx231xx *dev) dev_err(dev->dev, "Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } else From patchwork Mon Sep 30 12:04:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815958 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 7088D1922FC for ; Mon, 30 Sep 2024 12:04:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697866; cv=none; b=rvL9/iaZVoalixRDjvsdfIyKpNMKEohwZwoo2TB9yoyg6cXfEeWFFx7nuhAacY+lFMVF2DKnWkGOwLeXixIPNiPs6C4bAwx+4j7VBjrWgTsP7PGLPpWMzqEpNTh8XLLPJL12g0JJp/de8nZ8Zai78rR3A5HHaDi8H8/ejbu64oY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697866; c=relaxed/simple; bh=WfL92qRYRM/NN8550n/7vszyPNHtfWY3JGFtsXpdWIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V9ktIXfO24HOz+ZMwK6gjHHASJQqd8yBSbfEDlSLDEFsAS8hV/H9AGoKH9XwtuQKmmFesQCnGktRikclfnR0V9Xgx1Jm8v6ao4GwiPBHTHO91DZRIj/wCWYQVEHYvSdjHz/DS/W7W3K3+jyY1gt2171lrs2hL6S/mzc15EggJF4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=oRIbCOwh; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oRIbCOwh" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7a9ad15d11bso391921385a.0 for ; Mon, 30 Sep 2024 05:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697863; x=1728302663; darn=lists.linux.dev; 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=42a4vpn3QTtS0EhgGJlcs62eAaEwJVXQ21s4ykHFIBI=; b=oRIbCOwhZ/fjEIygtdfnWbDbZ3F1+Yo3iAKIPmOZ+F+ioROdMaZdGRnn51SLAMy1jd VqZaspQwCHlmbUyDWem7cdOha7D9tIm3BQ8ZbrV2/kVXRX6sVQMuuGtnk/qgysdVHPne JiYNEGyBXt0nejdC8GoTLJ4YPK4s/np8IAO/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697863; x=1728302663; 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=42a4vpn3QTtS0EhgGJlcs62eAaEwJVXQ21s4ykHFIBI=; b=bHT8zEUGpdG4yCcbAh/+wwx8ciY/KwnF9NI0ELhad2U82lW9kfq5EQKWTAbQVWOLXh hR1oSjQjoYeAWYBB/U2CUTMOoKH91hpv6YPc1JsQBxUbQIy4QzBYu+MZhBFfprl1WWk8 EsLJ/Wn+dhU78Tuan8D/CEZ/bqPmh044XW8fi694Wo3RrUZFrkWLBrg0bHAt/Dmk9qus 4QmSRmYLYC8b6PXBZ3tU+8gW+b/2ctGejXfTNPGOy3wFsyPZTTJDlpxiKE0JrxyvorAF r3oH2OF9tV/g+7TFjjdhDLEh0J2MDKimcEkrAha8Owr8Tw7QTKLPjZ9BU0UfHG38fmUA ie2g== X-Forwarded-Encrypted: i=1; AJvYcCUFuM3MqxgkEkSDaNuJeoQXf7+8F4EdVsHIxn1k4L8GRBWoP3zCNG+Mf8xRTYgpjcyUuxA=@lists.linux.dev X-Gm-Message-State: AOJu0Yx/dvpcMf+fnPA4eElKYtPANxITgzeC4rDpPaeASNMfgUJFrb88 Ng9vpLjPUdw/Tz3UFLydNwR7z9khSCa1HPASb4+Em0cqt2pUYwy+NIb3T8mINQ== X-Google-Smtp-Source: AGHT+IFlDabMazwXnqk+xIMlKgzFONIbVzdm9vY20CpqT4dLcojtxwjmPMueB5KKSCBhlfp1Ts2Ejw== X-Received: by 2002:a05:6214:460f:b0:6c3:5ebb:9526 with SMTP id 6a1803df08f44-6cb3b5f2d1bmr196194196d6.29.1727697863111; Mon, 30 Sep 2024 05:04:23 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:21 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:05 +0000 Subject: [PATCH 10/45] media: tuners: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-10-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 The following cocci warnings are fixed: drivers/media/tuners/tda18250.c:110:3-12: opportunity for str_true_false(triggered) drivers/media/tuners/tda9887.c:296:39-54: opportunity for str_high_low(( buf [ 0 ] & 0x20 )) drivers/media/tuners/tda9887.c:298:39-54: opportunity for str_high_low(( buf [ 0 ] & 0x80 )) drivers/media/tuners/tda9887.c:294:39-54: opportunity for str_yes_no(( buf [ 0 ] & 0x01 )) drivers/media/tuners/tda9887.c:347:5-20: opportunity for str_yes_no(( buf [ 1 ] & 0x02 )) drivers/media/tuners/tda9887.c:353:5-20: opportunity for str_yes_no(( buf [ 1 ] & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/tuners/tda18250.c | 2 +- drivers/media/tuners/tda9887.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/tuners/tda18250.c b/drivers/media/tuners/tda18250.c index 68d0275f29e1..853600c80839 100644 --- a/drivers/media/tuners/tda18250.c +++ b/drivers/media/tuners/tda18250.c @@ -107,7 +107,7 @@ static int tda18250_wait_for_irq(struct dvb_frontend *fe, dev_dbg(&client->dev, "waited IRQ (0x%02x) %d ms, triggered: %s", irq, jiffies_to_msecs(jiffies) - (jiffies_to_msecs(timeout) - maxwait), - triggered ? "true" : "false"); + str_true_false(triggered)); if (!triggered) return -ETIMEDOUT; diff --git a/drivers/media/tuners/tda9887.c b/drivers/media/tuners/tda9887.c index b2f7054c1832..f403dcf14aa0 100644 --- a/drivers/media/tuners/tda9887.c +++ b/drivers/media/tuners/tda9887.c @@ -291,11 +291,11 @@ static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) "+ 12.5 kHz", }; tuner_info("read: 0x%2x\n", buf[0]); - tuner_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); + tuner_info(" after power on : %s\n", str_yes_no(buf[0] & 0x01)); tuner_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); - tuner_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); + tuner_info(" fmif level : %s\n", str_high_low(buf[0] & 0x20)); tuner_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); - tuner_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); + tuner_info(" vfi level : %s\n", str_high_low(buf[0] & 0x80)); } static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) @@ -344,13 +344,13 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) tuner_info(" B0 video mode : %s\n", (buf[1] & 0x01) ? "video trap" : "sound trap"); tuner_info(" B1 auto mute fm : %s\n", - (buf[1] & 0x02) ? "yes" : "no"); + str_yes_no(buf[1] & 0x02)); tuner_info(" B2 carrier mode : %s\n", (buf[1] & 0x04) ? "QSS" : "Intercarrier"); tuner_info(" B3-4 tv sound/radio : %s\n", sound[(buf[1] & 0x18) >> 3]); tuner_info(" B5 force mute audio: %s\n", - (buf[1] & 0x20) ? "yes" : "no"); + str_yes_no(buf[1] & 0x20)); tuner_info(" B6 output port 1 : %s\n", (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); tuner_info(" B7 output port 2 : %s\n", From patchwork Mon Sep 30 12:04:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815959 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.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 6C546192B61 for ; Mon, 30 Sep 2024 12:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697869; cv=none; b=WUwL2bueLL3+zrNEwGFHulh/uzcHiA17yiiDMIFJgIzgybwcQzHcdZvp/umIiUt1vgBeRUBTJxuIZyJZLKX+FIQ5e1F3OXfw2hNmhaDCUl8gtHBkTlJL2IEs+DbktoKZQFr2CBC72QZoz0WNiRZldUNHW2isbyDfSSnpbN0VHBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697869; c=relaxed/simple; bh=cnDoJb8yt4N23hqgVqtt6DugifeR9k05ai5VXwEP3n8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jAXpjYAPFfZ+gD2poW/9C5rTZ27NxTOedPN4Se0JbSK5SAsqgn0/UlCcoSAwf3JMxBT5VFSMvi3DOAOyPSg6247FaM9qPDT2py8AbXYIOtLsEdLAvNlRFsbED12q3J76n10wh2JoVsNyYLrRk6Fo2ebndzHXZII5QE+AZbUoMEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cA7/OcfF; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cA7/OcfF" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6cb54eef205so14798346d6.2 for ; Mon, 30 Sep 2024 05:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697865; x=1728302665; darn=lists.linux.dev; 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=t2tB8sFg/5a2I4zeaxxZR6pf56+tHkpHPezEUEsu9lc=; b=cA7/OcfF6+CEN93lilnuAEgHT3VOwYTELSVMWG1cvz4nPDkCVxBHDkeNyy0J6ZcMtt ic6UBg//Ok+d554WhJ4V3W8Uwoa5exD4LiliqTmVvUtC62pE8HXcGRoqEuxBUznp19/C 3nJLT/Y7bbzWKoOTd6qmvR2VLRR5bOfCIWGEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697865; x=1728302665; 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=t2tB8sFg/5a2I4zeaxxZR6pf56+tHkpHPezEUEsu9lc=; b=kjpiOcLwxkYn1leHvQzJg4Lr0TzkUxgbbv23xoBaf/OibbvYK4vC+cuXYwOG6CP75U GmVmTL8k2qDG1kc5t8tIMxU3My8OD2FTNuuZvNyxL1fnaqqddSFfXv+W7C0FmVq0by7E GkC9frnXq6Xhta7/vZvKpsTcH4jwAo+k+PZ1jr/erw2aXMAX4crKnj+Wq7gpqe+lvjiM nENEmftGIUYsF3Wx3jrefQ4pHBqhcOPyQkUs5OgIQz1oc4P1qYWPm3H/Lz/TF9A502Bn wk2lrr8z1IGpV+tUW1Es+iv2VXoaqIQyvmlryOuIJiQCoRWTNyU9R42YZXyYq3zvi3o9 +zrw== X-Forwarded-Encrypted: i=1; AJvYcCVHZ2jFSJ14O0CG2yLpYcitIz4VG/mnkzTDoJ4vtm/iCTEzg2M3/YHhB31RAJfTHi5R8FI=@lists.linux.dev X-Gm-Message-State: AOJu0YwzRrNdtQ81bI7ll0UUYOCki8298T4M3xYL7FPxrWvm7aINvnu5 M1g6T46aip4nwzcVKpc35R1N7E4btP+TVffYwEBO9nvcnGDh1Plq7ujiQJ4+tA== X-Google-Smtp-Source: AGHT+IHhNN24sJCIubgfbFA4VGeLvNv4RKY7X5IqP1ufDg/rjxIUh41wM/wPVdTOII53M0RqAZGVpA== X-Received: by 2002:a05:6214:3982:b0:6cb:3e26:bcaf with SMTP id 6a1803df08f44-6cb3e26bd60mr117592306d6.32.1727697865303; Mon, 30 Sep 2024 05:04:25 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:24 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:06 +0000 Subject: [PATCH 11/45] media: rc: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-11-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 The following cocci warnings are fixed: drivers/media/rc/mceusb.c:1130:2-8: opportunity for str_enable_disable(enable) drivers/media/rc/ene_ir.c:1121:22-28: opportunity for str_enabled_disabled(enable) drivers/media/rc/serial_ir.c:591:4-9: opportunity for str_low_high(sense) drivers/media/rc/serial_ir.c:594:4-9: opportunity for str_low_high(sense) Signed-off-by: Ricardo Ribalda --- drivers/media/rc/ene_ir.c | 3 ++- drivers/media/rc/mceusb.c | 3 ++- drivers/media/rc/serial_ir.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 67722e2e47ff..90bee860a8a1 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "ene_ir.h" @@ -1118,7 +1119,7 @@ static void ene_remove(struct pnp_dev *pnp_dev) /* enable wake on IR (wakes on specific button on original remote) */ static void ene_enable_wake(struct ene_device *dev, bool enable) { - dbg("wake on IR %s", enable ? "enabled" : "disabled"); + dbg("wake on IR %s", str_enabled_disabled(enable)); ene_set_clear_reg_mask(dev, ENE_FW1, ENE_FW1_WAKE, enable); } diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index cd7af4d88b7f..7f932f0f5750 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1127,7 +1128,7 @@ static int mceusb_set_rx_carrier_report(struct rc_dev *dev, int enable) MCE_CMD_SETIRRXPORTEN, 0x00 }; dev_dbg(ir->dev, "%s short-range receiver carrier reporting", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (enable) { ir->carrier_report_enabled = true; if (!ir->learning_active) { diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c index fc5fd3927177..f9ec2f043529 100644 --- a/drivers/media/rc/serial_ir.c +++ b/drivers/media/rc/serial_ir.c @@ -25,6 +25,7 @@ #include #include #include +#include #include struct serial_ir_hw { @@ -588,10 +589,10 @@ static int serial_ir_probe(struct platform_device *dev) } sense = nlow >= nhigh ? 1 : 0; dev_info(&dev->dev, "auto-detected active %s receiver\n", - sense ? "low" : "high"); + str_low_high(sense)); } else dev_info(&dev->dev, "Manually using active %s receiver\n", - sense ? "low" : "high"); + str_low_high(sense)); dev_dbg(&dev->dev, "Interrupt %d, port %04x obtained\n", irq, io); From patchwork Mon Sep 30 12:04:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815960 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 04D36192D6F for ; Mon, 30 Sep 2024 12:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697871; cv=none; b=IfWyCI48yK430PKoHiZe7vPDt1fHJvWu95Egp6lbnsN3dMB4LUv55ExP8Eq0uBkyZRe/gM5ioE6Y64osbK8q2o3hEnsTmddm34V4/w1gmhGZOF+zEZn2smiszk06B4yKqvCER2vv7xZ5p9BwvYY7/hY0OBPHrxRIefmGZ+UxHXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697871; c=relaxed/simple; bh=Fj4hGSAt0kunFV3KWV3o9auUA/DMd0UV/ICWjq4I7Sk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZMW9VYXpp9pcUMzxaj5fql2tM677LJszxmEZA1Oai9yIXYWvJl5/mW8pRAz5UCqr8AvjYtmDeOHzzQS4O4nD/FBSCnpBqMwge1VKgBzUJkaR+6J6qxglCxL/DvgPssZMA21tWT8obMpjY8K1vTo+MbdDCPIGML8VgbCu17FhVjU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lJOJ/svT; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lJOJ/svT" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6c5acb785f2so22941426d6.0 for ; Mon, 30 Sep 2024 05:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697868; x=1728302668; darn=lists.linux.dev; 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=twxbXJ5TDeltaVeKhttrEsGiOfaRdH40FC0hJR39r6Y=; b=lJOJ/svT5osvrJDMp5pFcw+ts4h514JOqDjNomSdz4Uy9UMy8/OC/gxuUBaocDrME1 AD1DdGa9ptqgh+FfUfvE+mw3lVri4V4fnm5Qbd9+FfEe7FwtBmR1LdVLgS6utALoD1NY stPcP2BVIAGI5rQMiunG4JQZ8/TGIGMYfa/io= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697868; x=1728302668; 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=twxbXJ5TDeltaVeKhttrEsGiOfaRdH40FC0hJR39r6Y=; b=GP38VybSPUdlwkr0KvJtcev5m5xY3AdDVAH6Qa3bmuZOfoEx//14fs7TmCDQ0Wjx8q IQAkoWtXBn7kgaft9cey36N80ZF7+xEA6NF5uEkNM2iyg+bVuNpI58nOu39UkL6khCb3 Pn0KukU1bUlTD8SYFSMXO/uf6dBGxNgQXOso6q2F/fkmr/h8V5TjUXBVw9FwYrzy61fJ yw56YEa/trbTuXkq61EOLEVeMayl5EQcVT0pJ48+thrUvS49bRIsMDK1Q7szZaHtR53w FC9LEU65bS9fa5Ei6mc/oRIDxM7OmdCK8Sm8RCdME4lDspqJ1MVN1dxV2ik9KXvOtVp2 KWmw== X-Forwarded-Encrypted: i=1; AJvYcCW6lFNHq64SXFWeAbCGlLabAONZW85x2rULzc5yd/161sXotaMjCT+92wg/oMG/ZbOJRkI=@lists.linux.dev X-Gm-Message-State: AOJu0YxmoOvr2zgC/wR/bqG8PKk1WQ0o99dygzMZV6McPjad8IZK2Wn4 Nw6RhEDxfvqaNLZtxjidV5aT+NtKzqbfFMXi7+1engf8ABThP2/BjhZbvY2pXw== X-Google-Smtp-Source: AGHT+IHtaxsqjQiVBMHhpTB74imzDxkcStWQYXWBLNrF2q84xYJXsQbMLDqKSk4hEvyHVvp0GEvPAw== X-Received: by 2002:a05:6214:5701:b0:6cb:2cfa:3b9d with SMTP id 6a1803df08f44-6cb3b5cafb1mr203537826d6.14.1727697867933; Mon, 30 Sep 2024 05:04:27 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:26 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:07 +0000 Subject: [PATCH 12/45] media: dvb-frontends: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-12-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 The following cocci warnings are fixed: drivers/media/dvb-frontends/cx24120.c:456:3-9: opportunity for str_enable_disable(enable) drivers/media/dvb-frontends/cx24120.c:462:2-8: opportunity for str_enabled_disabled(enable) drivers/media/dvb-frontends/helene.c:282:4-14: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/cxd2841er.c:209:3-13: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/drxk_hard.c:6282:22-28: opportunity for str_enable_disable(enable) drivers/media/dvb-frontends/drxk_hard.c:1071:2-13: opportunity for str_enable_disable(mpeg_enable) drivers/media/dvb-frontends/sp2.c:135:3-9: opportunity for str_read_write(( read )) drivers/media/dvb-frontends/horus3a.c:41:3-13: opportunity for str_read_write(write == 0) drivers/media/dvb-frontends/ascot2e.c:107:3-13: opportunity for str_read_write(write == 0) drivers/media/usb/dvb-usb/af9005-fe.c:1282:27-31: opportunity for str_high_low(temp) drivers/media/usb/dvb-usb/af9005-fe.c:790:30-32: opportunity for str_on_off(on) Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/ascot2e.c | 2 +- drivers/media/dvb-frontends/cx24120.c | 4 ++-- drivers/media/dvb-frontends/cxd2841er.c | 2 +- drivers/media/dvb-frontends/drxk_hard.c | 4 ++-- drivers/media/dvb-frontends/helene.c | 2 +- drivers/media/dvb-frontends/horus3a.c | 2 +- drivers/media/dvb-frontends/sp2.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/dvb-frontends/ascot2e.c b/drivers/media/dvb-frontends/ascot2e.c index cf8e5f1bd101..ec7a718428fc 100644 --- a/drivers/media/dvb-frontends/ascot2e.c +++ b/drivers/media/dvb-frontends/ascot2e.c @@ -104,7 +104,7 @@ static void ascot2e_i2c_debug(struct ascot2e_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "ascot2e: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("ascot2e: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c index 44515fdbe91d..a02aaebb091a 100644 --- a/drivers/media/dvb-frontends/cx24120.c +++ b/drivers/media/dvb-frontends/cx24120.c @@ -453,13 +453,13 @@ static int cx24120_msg_mpeg_output_global_config(struct cx24120_state *state, ret = cx24120_message_send(state, &cmd); if (ret != 0) { dev_dbg(&state->i2c->dev, "failed to %s MPEG output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); return ret; } state->mpeg_enabled = enable; dev_dbg(&state->i2c->dev, "MPEG output %s\n", - enable ? "enabled" : "disabled"); + str_enabled_disabled(enable)); return 0; } diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index d925ca24183b..d1b84cd9c510 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -206,7 +206,7 @@ static void cxd2841er_i2c_debug(struct cxd2841er_priv *priv, { dev_dbg(&priv->i2c->dev, "cxd2841er: I2C %s addr %02x reg 0x%02x size %d data %*ph\n", - (write == 0 ? "read" : "write"), addr, reg, len, len, data); + str_write_read(write), addr, reg, len, len, data); } static int cxd2841er_write_regs(struct cxd2841er_priv *priv, diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 87f3d4f0eb8c..cbb1ba0f1323 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -1068,7 +1068,7 @@ static int mpegts_configure_pins(struct drxk_state *state, bool mpeg_enable) u16 err_cfg = 0; dprintk(1, ": mpeg %s, %s mode\n", - mpeg_enable ? "enable" : "disable", + str_enable_disable(mpeg_enable), state->m_enable_parallel ? "parallel" : "serial"); /* stop lock indicator process */ @@ -6279,7 +6279,7 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) { struct drxk_state *state = fe->demodulator_priv; - dprintk(1, ": %s\n", enable ? "enable" : "disable"); + dprintk(1, ": %s\n", str_enable_disable(enable)); if (state->m_drxk_state == DRXK_NO_DEV) return -ENODEV; diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c index f127adee3ebb..b4527c141d9c 100644 --- a/drivers/media/dvb-frontends/helene.c +++ b/drivers/media/dvb-frontends/helene.c @@ -279,7 +279,7 @@ static void helene_i2c_debug(struct helene_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "helene: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("helene: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c index 0330b78a5b3f..10300ebf3ca0 100644 --- a/drivers/media/dvb-frontends/horus3a.c +++ b/drivers/media/dvb-frontends/horus3a.c @@ -38,7 +38,7 @@ static void horus3a_i2c_debug(struct horus3a_priv *priv, u8 reg, u8 write, const u8 *data, u32 len) { dev_dbg(&priv->i2c->dev, "horus3a: I2C %s reg 0x%02x size %d\n", - (write == 0 ? "read" : "write"), reg, len); + str_write_read(write), reg, len); print_hex_dump_bytes("horus3a: I2C data: ", DUMP_PREFIX_OFFSET, data, len); } diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 75adf2a4589f..0332e3c312c6 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -132,7 +132,7 @@ static int sp2_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, u8 acs, return ret; dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", - (read) ? "read" : "write", slot, addr, + str_read_write(read), slot, addr, (acs == SP2_CI_ATTR_ACS) ? "attr" : "io", (read) ? mem : data); From patchwork Mon Sep 30 12:04:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815961 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 2F71A193403 for ; Mon, 30 Sep 2024 12:04:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697873; cv=none; b=sY6eRhWGYnS6QS7TT+eoFQ3wo5GrOi9tiGaofMl14mybG6BBp09aEu7p/whMUY72r0VLjfCd4/ZEu8mSRExfogmiSOMv+U3UH4sRqAOJlme9VkmWEIBwWj7K834JCVlzAh4+vWnM8U+DJMVRJ09meQpzUDHsKKnuGBM9Dztatb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697873; c=relaxed/simple; bh=DXbs9QPlePnBVeLrKJEDP1GA5dj6+5qFRZdN94gi/X4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dKB0nobMaahg7SG43oSxtukrxFz72hIgTEavaEi58zHxx2k+MA5mEnwqIk+gRiPY62tv9YLxc90ectlXM1P7w9JHnAzz2lHQBbMA49T0hSp8HCnwMEgr9zhjfVAT6a5AD234yh/qKPYhzsCuPsdh6TqiDafu63HdYeXXX8oL9Wg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=CKxFuafk; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CKxFuafk" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6cb2824ddc2so34590576d6.1 for ; Mon, 30 Sep 2024 05:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697871; x=1728302671; darn=lists.linux.dev; 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=D6BDeL6BkIVVZoPxqWDi9XtO0jTRkjdLrjdq1Zl6PH8=; b=CKxFuafkmNsxfjxzrs2iSfemnr6kCGiWLyegFQlL1TpoyHN39csNcl+WhqVhb00J+G kvS3GXyIq3R0w/ljSbKWcLnnAThEvQDzidyZXi4eFGnogK3r9rFwaHo2qeTYJ3EPZPOj K4RSc67Bm1uAsgj0DKAkXQGJLLy2JZ7AL4Ip0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697871; x=1728302671; 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=D6BDeL6BkIVVZoPxqWDi9XtO0jTRkjdLrjdq1Zl6PH8=; b=Ldx0W6nhmMhpgZVimN6FQUuqMD75Tsm9Re0V6xw2JjjmCuGZ4fxbQdxddEE2ReaYt3 tbjcR9G/wPHkwMJkp00u/pKON9FW982NX5GmoVCJiyINNMWiP9nSkm++GEUP9VStnD4L aWakPJlkNyahMk9/WrVFiUS9mBGAjIjBljoSAQ6gxwA+u26ut6Qz047HMX4F7uredGNj Aavnas27uQSSMHPVVQhYAhQuQhPpbZPDBMhXlOTR3O5/x/ygd+CkGZs9XPkYoQy16xtg TurWiIzCxPaRDt+G071Uq5d2j2VcSLW39Hfb//Pl97rzaJJAONgK6qx64J7BYK/JPgEk kQ0Q== X-Forwarded-Encrypted: i=1; AJvYcCUfi44DWzvTGc6ITvQxtChlDOOhJzyrD3M2TjhbWEEhYW3AF9/xOcfuDNMmVcJyKe53BdM=@lists.linux.dev X-Gm-Message-State: AOJu0YxYYDYFWwLGsSYVaeZc71DnmFkKcUD8o7gRU+O2dNTxXpQJlQfs 4iLppQ/+bYEcuL/6VWa/wTMXdekUQaIMmeWvIgaTFDqeKxWNw72vyFIuGWb8Kg== X-Google-Smtp-Source: AGHT+IFuhFd9qljS0j0XzT5b/G60bcWwlJPplwUn5ky0BXy/Gr7Rfi8yUN7cisKQypEqCOJiTUFoZA== X-Received: by 2002:a05:6214:448c:b0:6c4:6217:da9c with SMTP id 6a1803df08f44-6cb3b5da202mr213208266d6.17.1727697870958; Mon, 30 Sep 2024 05:04:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:29 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:08 +0000 Subject: [PATCH 13/45] media: pci: cx23885: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-13-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 The following cocci warnings are fixed: drivers/media/pci/cx23885/altera-ci.c:285:3-9: opportunity for str_read_write(( read )) drivers/media/pci/cx23885/cimax2.c:227:3-9: opportunity for str_read_write(( read )) drivers/media/pci/cx23885/cx23888-ir.c:996:4-9: opportunity for str_enabled_disabled(filtr) drivers/media/pci/cx23885/cx23888-ir.c:935:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_DMD) drivers/media/pci/cx23885/cx23888-ir.c:1020:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_MOD) drivers/media/pci/cx23885/cx23888-ir.c:937:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_RFE) drivers/media/pci/cx23885/cx23888-ir.c:1022:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_TFE) drivers/media/pci/cx23885/cx23888-ir.c:1008:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_ROE) drivers/media/pci/cx23885/cx23888-ir.c:1014:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RSE) drivers/media/pci/cx23885/cx23888-ir.c:1004:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RTE) drivers/media/pci/cx23885/cx23888-ir.c:1044:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_TSE) drivers/media/pci/cx23885/cx23888-ir.c:1026:4-21: opportunity for str_yes_no(cntrl & CNTRL_IVO) drivers/media/pci/cx23885/cx23888-ir.c:933:4-21: opportunity for str_yes_no(cntrl & CNTRL_RXE) drivers/media/pci/cx23885/cx23888-ir.c:1018:4-21: opportunity for str_yes_no(cntrl & CNTRL_TXE) drivers/media/pci/cx23885/cx23888-ir.c:1010:4-21: opportunity for str_yes_no(stats & STATS_RBY) drivers/media/pci/cx23885/cx23888-ir.c:1006:4-21: opportunity for str_yes_no(stats & STATS_ROR) drivers/media/pci/cx23885/cx23888-ir.c:1012:4-21: opportunity for str_yes_no(stats & STATS_RSR) drivers/media/pci/cx23885/cx23888-ir.c:1002:4-21: opportunity for str_yes_no(stats & STATS_RTO) drivers/media/pci/cx23885/cx23888-ir.c:1040:4-21: opportunity for str_yes_no(stats & STATS_TBY) drivers/media/pci/cx23885/cx23888-ir.c:1042:4-21: opportunity for str_yes_no(stats & STATS_TSR) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cx23885/altera-ci.c | 2 +- drivers/media/pci/cx23885/cimax2.c | 2 +- drivers/media/pci/cx23885/cx23888-ir.c | 36 +++++++++++++++++----------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 0dc348215b72..e154a39d86ef 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -282,7 +282,7 @@ static int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, mutex_unlock(&inter->fpga_mutex); ci_dbg_print("%s: %s: addr=[0x%02x], %s=%x\n", __func__, - (read) ? "read" : "write", addr, + str_read_write(read), addr, (flag == NETUP_CI_FLG_CTL) ? "ctl" : "mem", (read) ? mem : val); diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c index 06e41f92092d..458fa779274a 100644 --- a/drivers/media/pci/cx23885/cimax2.c +++ b/drivers/media/pci/cx23885/cimax2.c @@ -224,7 +224,7 @@ static int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, return -EREMOTEIO; ci_dbg_print("%s: %s: chipaddr=[0x%x] addr=[0x%02x], %s=%x\n", __func__, - (read) ? "read" : "write", state->ci_i2c_addr, addr, + str_read_write(read), state->ci_i2c_addr, addr, (flag == NETUP_CI_CTL) ? "ctl" : "mem", (read) ? mem : data); diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index 222d04421468..85ca564fd3ab 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -930,11 +930,11 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "IR Receiver:\n"); v4l2_info(sd, "\tEnabled: %s\n", - cntrl & CNTRL_RXE ? "yes" : "no"); + str_yes_no(cntrl & CNTRL_RXE)); v4l2_info(sd, "\tDemodulation from a carrier: %s\n", - cntrl & CNTRL_DMD ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_DMD)); v4l2_info(sd, "\tFIFO: %s\n", - cntrl & CNTRL_RFE ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_RFE)); switch (cntrl & CNTRL_EDG) { case CNTRL_EDG_NONE: s = "disabled"; @@ -993,37 +993,37 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd) pulse_width_count_to_us(FIFO_RXTX, rxclk), pulse_width_count_to_ns(FIFO_RXTX, rxclk)); v4l2_info(sd, "\tLow pass filter: %s\n", - filtr ? "enabled" : "disabled"); + str_enabled_disabled(filtr)); if (filtr) v4l2_info(sd, "\tMin acceptable pulse width (LPF): %u us, %u ns\n", lpf_count_to_us(filtr), lpf_count_to_ns(filtr)); v4l2_info(sd, "\tPulse width timer timed-out: %s\n", - stats & STATS_RTO ? "yes" : "no"); + str_yes_no(stats & STATS_RTO)); v4l2_info(sd, "\tPulse width timer time-out intr: %s\n", - irqen & IRQEN_RTE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_RTE)); v4l2_info(sd, "\tFIFO overrun: %s\n", - stats & STATS_ROR ? "yes" : "no"); + str_yes_no(stats & STATS_ROR)); v4l2_info(sd, "\tFIFO overrun interrupt: %s\n", - irqen & IRQEN_ROE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_ROE)); v4l2_info(sd, "\tBusy: %s\n", - stats & STATS_RBY ? "yes" : "no"); + str_yes_no(stats & STATS_RBY)); v4l2_info(sd, "\tFIFO service requested: %s\n", - stats & STATS_RSR ? "yes" : "no"); + str_yes_no(stats & STATS_RSR)); v4l2_info(sd, "\tFIFO service request interrupt: %s\n", - irqen & IRQEN_RSE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_RSE)); v4l2_info(sd, "IR Transmitter:\n"); v4l2_info(sd, "\tEnabled: %s\n", - cntrl & CNTRL_TXE ? "yes" : "no"); + str_yes_no(cntrl & CNTRL_TXE)); v4l2_info(sd, "\tModulation onto a carrier: %s\n", - cntrl & CNTRL_MOD ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_MOD)); v4l2_info(sd, "\tFIFO: %s\n", - cntrl & CNTRL_TFE ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_TFE)); v4l2_info(sd, "\tFIFO interrupt watermark: %s\n", cntrl & CNTRL_TIC ? "not empty" : "half full or less"); v4l2_info(sd, "\tOutput pin level inversion %s\n", - cntrl & CNTRL_IVO ? "yes" : "no"); + str_yes_no(cntrl & CNTRL_IVO)); v4l2_info(sd, "\tCarrier polarity: %s\n", cntrl & CNTRL_CPL ? "space:burst mark:noburst" : "space:noburst mark:burst"); @@ -1037,11 +1037,11 @@ static int cx23888_ir_log_status(struct v4l2_subdev *sd) pulse_width_count_to_us(FIFO_RXTX, txclk), pulse_width_count_to_ns(FIFO_RXTX, txclk)); v4l2_info(sd, "\tBusy: %s\n", - stats & STATS_TBY ? "yes" : "no"); + str_yes_no(stats & STATS_TBY)); v4l2_info(sd, "\tFIFO service requested: %s\n", - stats & STATS_TSR ? "yes" : "no"); + str_yes_no(stats & STATS_TSR)); v4l2_info(sd, "\tFIFO service request interrupt: %s\n", - irqen & IRQEN_TSE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_TSE)); return 0; } From patchwork Mon Sep 30 12:04:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815962 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 204B4193403 for ; Mon, 30 Sep 2024 12:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697876; cv=none; b=ASP5BmuVJRibnS3YnYVQZddcQW7rU3ge7V+KbKitPVXyWOOmBRK6MC09lM98ga/A20+B9IswnHHnrWDo8A1PV8/1lVJlHwxUGDSAHJwbRrJLQiFWL+N0wrprrwwStKreuGHy8HnNPn7IHyf3MTxEmPrdomKJ89TPIVX3xWTbWUo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697876; c=relaxed/simple; bh=SCFl1C9z2VTb+qQWM91xmVqiVRgT9zj6Mxth/Q7JwNY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gA9L3t1DgVMcKrxnOT2HreEUijrGzwCiqn8hFLM+yaFJnnnz6igJLWbg5nKBqdRjOLvOooUoOz12C80IMAVSuMuBJrSpawe4wJ7g8tumwQbzwPQ08YQahnTarzXDAEpZPSv63T0sjorWM3O/rgL9WLUr9GkvQ9YCFJKEx/tXC+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ACa8NFAZ; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ACa8NFAZ" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6cb399056b4so32325576d6.0 for ; Mon, 30 Sep 2024 05:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697873; x=1728302673; darn=lists.linux.dev; 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=ROQ1HhB5eUHGQkR1Zb9xX876/ICgPqUa0J3DMNQ2iR0=; b=ACa8NFAZNKqaQ7hdjGXVIbjCFVcLiJMbFYmNgSia/OhjLrGknLsZunL4PWKkI9g7ge rDu+p6FqI2HqVtT2MhaC054hs6U71vyBHRqG+iVYRIQ2adC3/mmORlxRTZbHX4rBRpI+ 6FxjqcbHTEpSo8gFYJCT3XjvUXevEEmvbnUMc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697873; x=1728302673; 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=ROQ1HhB5eUHGQkR1Zb9xX876/ICgPqUa0J3DMNQ2iR0=; b=lGCQoJXcAznXPbDLymhxhL7a3xsSWL3peJv2O8wYEJ6Oojumuqxkf0p8XUBWl+EjFX AeIDvRWbjv3w+iCQZ1RzaPGC9JZwzNOxhohrOvdRRUDfISTOdX6qImgBN/ws+9Ik78l5 GonDG+rsU1OMGV3NxHwzHJcQ0GhSgx7tLjXeNk8WjqnsleaCmj3aQ6CuQkMQ+y8VYY+R CmqCGQ1D8OgeyJcZMgvtTtTZKzx5cmtT3TeiTDOGwbA0o4xxna4FIVWbLC3w6SKFXfFW BjkcJw3NhGeaYYF2QAe2cV4fGgvUOZZY9MVN04KFCYq5vhWzwFk0okmDo+d/YsYPrU8w BggA== X-Forwarded-Encrypted: i=1; AJvYcCUTATehtEM2ncit4c4vBx5qpHOWtLqlvtkdRbBjRZw9eQerl+y4eXgzHWum47HVYCFj+5A=@lists.linux.dev X-Gm-Message-State: AOJu0YyaLw8srd3VtgrZdJZBQmfRO8S+TUmRbQI/rQx0wXTb/TNmYHLa g2l9qYrtZ2t9RSkcynYK3uHFdZan6haiX9fFHW2TIoq5FODcCjeI78CiR3cqTQ== X-Google-Smtp-Source: AGHT+IGlpLvOiABRGPfPC5tWhysrrPiJ2yte8Y1JxuD34Gtndo3CQ3SWzVD7Qrk2mRRfbUS2vxDpnw== X-Received: by 2002:a05:6214:458d:b0:6c7:c63f:b414 with SMTP id 6a1803df08f44-6cb3b6407b6mr208576446d6.33.1727697872928; Mon, 30 Sep 2024 05:04:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:32 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:09 +0000 Subject: [PATCH 14/45] media: saa7134: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-14-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 The following cocci warnings are fixed: drivers/media/pci/saa7134/saa7134-cards.c:7984:7-16: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-dvb.c:93:31-33: opportunity for str_on_off(ok) drivers/media/pci/saa7134/saa7134-input.c:919:3-12: opportunity for str_yes_no(( rc == 1 )) drivers/media/pci/saa7134/saa7134-input.c:898:3-12: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-input.c:934:3-12: opportunity for str_yes_no(( 1 == rc )) drivers/media/pci/saa7134/saa7134-video.c:622:10-15: opportunity for str_enabled_disabled(flags) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/saa7134/saa7134-cards.c | 2 +- drivers/media/pci/saa7134/saa7134-dvb.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 6 +++--- drivers/media/pci/saa7134/saa7134-video.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c index e80fb4ebfda6..79cd61fb0205 100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c @@ -7981,7 +7981,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg, 1); pr_info("%s: probe IR chip @ i2c 0x%02x: %s\n", dev->name, msg.addr, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); if (rc == 1) dev->has_remote = SAA7134_REMOTE_I2C; } diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 6de8a02314af..d0e58a0156f7 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -90,7 +90,7 @@ static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on) saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); udelay(10); ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27); - pr_debug("%s %s\n", __func__, ok ? "on" : "off"); + pr_debug("%s %s\n", __func__, str_on_off(ok)); if (!ok) saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index 8610eb473b39..239f0b9d080a 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -895,7 +895,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_SNAZIO_TVPVR_PRO: dev->init_data.name = "SnaZio* TVPVR PRO"; @@ -916,7 +916,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (rc == 1) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_KWORLD_PC150U: /* copied and modified from MSI TV@nywhere Plus */ @@ -931,7 +931,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); input_dbg("probe 0x%02x @ %s: %s\n", msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); + str_yes_no(rc == 1)); break; case SAA7134_BOARD_HAUPPAUGE_HVR1110: dev->init_data.name = saa7134_boards[dev->board].name; diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 56b4481a40e6..1c02fb04abdf 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -619,7 +619,7 @@ static int saa7134_enable_analog_tuner(struct saa7134_dev *dev) if (ret) { pr_err("Couldn't change link %s->%s to %s. Error %d\n", source->name, sink->name, - flags ? "enabled" : "disabled", + str_enabled_disabled(flags), ret); return ret; } From patchwork Mon Sep 30 12:04:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815963 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (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 23263194ACB for ; Mon, 30 Sep 2024 12:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697879; cv=none; b=QAxluizqwxEuD6gLkn2pjEEhUupwSmBDm00jkm7yGzFpxOsgdSJ2gDKbjX2/SsFi05sNnHvCEVx3Zdy/4UMEaOpYr1yiFm1A5YLpl4Piwo2VS1FtjWwExyBydgpuv0h2Wv8lL+B71QjCBjcm5f1bb2Kr3R8ZN6QlNObF7hCPOuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697879; c=relaxed/simple; bh=27dEbLYS3PRjKxWaJp2KRsfAuUa8ZpRAboFGn7TSbcA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P/IbF649DozcBAer9wGYfOY9K4/dE0TBFtjoMCmIVMAk8lwmKbrHJTFyyBeltSCBFWQ72reU8j6okLVpxxV9dZBOHpbbmJYr3oJi/QzBr0+TKOX562Ph6sBQJSuoNs4aywVBM9HvQfZpIQVd3u25381XSUcZgaWF5ddS0swpleM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YfSIUuY9; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YfSIUuY9" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-5e1baf0f764so1288347eaf.1 for ; Mon, 30 Sep 2024 05:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697875; x=1728302675; darn=lists.linux.dev; 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=xpVUYLeo0hSTOfKt30J/ldl6oRGhulqCfi0QX1kLeY0=; b=YfSIUuY9oKFuurooKY3kA0iBAWfctTNU7TDJW98s8N3QvGGfwm/xlWYYoZpF0lgM3y 5fbnEWDODeOKGFjY8rh98vN5oPGxmXzh8qJXgnyLEQxAgsK2AVjoeyH/VHHXKPuI9/gx XcHm6V0N/wxblFGcqGylmmAKs7ppOHMubmHDE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697875; x=1728302675; 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=xpVUYLeo0hSTOfKt30J/ldl6oRGhulqCfi0QX1kLeY0=; b=kCgUhmy+ccof0+VzrhdT85EIk2taZzQTjSnI6KF8Zcjg9U+D3EGX0dTDyZ7/SUQee7 v36NE1Kdio8k3buI1E9x+E0kTYvXOJ5oX3Va07u3jqQuFhOX3lbBdaxT6sBkGgj/MoIl k0sQRQzMZZ9+Zdo2lfi4eTfwVBDU0lJLCSz3A3eiIzZWkTH/Xp0JKL1WgejLAEq1PYlx NlBffgXA0iemG7Qs7IwqMJqcMEzIxbmtxW3ZVSI5rlptUPJXu+4VAVdFfo+z2uxj1MBI zARYmpiB5Ta15o7DHu+zlhCw2nPbTOqBeMvMgz6yxYyzEvBnJ6DHr5HETj5sa3wQ79t5 M5wg== X-Forwarded-Encrypted: i=1; AJvYcCXOjfec62Eu4lJP9NcSli/FCljBC2roZTNqQkzfG+Trp0DdGdVdTH5zA5sPM0ZsShmXcPc=@lists.linux.dev X-Gm-Message-State: AOJu0YzN22B9sDUdqttAfOQTakR8gwdjdcbFdOsijtzNLjG7v1czMVuK Hfi6DVi4skCcvQpnnwVjeFydKE6bdwGxCW548WYLxWbXCWZLP0yKDaJjXC25jw== X-Google-Smtp-Source: AGHT+IGd3K8vbb6GyQdRKaZnKoS5TA6gIcUfCdqxCm9K5gJfl06dGrwyNT5yGfSWCEUO0kuvQMkCfQ== X-Received: by 2002:a05:6358:e4a9:b0:1b5:968f:e221 with SMTP id e5c5f4694b2df-1becbb39bb4mr326693155d.2.1727697875191; Mon, 30 Sep 2024 05:04:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:33 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:10 +0000 Subject: [PATCH 15/45] media: amphion: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-15-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 The following cocci warnings are fixed: drivers/media/platform/amphion/venc.c:1206:4-26: opportunity for str_enable_disable(venc -> params . rc_enable) drivers/media/platform/amphion/vpu_dbg.c:259:3-34: opportunity for str_on_off(vpu_iface_get_power_state ( core )) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/amphion/venc.c | 2 +- drivers/media/platform/amphion/vpu_dbg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index 351b4edc8742..789c8fca3d31 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -1203,7 +1203,7 @@ static int venc_get_debug_info(struct vpu_inst *inst, char *str, u32 size, u32 i break; case 8: num = scnprintf(str, size, "rc: %s, mode = %d, bitrate = %d(%d), qp = %d\n", - venc->params.rc_enable ? "enable" : "disable", + str_enable_disable(venc->params.rc_enable), venc->params.rc_mode, venc->params.bitrate, venc->params.bitrate_max, diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c index 940e5bda5fa3..2dbcef4e83ef 100644 --- a/drivers/media/platform/amphion/vpu_dbg.c +++ b/drivers/media/platform/amphion/vpu_dbg.c @@ -256,7 +256,7 @@ static int vpu_dbg_core(struct seq_file *s, void *data) return 0; num = scnprintf(str, sizeof(str), "power %s\n", - vpu_iface_get_power_state(core) ? "on" : "off"); + str_on_off(vpu_iface_get_power_state(core))); if (seq_write(s, str, num)) return 0; num = scnprintf(str, sizeof(str), "state = %d\n", core->state); From patchwork Mon Sep 30 12:04:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815964 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.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 4CF68198831 for ; Mon, 30 Sep 2024 12:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697880; cv=none; b=nCQylDk2m8QN+txjBRJdSUrwLs2ukVNtmPBASZsBTX3FizoB1O1ygugcQ/Q6/kQ7fjORhHTHKheRTuXMHKJxg5/RsMoPo+OvMvkl2rZ6yT6aSxKOMysYFV9DymUsVsFtiRoj6vKSv89bSSYOWKyO1vYATuoeXz9YLgC0/NOTS1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697880; c=relaxed/simple; bh=dK6Sydo8sH5iuoPGo1uJmSzzE0aPjCjllccB1/DFlKU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gqGhvIQA9mUy1hAf3pnHbL/DCLCTAsbPNYUps/gFQmZPp4Xrub2MyZ8dJH9KLorayGiF+67MdTtD8NsFzZ79AMyBT5pm7m5oB1v0JB4pqlh7AjwjKP2uijZ/K8axO0B+MUn8R+TtewUF446AMqp5V0qxy+mMcL0K7IhywtWB5VA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=e35PK9z3; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="e35PK9z3" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6cb37b34a87so30616866d6.0 for ; Mon, 30 Sep 2024 05:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697878; x=1728302678; darn=lists.linux.dev; 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=W54Rxedr36zEnsk929u7YgHxA5FxY+YC4oIk0CEmtoU=; b=e35PK9z3FTjMC6tEQKXV96FQwIHDHmCRMwLJ4slKkiPjnc+ak8eh7wmnKx8MAR6zTW zZ6IC6DErGH+Rx/h8Jq7GVb1f3pc5VvavHmUhw866LluYkcvg+nk8F3UAPILpxloVqAB I4DC77itxkZPFJl40d+axLoebxcfSeoGZuqeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697878; x=1728302678; 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=W54Rxedr36zEnsk929u7YgHxA5FxY+YC4oIk0CEmtoU=; b=GBzjFYHj6yfKAnTm+XJjWCIZQbvDc3plijYEFOZ1eVY5YgJbl+iPELIilNG5EemfsV NeKfiwXS5DFn3Tho/C9uGnKTaXbV7mnq9PyJNXlxCPHCpPO7eGxLilFgOad47mT6+3YW LPoaX/v+JYrAOotZ4jirWymk6jEwrjHH9giamUqtotg2SZgYUkTDX02iQP7dOx+r3Xp1 L9a6KguRzp6xFH0g4fzsZyYa35XhVgfpmlRdw2yKG8pI086itjNFLPsNtlRdkLYICAC8 QSf6e0vtI9E2hmo5QY1FgNWErPnwHJvDZto7/pfN0bJTWa3IfHtoUyHqsWKx6e+BIuMf b/zQ== X-Forwarded-Encrypted: i=1; AJvYcCXYO7YeVaSbKZKAcGmJRswpaxeH5cmOtI1cc+WS69WNBqsZcm9KzzT4OQKjTVRBi1IhMvQ=@lists.linux.dev X-Gm-Message-State: AOJu0YyjCiJ2tr8s6WLxwEZT66/NI8ASspCTFeAvuSyf1O0ALqNRUTHU 06xjwngLmxUYNCARYdlsIHv9eTWJnCs0tAtBMzdYqHZ8b9A0Y0sIDp04fzkz4A== X-Google-Smtp-Source: AGHT+IGgo8OgcYFtsubdwQ48E/Z3+k42qUYOU3xS8KlzOd05WOz0ImPebYZJQvx35b0omDgntAq/gQ== X-Received: by 2002:ad4:580c:0:b0:6cb:3b6d:2775 with SMTP id 6a1803df08f44-6cb3b6d2d88mr154770176d6.17.1727697878145; Mon, 30 Sep 2024 05:04:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:36 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:11 +0000 Subject: [PATCH 16/45] media: pci: ivtv: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-16-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 The following cocci warnings are fixed: drivers/media/pci/ivtv/ivtvfb.c:809:3-57: opportunity for str_on_off(( var -> vmode & FB_VMODE_MASK ) == FB_VMODE_NONINTERLACED) drivers/media/pci/ivtv/ivtvfb.c:609:3-57: opportunity for str_on_off(( var -> vmode & FB_VMODE_MASK ) == FB_VMODE_NONINTERLACED) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/ivtv/ivtvfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 90c584cf97c2..bd07afc68191 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -606,7 +606,7 @@ static int ivtvfb_set_var(struct ivtv *itv, struct fb_var_screeninfo *var) var->left_margin, var->upper_margin); IVTVFB_DEBUG_INFO("Display filter: %s\n", - (var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED ? "on" : "off"); + str_on_off((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED)); IVTVFB_DEBUG_INFO("Color space: %s\n", var->nonstd ? "YUV" : "RGB"); return 0; @@ -806,7 +806,7 @@ static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv) var->left_margin, var->upper_margin); IVTVFB_DEBUG_INFO("Display filter: %s\n", - (var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED ? "on" : "off"); + str_on_off((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED)); IVTVFB_DEBUG_INFO("Color space: %s\n", var->nonstd ? "YUV" : "RGB"); return 0; } 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: 13815965 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 4EA20198A22 for ; Mon, 30 Sep 2024 12:04:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697882; cv=none; b=V4SkkJcIicRpJhiqB5HVgbSoE4es7mS6k4VabRseCG9iuqu8M2MfyvJbeUjYBeyLqHn9rU3CDG9aaejeTu8TSqI9KKe41ne0mDYqF09w/JYNYQVf/2q8RzL053zB8QU8LZlabhDMGZG4FPSvo6xEA2ho6HHOIcLbIPbkkq/W7+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697882; c=relaxed/simple; bh=RQIg3IKX+fZXCdaaOjZybJtj1jQ4oUee/Ev0G5kqLRc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tvxJWgGeXs4/vJ+b7LLudV3sZuzPA3wllqALBeUOhKvDSMSShc03TMX7uCYDJhB7/go6Jv1pZ5RXDMRvh5sh8PEqlKmdG55PQInuR1yEvlRgxCyU7OiVsxmJ+MmCiAsWwm+GQJTP0r3MwUVkv8XibAUPEx9icAN9xAagD25g6ZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jVyPI/Ve; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jVyPI/Ve" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6c5ab2de184so30235856d6.0 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.linux.dev; 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=jVyPI/VeP0V/jGZmNCLRZkt2s66oAtB+1FVoTA+I7/RUyZ5YOaqZ4z7+bt52p10Jy2 0TNYs4pMRs8jv/TN8lqbEiBtxusut6cZVEug23hLtvKzdjF0jjZVCMrDayhElgdWe8CS 0YHKGCqvMfVAuGEnbfYXo5SxBv2eLwSnBxj6c= 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=s36RV9XW3hepZ1p+D/94Uiov6LgPv+GzKTPpB1g/XtOjU8rymTQnH6rZMvSaWNNNQg GAuhj6IHRFUeEaNn5ma00X+Pzr5lYzGMSDIKzWBnO8VQQNBSdQkPgNDPazqlTc/63Ob7 Dh/CciBSZcnTDczai6I6JG5wLLpndE3hVu/qS0cMA8G8l7G/7ZGMr23WB6qyyQ/7Lay+ S+Uh6QFAYK7pShKdWepFt7Vrfm1F+RZuITTw1NWkUMeUqUvcmF7TikHGvxZSmb47A1j1 0ZIjY/yYiVpkd1oUDhUx2py8BRfruF/2e4vQz0loIZWqNULu+OavO6LT96xZg+Jx2u9B PdGQ== X-Forwarded-Encrypted: i=1; AJvYcCXcXCnJDJXWJisH5hn9VgUdyuSPoAgWzLv4DhgiuBKuJ2gwqoNf/d5FUNodFI2TS4DrFRc=@lists.linux.dev X-Gm-Message-State: AOJu0Yx2RdjEHMM+9t9L1JW/zaecDl8pwHvSDF1Mv+uHjWIzRKww0ltE yWMSs0uZm10BmWLpxP/WouTzl7IxsjV9NRhHQ8cT5s0zt0HlUdDUd8nFe9RiQw== 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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 From patchwork Mon Sep 30 12:04:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815966 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.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 107CD198E76 for ; Mon, 30 Sep 2024 12:04:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697884; cv=none; b=faa4b1dTkxt/Hb26gSVe54zwrWqdieGiS6jnlYvieARxwqrFUisuX7eqIjnojvU0iYVG0vws7xPxesaoN4/7v1R46kXMFJSxfYGsona0b/vbg2loHgwRVNvfMf4quRR3tCiIb1tpUtshSk0oZ9eJGmqAPesfH3Z8CsT25fuHiss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697884; c=relaxed/simple; bh=i9fHK42BYZRW42DIn7gTi+isZVRv8GhNgDIaA4tO6Tw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J1GChowBYH0sOzeDRExcIOdEI4bxtXr/7pmm6lxCqBfKjrMGQrZNWF4Y5a4jECP19Bc4Z+Ihx2JD87nxqFAaTup2vqeAtXBb5eG9Ixjz+auuE/ENSJflxMW21Aqsn85W083vFai8emSn9Kgexe4rbtE/E8nlvYJd0E1KFRA120c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=UqGmC+oq; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UqGmC+oq" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5e1baf0f764so1288408eaf.1 for ; Mon, 30 Sep 2024 05:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697882; x=1728302682; darn=lists.linux.dev; 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=+JjigCj7wmiDgTIVi8lxvvE6Xnwp6vOIIL7mEoeKjLo=; b=UqGmC+oqTsEbLhWpf87zedKUo3bU7kAGxY/Zsc6ntaGPuqFqgfTeywPtbYlZzDZwO0 FOuuTRmHU1LBbxxvS8G05iv9jPaCypXZszuMQ4VpmDrzfIW2yMJefK8a7Ky8QrhiASsq LayKdZh9bDC6PdOTGhEvFkVmYlHkjS7apyoVY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697882; x=1728302682; 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=+JjigCj7wmiDgTIVi8lxvvE6Xnwp6vOIIL7mEoeKjLo=; b=IblLGmYJPu44HbVAQ18P51F5Zy7GB5LXf7l1TW1nnpu5UqaPf/hYcuYlJ/JLR/7yt+ q7uOJn/2US2/qzCAhKAZ151lQW5DPvqBZIHSf1TuRop97WDd6woZyuR9y3QhG2qcqiSC NN1mMSgJu1J5Oem36VsHLzHwLbacs3+6Y/shQAZ31VDB2IRJ0ymsaDzjXlcZ0FaecLRF 1KtGFt1h1Y+/Cb6dmrgy//x3I/H5nkgF8yPXNanP+3TY3Q/KfS6paOOZC2bbSxOErUXy N0queQJWMjtEkX/2wk916NQeIk3g4MwFDK5edEQxsDDWLs2JgHeZclWQOHTsrQDSFz0H mTAw== X-Forwarded-Encrypted: i=1; AJvYcCXgQ2lRPBVG/C8ymMTE978TRDASraw0tT+kX2gSvav52eni46TTphtaOFkEZTsQv2gFpsY=@lists.linux.dev X-Gm-Message-State: AOJu0Yz9zyUsyOwZQCb7T4jJRhdU/3cfZda92IQxcgcg29HozQnKVc8N HOAt+Fy0QFZBt3w/y0Ash0AvgSM0GaQW/kO7/76JlUAjt+eeibUoRTivjvRr6w== X-Google-Smtp-Source: AGHT+IHorNkcL7CG7P94wqWnm5CxVPJz+Rc1wLbNEDwAbC1i2AVoPfjS6B+31QnhNxiGPZOH/d/JVQ== X-Received: by 2002:a05:6359:4c9a:b0:1ad:10ff:341e with SMTP id e5c5f4694b2df-1becbb397e3mr239386155d.4.1727697882114; Mon, 30 Sep 2024 05:04:42 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:40 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:13 +0000 Subject: [PATCH 18/45] media: xilinx: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-18-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 The following cocci warnings are fixed: drivers/media/platform/xilinx/xilinx-csi2rxss.c:415:3-27: opportunity for str_true_false(data & XCSI_CLKINFR_STOP) drivers/media/platform/xilinx/xilinx-csi2rxss.c:409:3-24: opportunity for str_true_false(data & XCSI_CSR_RIPCD) drivers/media/platform/xilinx/xilinx-csi2rxss.c:407:3-23: opportunity for str_true_false(data & XCSI_CSR_SLBF) drivers/media/platform/xilinx/xilinx-csi2rxss.c:403:3-29: opportunity for str_true_false(data & XCSI_CSR_SPFIFOFULL) drivers/media/platform/xilinx/xilinx-csi2rxss.c:405:3-27: opportunity for str_true_false(data & XCSI_CSR_SPFIFONE) drivers/media/platform/xilinx/xilinx-csi2rxss.c:424:4-30: opportunity for str_true_false(data & XCSI_DLXINFR_SOTERR) drivers/media/platform/xilinx/xilinx-csi2rxss.c:425:4-34: opportunity for str_true_false(data & XCSI_DLXINFR_SOTSYNCERR) drivers/media/platform/xilinx/xilinx-csi2rxss.c:426:4-28: opportunity for str_true_false(data & XCSI_DLXINFR_STOP) drivers/media/platform/xilinx/xilinx-csi2rxss.c:892:2-19: opportunity for str_enabled_disabled(xcsi2rxss -> en_vcx) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/xilinx/xilinx-csi2rxss.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index f953d5474ae0..7ddd9b265162 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -400,19 +400,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) dev_info(dev, "***** Core Status *****\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET); dev_info(dev, "Short Packet FIFO Full = %s\n", - data & XCSI_CSR_SPFIFOFULL ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFOFULL)); dev_info(dev, "Short Packet FIFO Not Empty = %s\n", - data & XCSI_CSR_SPFIFONE ? "true" : "false"); + str_true_false(data & XCSI_CSR_SPFIFONE)); dev_info(dev, "Stream line buffer full = %s\n", - data & XCSI_CSR_SLBF ? "true" : "false"); + str_true_false(data & XCSI_CSR_SLBF)); dev_info(dev, "Soft reset/Core disable in progress = %s\n", - data & XCSI_CSR_RIPCD ? "true" : "false"); + str_true_false(data & XCSI_CSR_RIPCD)); /* Clk & Lane Info */ dev_info(dev, "******** Clock Lane Info *********\n"); data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET); dev_info(dev, "Clock Lane in Stop State = %s\n", - data & XCSI_CLKINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_CLKINFR_STOP)); dev_info(dev, "******** Data Lane Info *********\n"); dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n"); @@ -421,9 +421,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd) data = xcsi2rxss_read(xcsi2rxss, reg); dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i, - data & XCSI_DLXINFR_SOTERR ? "true" : "false", - data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false", - data & XCSI_DLXINFR_STOP ? "true" : "false"); + str_true_false(data & XCSI_DLXINFR_SOTERR), + str_true_false(data & XCSI_DLXINFR_SOTSYNCERR), + str_true_false(data & XCSI_DLXINFR_STOP)); reg += XCSI_NEXTREG_OFFSET; } @@ -889,7 +889,7 @@ static int xcsi2rxss_parse_of(struct xcsi2rxss_state *xcsi2rxss) fwnode_handle_put(ep); dev_dbg(dev, "vcx %s, %u data lanes (%s), data type 0x%02x\n", - xcsi2rxss->en_vcx ? "enabled" : "disabled", + str_enabled_disabled(xcsi2rxss->en_vcx), xcsi2rxss->max_num_lanes, xcsi2rxss->enable_active_lanes ? "dynamic" : "static", xcsi2rxss->datatype); From patchwork Mon Sep 30 12:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815967 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 E6EFE1990BE for ; Mon, 30 Sep 2024 12:04:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697886; cv=none; b=O4qs7ZYk/aqX9anNV0slFiSGGCoB+5ftmO3yUs0l3/Qc1rFDP4ftH4YNZ83825tz3hLKJEJtx8/P3KskF/lbNNCEu3Fn+/RGLmKsX8bwb0G2Lm/XM6gc+dnuG+GmvNQOA4vixPEF522s6yJHEWKUJdNiTx89/TyVHQrEbxH6/0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697886; c=relaxed/simple; bh=wO32bcNT3LvCUpFUE8spFFSYHTYoba2s3UV9j7voxsE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uhEQGgfzpwnw+uFbtbk/A5HSuBRkHdFleGMAOSJVa3HSAk/erPa3YeAV1vsla8lpOgY/qb5tQXWhHBIBuKyW3A2cmuooB9Wt8utHqmn/e8S40tFHuiofiouq17Z6WiDvtykuSRd3JFoxvcAsyDa5W++X0sw+sgnLUJADxEtNW3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Tx/Kqtq1; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Tx/Kqtq1" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6cb2dffcdbbso37871096d6.1 for ; Mon, 30 Sep 2024 05:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697884; x=1728302684; darn=lists.linux.dev; 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=d+1PZUGpVB6A0qj8dhi+z1VPBRWAZJyLXCCfSc2+bXs=; b=Tx/Kqtq1lF6lUgYMiXbkPiASyTCTj4iHo+zkiekW5zPkmDHDiAKaH2k6mS0J6bjyab QCbYgj6RUyOJ5//7zOl5TNrd92odhNqIU4A0MTXxUwFcf0LV6DeRfMS1MBtDMAbfUdQX q0J0odIKnMxhCRC5ooiL7F5zl+yxflxCJV6Io= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697884; x=1728302684; 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=d+1PZUGpVB6A0qj8dhi+z1VPBRWAZJyLXCCfSc2+bXs=; b=liXkY43uQpk6BIrz/9okezl1PwKA69Nom9pgerIMc819fN0eqbV+cbKLZ5IOyyh2Lz OJEpGX1PUtzsnQsW09td1xBq0RI6oFc56pYqI/8848VKuNDMm6RSzRN4AsTJ2QdIZivz lrbSw7rgp3yUs7CpDV/lnZZvZMc4yW9ylBbpxmC7hypmDJHOX19XmH2ryCmzEvrEqaOV EtSiibV/d3bCBDwvEkEON0VMNCtfuiA7jdSDFR3mn4xAPAhKt8A+cqMWas9AAqczRwjW x+T5EGPk5mYq5ECOARf7xiOlpLYabKoJs3N5Iw7mWoaOL1hHsoKvXUBRfiB2Titot1Uy e4yA== X-Forwarded-Encrypted: i=1; AJvYcCWVXDo+IU1oA/HHGS/nLJm7t2GMcS3a7gdvLOq3/lj3NrWBVNAr48qracKODvLEqhpOMLk=@lists.linux.dev X-Gm-Message-State: AOJu0Yz8G8gfHVrw2jWBcQxzBRIPeu3mB8vTrgZppbNvTO+l+ZTL3XG2 B3CnMI2VkhSf82d6cEsjVSRfTkI/KD3ixJQzNy+qQw4dxtJxbccP6Xn49leu+g== X-Google-Smtp-Source: AGHT+IGmAxnIT189WVUBwg+x/R9UvWvqRDVNzUhwwxur3BAKszcZq3coNxLRGmF9WP2isGNKo1o/8A== X-Received: by 2002:a05:6214:5706:b0:6bf:7bcd:78e3 with SMTP id 6a1803df08f44-6cb3b643feamr164774016d6.29.1727697883855; Mon, 30 Sep 2024 05:04:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:42 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:14 +0000 Subject: [PATCH 19/45] media: platform: ti: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-19-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 The following cocci warning is fixed: drivers/media/platform/ti/omap3isp/ispstat.c:771:21-27: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index 359a846205b0..603439afe582 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -768,7 +768,7 @@ int omap3isp_stat_enable(struct ispstat *stat, u8 enable) unsigned long irqflags; dev_dbg(stat->isp->dev, "%s: user wants to %s module.\n", - stat->subdev.name, enable ? "enable" : "disable"); + stat->subdev.name, str_enable_disable(enable)); /* Prevent enabling while configuring */ mutex_lock(&stat->ioctl_lock); From patchwork Mon Sep 30 12:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815968 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 D8AF21991D0 for ; Mon, 30 Sep 2024 12:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697888; cv=none; b=uUreCw2eZEfRN8ZxqFwr3us+yx1lGusor6AVU81lhHe6qvSw/Sa7zuff6CCoXVoObXuw4ZNK3ylZPvcgD+MHQShRAMBTQ1nvdBEpQgStGV0CAxe8QRGlIYaUyLP+uk/5KWlj4wbFGYY814sf5l8bnDneZp+rzt+7CZL7QVhOzAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697888; c=relaxed/simple; bh=a+FiLOH14SS6a3AubkD6ERw5Y7LANHZ0RAc6/umufBY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wv3dZesU46ESy01nzEVwD84y6SGTxsRLTifYn5/zUYOUufmRFli5R4b0oTOwDb6fVkDe0lRtZiYoX/LzsYk3EY49kKxWLFCQJ1Xhvp+JJz5i7p+fWSMEV5KN/QFVOcXFW72wUkgik4iVtQaVYT8cmwZeHmXCy422guSQroIgWyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hcgGrC+5; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hcgGrC+5" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6cb3062d9a6so36154296d6.0 for ; Mon, 30 Sep 2024 05:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697886; x=1728302686; darn=lists.linux.dev; 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=h0yeJPaEcAnmgbtIHCIKdElv7f1NVvyLMutp/xQYAjQ=; b=hcgGrC+5QTTC4Mwj9aoIb9VDwgaPDASKEtbjj7zJCIta+IQIlEgureWRez6N8DY4FD UpWBnQ5sl83zVa6Tbm04JSE8Zc9i97+udcYZp235rEontXah27p+2xQf3vLkSduw9C46 beDhx3R0nsf/6PV9DzRM4YorR8CX6CqzCCyBQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697886; x=1728302686; 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=h0yeJPaEcAnmgbtIHCIKdElv7f1NVvyLMutp/xQYAjQ=; b=YCUmZsrhQIZchSLnRz7W9mSPowqNMwX8ywXNhDsfZuRyCwv6rK0yxMxFEeuH9y+x7V dPfYCLo78GJ0IpJhMXFAm2F/5lZHodlbIHwUnKmZKccsj7vwT0YL2E+LaxMt6GDrX5mZ yzD+DAnmkHulwmj0zsg5FNQNjY4zZJu9+O20UWVUI/tK8oies6z5gWTsCoagWXx4UsMs 4mErxjKjJKT2HXzPb2XZqkP2wONTJTPT8d0euRT8He0+rHGq26XXRcRNz3NvsOEc29dk MePIfSHG4zG7HQSi7YZsu917FRTM36MM87qJsjjBpquuIybcIsaA+L3Lg+c2TKigzVSS tqRA== X-Forwarded-Encrypted: i=1; AJvYcCXXLSc2g6CxX7i6cjrDyN8Q8Z+pYJUwRBcBv+McdyzEzrxjGW0E4+DGAmy+dFZyGPb3Zts=@lists.linux.dev X-Gm-Message-State: AOJu0Ywd3Gn30jmCX/wmGTWBRiKxndQIT2tTbtNcV3VJd0Z7TIYM5G+V CB9AHSy8N1T47PIZyr+tlcbYeliB7o7Fj9HoFmGkIpwaQWdA7Frpdeh3tM7KmQ== X-Google-Smtp-Source: AGHT+IG21mP+tUHPXSvJJJTKpKcZKw04O9Ig9Voo1lmCCA0A43eFT06NNMj2BNffGbxEca0hhvGjiw== X-Received: by 2002:a05:6214:3a88:b0:6c5:b636:d737 with SMTP id 6a1803df08f44-6cb3b5b648amr195767466d6.2.1727697885829; Mon, 30 Sep 2024 05:04:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:44 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:15 +0000 Subject: [PATCH 20/45] media: st: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-20-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 The following cocci warnings are fixed: drivers/media/platform/st/sti/hva/hva-debugfs.c:74:9-22: opportunity for str_true_false(ctrls -> dct8x8) drivers/media/platform/st/sti/hva/hva-debugfs.c:79:9-22: opportunity for str_true_false(ctrls -> sei_fp) drivers/media/platform/st/sti/hva/hva-debugfs.c:77:9-23: opportunity for str_true_false(ctrls -> vui_sar) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/st/sti/hva/hva-debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/st/sti/hva/hva-debugfs.c b/drivers/media/platform/st/sti/hva/hva-debugfs.c index a86a07b6fbc7..5e8c7dddbabf 100644 --- a/drivers/media/platform/st/sti/hva/hva-debugfs.c +++ b/drivers/media/platform/st/sti/hva/hva-debugfs.c @@ -71,12 +71,12 @@ static void format_ctx(struct seq_file *s, struct hva_ctx *ctx) " | |- SEI frame packing type=%s\n", v4l2_ctrl_get_menu(entropy)[ctrls->entropy_mode], ctrls->cpb_size, - ctrls->dct8x8 ? "true" : "false", + str_true_false(ctrls->dct8x8), ctrls->qpmin, ctrls->qpmax, - ctrls->vui_sar ? "true" : "false", + str_true_false(ctrls->vui_sar), v4l2_ctrl_get_menu(vui_sar)[ctrls->vui_sar_idc], - ctrls->sei_fp ? "true" : "false", + str_true_false(ctrls->sei_fp), v4l2_ctrl_get_menu(sei_fp)[ctrls->sei_fp_type]); } From patchwork Mon Sep 30 12:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13815969 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 36702199234 for ; Mon, 30 Sep 2024 12:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697890; cv=none; b=pJP/Bw+nQ0NNiiMJqnuQapovdoGvMgO6RSfVkHUp+5pFaCdNztVlDORZZBUwVb8nEPIRwlRcEFmIBHKvLTxCpkcqM9mgcVyXzb9IFLotFJk+b2onpy7RVbyivPhor19gCP6m+4MWiVQy1Zg18TCDwIJCGIHSQvdQ6ovB4ChJzBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697890; c=relaxed/simple; bh=0dMrYdJQZDwFbZRFwFBopbceAxAW6UVmiIWzGdnbBBo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S/CSZjZKufJ4DDdh/zT53qKbuvhHZaz5vm4SiwZQqDEpQdAQ2+4M/1oFv7h27UK53mMx8DP5AGoGPf/A4vz/QhVwS0C5FdJNAJ5qzTk8hZcujPU72inhO/sMsH/JyO0gNxg65tMH4zPjHQQrDVhVcYMzVkJN+VeDxywm29OCOMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ZdTb8zPn; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZdTb8zPn" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6c3603292abso43945346d6.1 for ; Mon, 30 Sep 2024 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697887; x=1728302687; darn=lists.linux.dev; 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=nZdkoyJRGbtYAtgWDyhzmqUrZ4ojuNTD42Wgr3aJHzg=; b=ZdTb8zPnOrdqbAVOyMTleEYs7MpNKq3/CjGkfuHDFCyPJnVBg9UUYjzVVE5mMEIXFn 7nEeuI1zB+M7WAJE/Jvr7k9zkDStC7GhaTAOwGSgX/32U3/NB5JuBA333C3DnIQtAQ6A ddKgNEE4GMl20QOQuhGck3ycQdjo0YvYl9//U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697887; x=1728302687; 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=nZdkoyJRGbtYAtgWDyhzmqUrZ4ojuNTD42Wgr3aJHzg=; b=dY548nxG0+41eHIBpI3qH78w1OpdqStAdZ9I9sVpq5DjI/awDTf9cnH/g2v6eaQnDn 4t8Z/OhfVd9ZSusSqLAJa3fLmDcNDyS06IEscp+1+jkY6lMHzCd+lsddoFyt/O2fri41 t0lAAq5jYkOlErlAbqTxu3m75Qn/OEwoGgTLkCePKFYMJG95068yI1lG8KCPa6tq0vbF OXqe9nKcgA0KJWqoJYOVcR+RhIxiizZ8jzsLyRtTBIy+bTO0o/Xeze8WuL3FTilDuque 5Xo7u0VTuG8GbSLBLYIz/7kQvu/9hKPnrrgmi2Lhu2dKxXmO8H5LAp/vFMjWeMXNNzwF LoBA== X-Forwarded-Encrypted: i=1; AJvYcCVcvX+7QrmPDGCGucgHqjBpuna348AJQWudrBdNwtNOpG0OCx5C9uXhG83F7f+MC84yxzo=@lists.linux.dev X-Gm-Message-State: AOJu0YwxEjW8FWn2e6QIC+ATdIzOqM9RzN5edsIl23BcO8hsSNzY9sz3 4SUrSK8OULCv/3mOJKrQVNM0hamh7TO8DFIse64j2boVMQl+Iy9bV41uexuHgQ== X-Google-Smtp-Source: AGHT+IGDig2qhJHVIgkos7cydvwLVCYXpIPoGe1fBfPazyzsBzvK7ByCA43K6ayYB6dav+TXdoGUKw== X-Received: by 2002:a05:6214:4c03:b0:6cb:410a:ef5d with SMTP id 6a1803df08f44-6cb410af56bmr118016106d6.5.1727697887257; Mon, 30 Sep 2024 05:04:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:46 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:16 +0000 Subject: [PATCH 21/45] media: coda: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-21-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 The following cocci warning is fixed: drivers/media/platform/chips-media/coda/imx-vdoa.c:120:39-42: opportunity for str_write_read(val) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/chips-media/coda/imx-vdoa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/imx-vdoa.c b/drivers/media/platform/chips-media/coda/imx-vdoa.c index c3561fcecb98..abdff181d417 100644 --- a/drivers/media/platform/chips-media/coda/imx-vdoa.c +++ b/drivers/media/platform/chips-media/coda/imx-vdoa.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "imx-vdoa.h" @@ -117,7 +118,7 @@ static irqreturn_t vdoa_irq_handler(int irq, void *data) writel(val, vdoa->regs + VDOAIST); if (val & VDOAIST_TERR) { val = readl(vdoa->regs + VDOASR) & VDOASR_ERRW; - dev_err(vdoa->dev, "AXI %s error\n", val ? "write" : "read"); + dev_err(vdoa->dev, "AXI %s error\n", str_write_read(val)); } else if (!(val & VDOAIST_EOT)) { dev_warn(vdoa->dev, "Spurious interrupt\n"); } From patchwork Mon Sep 30 12:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816013 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 802C419994F for ; Mon, 30 Sep 2024 12:04:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697892; cv=none; b=cx/iKG1osdLPqvaYgnLIAYzqzLnsOFvBpvZlBLU9GhE2YnsMv5Qa1t1x9VzDVYX1JFmfBPvI1PKp8xEszcuNjy1qUE0XTZuIhRbd5FfjNwDW2Z6ORqZWFKk2gKJH3gPxN+MhsFR56MTH60z8GNQ8W9C09SYi/CGgWvR78P2hsv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697892; c=relaxed/simple; bh=iATwc6ufGXARE+6lG0pR6BzacdyrfLO5QVcrh6ufzXM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UtOUsx7HNsJapoumCDPz2x3dOmvkAVZNmC/Al0heN4wkvZkneDjTGEwXMU5N/5s5OsJmDh7pbTwe3DiX4i4Vx04SCxw+KvA3+HsrKjAd8jlErVyTwraqO3puvTZ+jrydfwz2HDV2C5/TfgMvqVrWW7ZzJs5/xviP//r6TB5Ehhc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=CcGDxu6w; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CcGDxu6w" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6cb3ba0a9a2so24001836d6.2 for ; Mon, 30 Sep 2024 05:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697889; x=1728302689; darn=lists.linux.dev; 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=aurzIxhre/dA6wUpFHCHveAY7utZWkXC/gGbqMcXk0s=; b=CcGDxu6wY8a2pM8gTe8LWx10hV4+hiz+QTOUXZn3JvLp4WFQ+JvKJcapoYAR1WvG/E Ab0raf34m5WkqghhinX9u+TuW3lXeTLWwjnuIkzwSD2t2Zx2yNycWc6vAFKRSFhXcccp WRS0wn5pZUZZSfmSnCJ5bq7tfQFN8GYmW1dRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697889; x=1728302689; 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=aurzIxhre/dA6wUpFHCHveAY7utZWkXC/gGbqMcXk0s=; b=T2WnuCSis4Y/BleYpgk3SzJDPkFqP8XORRZ2KAl6tnRWu8tJaerYFo0HDx21f0ZAWi Rrz6uO7Y89BhnOYFqH1FOFJ7T51JqcPn7UGLXw0iNjKMGzxWqtRoWMlQ2METFePa+VJx Y2okVvpZAXhz2BhO6JvHtA4H9ZGfXZ2n35rz3Ndfn7K2OfQEBuUXbvNSCS0jk1D6yLsY ixMOcTJK0y5R8+XKfAFrIU6oBis8v1j2KJ6klQGEOnCfCxXBQiCIiQR8yXCBFzHBGGhL dBt5VLM+XK99vX24Fi6rocYhSMyBiBYRKSvekfKWz1Bv9Xy87yXobqIwW+4ErtwSXjQ+ 2ijA== X-Forwarded-Encrypted: i=1; AJvYcCXokh347G6GrssPCMqWGXL8+K8zkiuuWuAx0/PHL+iftcEbVRmJ6Zgbl58gsQdmk7WuPhc=@lists.linux.dev X-Gm-Message-State: AOJu0YxVAQcXPuDDObuUOghq/1IemIsoGgkb+0FrZuE5zGLAvQTzzIb/ QQN4F+HeSVSMd7axGXCt+uDkPYuk3gkPcExXnZtafYmWlO9lolZpKwTOYkeHyg== X-Google-Smtp-Source: AGHT+IGIOHdh67nNwgDel6paDE35Eb29KwEMX4XzmiYgJj7qtD9+Z/d/ZNDrc9s0mVLpMYI/GTz7DA== X-Received: by 2002:a05:6214:53c4:b0:6cb:27e6:393f with SMTP id 6a1803df08f44-6cb3b63d1cfmr165544066d6.36.1727697889388; Mon, 30 Sep 2024 05:04:49 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:17 +0000 Subject: [PATCH 22/45] media: aspeed: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-22-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 The following cocci warnings are fixed: drivers/media/platform/aspeed/aspeed-video.c:1944:6-16: opportunity for str_on_off(v -> hq_mode) drivers/media/platform/aspeed/aspeed-video.c:1230:3-17: opportunity for str_on_off(video -> hq_mode) Signed-off-by: Ricardo Ribalda --- drivers/media/platform/aspeed/aspeed-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index fc6050e3be0d..9c4a47d7a442 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -1227,7 +1227,7 @@ static void aspeed_video_update_regs(struct aspeed_video *video) v4l2_dbg(1, debug, &video->v4l2_dev, "compression quality(%d)\n", video->jpeg_quality); v4l2_dbg(1, debug, &video->v4l2_dev, "hq_mode(%s) hq_quality(%d)\n", - video->hq_mode ? "on" : "off", video->jpeg_hq_quality); + str_on_off(video->hq_mode), video->jpeg_hq_quality); if (video->format == VIDEO_FMT_ASPEED) aspeed_video_update(video, VE_BCD_CTRL, 0, VE_BCD_CTRL_EN_BCD); @@ -1941,7 +1941,7 @@ static int aspeed_video_debugfs_show(struct seq_file *s, void *data) seq_printf(s, " %-20s:\t%d\n", "Quality", v->jpeg_quality); if (v->format == VIDEO_FMT_ASPEED) { seq_printf(s, " %-20s:\t%s\n", "HQ Mode", - v->hq_mode ? "on" : "off"); + str_on_off(v->hq_mode)); seq_printf(s, " %-20s:\t%d\n", "HQ Quality", v->hq_mode ? v->jpeg_hq_quality : 0); } From patchwork Mon Sep 30 12:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816014 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 31AD4199FBA for ; Mon, 30 Sep 2024 12:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697894; cv=none; b=gp7/7TZv3MdX6zQkw4Wst2c7jxuYo4fdL3GgxLjRT75opsEQrEboj3ExwztDXPQj0VNgRk9CGj6N+pMBKsLANwxS85lXtPi/Pu7OqOROc7BMLCTO+Qpq7Fq7GoHNEq/KnuxbE+H8FRyVnKWtSUrortC22iGIyKNeBXq26c63Z3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697894; c=relaxed/simple; bh=gioH4bb8ZF2A2YJ3Gh5wVo7at/LilX8METihZcFwy7M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PbcgfQAEjdeYH8751kRtT/J0ZNDPE7IokTTRDTpdTJ7shwY+DAQLTmzDjgYSelbKL0mJU7sK584BaLrf6SzHySfJSulBh+YBpqdngu8FIWCGDef9UEvLr4HO8YXJ6v9nmT8e5c2zssTZ1ILwlN2ptBeOL/NZWZziHcKknUx/lgk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gqcPSwfZ; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gqcPSwfZ" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6c548eb3354so35736736d6.2 for ; Mon, 30 Sep 2024 05:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697892; x=1728302692; darn=lists.linux.dev; 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=fkGnsANo5NZRR329f/RKKIwKl1Ms+i/uz0ChSSNIXaI=; b=gqcPSwfZl9PUltpjAnQbhF5i2f49H0YG82wHkwuGFKGEgvmPXN14LPc5OYQameneOf W9+D0IzZczM2WsCbioUgrFZP3kFCgm05vMGXD06fue4CrNheC1B7Nf+e82o1KSoC01e4 sR7w/gO3b91RqWthypqtQehfLIiM+SMR3x3Ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697892; x=1728302692; 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=fkGnsANo5NZRR329f/RKKIwKl1Ms+i/uz0ChSSNIXaI=; b=ojiWLtUEoiKyvxCJmK0W8JGHdsgR23bTgJyqyVDoYQd/F4VLVI0VtMsCGNqlYXKwNg K0CIxDc0rsRI0Z2lXESN6y/xAroG0hdsEeZP93BKbS0imoHGcNXV023MH/ULP6OQ1ehv ovhq+fq6NOdKUVUgphv3kqHRi5eZi6WvlyqN7OUNneUjDSx62Xk9bT8AV70r8vGpbAfX QLYqBggsqTxkRpuvZTe9FOCeF6LO2cNUH87+7ts6bReQz2W/HsrBpqv5nZ4jVIjX0ISG SYuPSvRZL7R7ta1FL17n6AdyQbSWrNOexEndFA9g7tWFJnU1uss3H16O3jj5u0McLlHU w6MQ== X-Forwarded-Encrypted: i=1; AJvYcCV5uPWOJZkmkB44YeivR0/v403F4X+uARTOB5+PXFHKpelwQuPU8Sb9c3eBsIpCgGliUe8=@lists.linux.dev X-Gm-Message-State: AOJu0YzmdfnGnwPg5QR3ITg+bG4DHOYCpP0HmvDYTK5OTDVLDU3PX5l0 sK5NVeM80lyJr/XW4q511fhmD5NHV/36FSKrMkyEXIToQ4WlmZhg2NJLNBblkQ== X-Google-Smtp-Source: AGHT+IHSrAGEQVH1G1zMvd/O9AA5MhvLH1UshVFh4gerMrNNX+7ODpeAcur/C3J29WO/FfgVZP2azA== X-Received: by 2002:a05:6214:33c5:b0:6cb:4def:4ce4 with SMTP id 6a1803df08f44-6cb4def4dd3mr121217066d6.32.1727697892043; Mon, 30 Sep 2024 05:04:52 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:50 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:18 +0000 Subject: [PATCH 23/45] media: ipu6: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-23-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 The following cocci warning is fixed: drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c:247:51-57: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c index 051898ce53f4..522dbf52c82b 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c @@ -244,7 +244,7 @@ static int ipu6_isys_csi2_set_stream(struct v4l2_subdev *sd, u32 mask = 0; u32 i; - dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", enable ? "on" : "off", + dev_dbg(dev, "stream %s CSI2-%u with %u lanes\n", str_on_off(enable), csi2->port, nlanes); cfg.port = csi2->port; From patchwork Mon Sep 30 12:04:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816015 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 07C9C199FDA for ; Mon, 30 Sep 2024 12:04:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697896; cv=none; b=nLLtit6eJOW3S1wquI2PsOi9gAVjDbx8ngz868pjh9rwei6MRGrVubEj8FPo0ZxB7Yz4ghi5Pwocy15dpilSHuPxynAJ0u1hmgIH6ZBevyUJ918CMyDYAMwdiMPILKt/1Zu+gEku53VELdFseeM2l08oIVPWUtw1ylgQlrWbuek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697896; c=relaxed/simple; bh=Wy7Skzwx1Of9aMKIpNRDdVVt/EfLoQQHwwrlTgvOSQs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m21ze9/1JyE1xLdRhTa6605Qvhq0awWml0wH7gYbgnaU1WDjTsnWUonItRP0Rw3feUjMGL38OSW1/aL1atBAdK7mdKcnT3Wkl1wuLctzj1tDUZ1GESL1pno3zSJEJdSJVgdKEU3lbf/YjXYs3/vjEpZ2zz1M8RezrolAharNofI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=OpJAkCBS; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OpJAkCBS" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6cb2aac40faso38500536d6.1 for ; Mon, 30 Sep 2024 05:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697894; x=1728302694; darn=lists.linux.dev; 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=kc6yac9SyLlHs7WRhmQW1+HPAOFx8yEw2UfT0f5Qnn8=; b=OpJAkCBSMgq9uJcdtOa/XAcfWcZ+dbye8e3ZpmTSTv8/JsVS+3GFSfdkvUdpW034is HZ8K73JBEW4olwgIKnpjgrbLj05tremn6YGig4KHRxBLqt7ywJXfNiXHzG3atvZpyEP9 g50CG1T8dVQZ7iMoCYdv6OITl2B0Fh20dHt4E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697894; x=1728302694; 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=kc6yac9SyLlHs7WRhmQW1+HPAOFx8yEw2UfT0f5Qnn8=; b=IrS+0WF68XJe+TZZyHdtnIHkXuEwkA69oIzuhzZpV2uIUf2kN1hPk9hLa8FXJJjuu2 lDLdNdvrULIDjrfB5LT2se1vPutytrA5Ocma4a/liTmzGfnr3aSt+fj5Mk98rQnWvskk UhHM1poOuef1bRgch/goBOio4KWTLKejDaSonUCQ7JS8QpqxeeyRZDTQk19C9cpAGKce UQ4pCGhY3oJU/dcHGGjfTFnpQwQGqw7UF+PvdtMpPQXXUGAizW7l3Akye8QlyYzXX26I r5mb/sQJyyAfKRF5q6jihPxw8hRN8skQRw1wp0u3KV1jpzj5P+eu0pZmTs/hkVgGJmV7 dqXw== X-Forwarded-Encrypted: i=1; AJvYcCUX3iI6IAjHs1B/Q8NLtXgf2Mf1rrOSYspi9Hms2Ykz41Luzac8WJyB25bul3tscEaiGv4=@lists.linux.dev X-Gm-Message-State: AOJu0YxlMc0m6FPa6S9naopAeeh0IFm3A/OUaMsmMleG+bhuftD3jk92 5Iox6jH3ZL8RAkBaEsVDr9aQXt2SIU1VkLDOFRMNe/opy2tgz91V3CktGGK/Cg== X-Google-Smtp-Source: AGHT+IHvTtSCRFSBPeJou8A8lJWRExB8EwT4CA/+ss3rMSh3j0C8PX4s4DLpZYrCskrdUJWUEmVJfQ== X-Received: by 2002:a05:6214:489:b0:6cb:2de5:d7a1 with SMTP id 6a1803df08f44-6cb2f270becmr284661826d6.8.1727697893842; Mon, 30 Sep 2024 05:04:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:52 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:19 +0000 Subject: [PATCH 24/45] media: cx18: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-24-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 The following cocci warnings are fixed: drivers/media/pci/cx18/cx18-av-core.c:1013:40-46: opportunity for str_enable_disable(enable) drivers/media/pci/cx18/cx18-av-core.c:1118:8-24: opportunity for str_yes_no(( mute_ctl & 0x2 )) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cx18/cx18-av-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index ee6e71157786..5701abdf9427 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -1010,7 +1010,7 @@ static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable) { struct cx18 *cx = v4l2_get_subdevdata(sd); - CX18_DEBUG_INFO_DEV(sd, "%s output\n", enable ? "enable" : "disable"); + CX18_DEBUG_INFO_DEV(sd, "%s output\n", str_enable_disable(enable)); if (enable) { cx18_av_write(cx, 0x115, 0x8c); cx18_av_write(cx, 0x116, 0x07); @@ -1115,7 +1115,7 @@ static void log_audio_status(struct cx18 *cx) } CX18_INFO_DEV(sd, "Detected audio standard: %s\n", p); CX18_INFO_DEV(sd, "Audio muted: %s\n", - (mute_ctl & 0x2) ? "yes" : "no"); + str_yes_no(mute_ctl & 0x2)); CX18_INFO_DEV(sd, "Audio microcontroller: %s\n", (download_ctl & 0x10) ? "running" : "stopped"); From patchwork Mon Sep 30 12:04:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816016 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 4ABE619AA53 for ; Mon, 30 Sep 2024 12:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697897; cv=none; b=E/pEFcgMFNVsfBmaLfXWRiuxDDa/LId/WuMndUbd/6S6dVWcBB2xJlWUAvmllY513Z+H0Q6WCZYemsgf4GMKpI+neXfmwYNu1oBpKFSG86lLKsCofzNkEfJPXlaMXXxxdTTUVAf/ncYTaArdqK2vv9KOj+EUGf/0ypq3k9G3cyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697897; c=relaxed/simple; bh=1g0+rmMwCDuGWvS2q/K/LC+NTqBE6pcQhTrh1e6y+HA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rjylaoZitDBST7426kogHvvSHeruhL4+j9ggDMVu/RioUy4YUjfu5P8EZed6560hIoU2R+jNobJkGme0V2YSyKeuWgPQkNat3zV2DqmBgiTATXi70DpmScprKgNEzB6yDk7Z5m+x9syNYohPpkhCMFB1OYwyGXU6sI++DTVdLmk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=USBXmoI2; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="USBXmoI2" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7a9ab8e5f96so363397385a.1 for ; Mon, 30 Sep 2024 05:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697895; x=1728302695; darn=lists.linux.dev; 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=4IxOY0fJQbV1pYrixFE+l++vJW3v3+bYS5tnnmoYTEc=; b=USBXmoI2kq6ZJd1amXyIBp9NEfW9OSsOmqGk57Om//CAzeFnU5XpY3w37GEAd/JcNt oYMnOoaZ/UZMQYSwXC9iG8giO8IHlZTSmHghfuGNDco2xpofrbjkK+jgY1K1MQrNfs9u 46/9De/xEgf0/LM/nonCMgbjADhAyp2VYH5LE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697895; x=1728302695; 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=4IxOY0fJQbV1pYrixFE+l++vJW3v3+bYS5tnnmoYTEc=; b=m/r7p5fkc0tp/eaqKwJYrC9h2NxQbNP76R1sq2IYGOIvDVERsc0eO/TB4mUwMPepCm A3uKw3+QtYMutBf5eQla+mjT/KhBGXEZt7bgVAaiT3L+gBaviKPxD7EstKgiCsoZJlE5 GIvezLGhBvwj30b8BWUU8EQFHLXkdVH5ndiIYdya8HLMKhb78sSFbxu4aLmkNSyBxOKw xR/Ljq2naG4JQ+q5X/W/YE3XqhT4baGvD3MdLVrW/6M/LZKTSoDLm8wETH6bbjOExeRV jIhdR1tpNXyFMQ2TDcAMMlpd1nIAMIzq9KyCexpPJec6F1AIZgYuKQZh35Db5PI0/0uE EVZA== X-Forwarded-Encrypted: i=1; AJvYcCVYPlBC2hE3wAFz9b5YzliKEPv57/jMyOTW/b7XQF4MwO7D664HBtU52Fvci44+R/Bb0SU=@lists.linux.dev X-Gm-Message-State: AOJu0YwAUsS+t946zT4jY0YZLA76CM0PszjNgRQ0Att9Kdy6r23Xqoml VtVymSliP2GPMTlKJFkKeJXzrTI5lW9EWLY6lh0dnfYRO2jcVkMKXZjM8ewmAw== X-Google-Smtp-Source: AGHT+IH66496SEOv3j8ygYtL4JJVB2nn5gkUmde7+6fS5LT2xRJFvFwOVG+MRgiMM8u5XXNXcxJVyg== X-Received: by 2002:a05:6214:5b07:b0:6cb:5dd3:a3ce with SMTP id 6a1803df08f44-6cb5dd3a78emr68541006d6.14.1727697895340; Mon, 30 Sep 2024 05:04:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:54 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:20 +0000 Subject: [PATCH 25/45] media: cobalt: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-25-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 The following cocci warning is fixed: drivers/media/pci/cobalt/cobalt-driver.c:263:25-33: opportunity for str_enable_disable(ctrl & 1) Signed-off-by: Ricardo Ribalda --- drivers/media/pci/cobalt/cobalt-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 6e1a0614e6d0..cff2d29410d4 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -260,7 +260,7 @@ static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev) u32 adrs_l, adrs_h; pci_read_config_word(pci_dev, 0x52, &ctrl); - cobalt_info("MSI %s\n", ctrl & 1 ? "enable" : "disable"); + cobalt_info("MSI %s\n", str_enable_disable(ctrl & 1)); cobalt_info("MSI multiple message: Capable %u. Enable %u\n", (1 << ((ctrl >> 1) & 7)), (1 << ((ctrl >> 4) & 7))); if (ctrl & 0x80) From patchwork Mon Sep 30 12:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816017 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.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 41A6219ABDE for ; Mon, 30 Sep 2024 12:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697900; cv=none; b=lP4YZHbbT6OmwGTSV5vGxe88N+zzKWINrRG9aQJVmOt4b4/VIfMlrNzSy9DlbkKn9bDPU3tHwak62ug5bSxjh18Wwsuv3g3e1oqEr/NOlCCqr8/1VfNin6FC+m3q72pFJPOKm574ly8bdBSNPUZfB4F6tl/1wdJdF3blCaOnSzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697900; c=relaxed/simple; bh=zAHXtBXd38DxPFfjTz25yyTkm38285rSqJvPg7EppSk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iS30zlrQ9Ky/tE0RAf6ypNkz/+tdJuHUR3yVsXFHPRdSdwsEsCyWCQ7u6X+8bsAFhJAlemkJpvYXI/KSmMTJIft4/fT2VPGCFER1xMw37NMzZS9wO8X6r2lZ1gCoYnGRNeRtxEQzzpQiTC2p0wQ/5wz2zAiHGR70A4EYhC6WLaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=GJd+q6zJ; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GJd+q6zJ" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5e56759e6d7so2481552eaf.3 for ; Mon, 30 Sep 2024 05:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697897; x=1728302697; darn=lists.linux.dev; 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=tIonQ/DAaQ73YEKHhPQbmT6IJ8ZJpmHYGgDzVtOZCdY=; b=GJd+q6zJoW85TZyYtzUISflXhNjL/ws7oBUqn6QeW9WPb++UoO4+/PjjqRqw9MaJHg 2GORMdc7KdWOsR4GDSBJy8AGqp0MutVtto9AVgl4kIuYDa0KRrRiAEilss6BaZJcNln3 vcpDL/Btw0Fg5vXAblUeRvMkFC2LrHDSejUI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697897; x=1728302697; 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=tIonQ/DAaQ73YEKHhPQbmT6IJ8ZJpmHYGgDzVtOZCdY=; b=BhKTNOgmYHi6HjEJSz9dUK9GdYZR+hDMUdE+L0cDkKOA4Kb0W3e0ygFMdnICkG9UVd sSxZJ/1wfTx2KBcH86Z6wZmfAcVOFbYSgUJC1qnx7kJ1JwnZKLgV1I1FMPXXnoVpd6/x x0sU+X/C6IQ+VRUAGARc5XYchaHZsfjz0GxudCgXwCTBHYQXsf+9LmpfFIC9MNMcxP2m eT4JgJjtNSPgTSjVzc/p1PAbC8/X8gpHnzhREvyWHB9dwj/SW/kVMJJ/VFi/u52gpuMe Wy5YyiOJ8Ozn0fpnfqaXOInfbfcqpp+4RveVixyF7AuW5MDiYAYJgDoUfVCTo/H7jUaB bQYw== X-Forwarded-Encrypted: i=1; AJvYcCUqfLQszNkbx88MCaCzor46mvLKibiEXn/6V2PrwQQS1irrU0l8ZZ5+Ue2671CrBe3tdmE=@lists.linux.dev X-Gm-Message-State: AOJu0YwsORGUBSi5kNHfrePzZ9hw5N77W0IbjbZlZSYU7kIwr5xj0itH 8lRkpO47T4A4U2tGTwU/vnB/FEx5Fr0TwpdPwSpbZpvHTDtDc9lr1m3EBMX3cQ== X-Google-Smtp-Source: AGHT+IGBBDkCLdkyPSXSamdMv+lg/+wwDPA6EahlQnUNGQaV2riLXTLngR4tQbOORFsEO3I87GPG9Q== X-Received: by 2002:a05:6358:54a6:b0:1b8:33fc:ae71 with SMTP id e5c5f4694b2df-1becbc9be95mr344688455d.16.1727697897424; Mon, 30 Sep 2024 05:04:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:56 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:21 +0000 Subject: [PATCH 26/45] media: videobuf2: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-26-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 The following cocci warnings are fixed: drivers/media/common/videobuf2/videobuf2-core.c:3008:2-6: opportunity for str_read_write(read) drivers/media/common/videobuf2/videobuf2-core.c:2860:2-8: opportunity for str_read_write(( read )) Signed-off-by: Ricardo Ribalda --- drivers/media/common/videobuf2/videobuf2-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 29a8d876e6c2..05678fa14fe9 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -2857,7 +2857,8 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) return -EBUSY; dprintk(q, 3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n", - (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, + str_read_write(read), q->min_reqbufs_allocation, + q->fileio_read_once, q->fileio_write_immediately); fileio = kzalloc(sizeof(*fileio), GFP_KERNEL); @@ -3005,7 +3006,7 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_ int ret; dprintk(q, 3, "mode %s, offset %ld, count %zd, %sblocking\n", - read ? "read" : "write", (long)*ppos, count, + str_read_write(read), (long)*ppos, count, nonblock ? "non" : ""); if (!data) From patchwork Mon Sep 30 12:04:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816018 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 8FA0719B3C0 for ; Mon, 30 Sep 2024 12:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697901; cv=none; b=l9QtLxLi949JOPFrmBk6jMIc/3XrEgErmd0W0vvE0wzBJJ/u8Rj32cYDnTjLhBs/Re3FMc3KQzrfDtB8EAQnPSVtZ896qKeoQeafX8luRBYzerXEig3bOiC+erfVgmIJDRhGBfBObbV7ZyoHo9zdbuW76YNIxV4iAukTn90jPbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697901; c=relaxed/simple; bh=fSPAVO9ZDOlfM+yvKGofjzMlsnwmS7DOHpFwVZfy/5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hpCKpzem5pYclZxkiKpikE8nxlX1XFYxF76u4U6DTBPowPdKcgW+JkFncuRlXSCNOEUnA9Nl9sD9In/+XHh/JeaX6PyPtCNvoi3yi2PxrVIQfWNczg8mZESkO737AkZs74vFUk9suRoLnFG8MnSSDuLu+oSRqaX/ZJpkU9Ob78k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=R0tBfSng; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="R0tBfSng" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7138acdfb49so2418481a34.3 for ; Mon, 30 Sep 2024 05:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697898; x=1728302698; darn=lists.linux.dev; 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=w+lDXyICIHcG+x83IY7Td9H+I+izyCveuIAoXyx8Crg=; b=R0tBfSngL2dVzw2ovg0FHyZP3ya1DPIW8OfC5bBSc88g8DBUjgVG5uc227XKmcYDBD hdwU+dEr45X0Z/3fcPRMM1HsW5dBhQ0tznVWZYFu5KXlOxEgg0rhGWBwzULw9f0l8Fde 1tjQJc+jiTwxjEy5JUF1iBOqnUPrNq3mh8L/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697898; x=1728302698; 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=w+lDXyICIHcG+x83IY7Td9H+I+izyCveuIAoXyx8Crg=; b=Pj8J7EEX6MexlTfDrDG4Xkr2+e0yXKik2w8iYQqC5xjryt2VimhCkqdVXYAazmzULJ ZfkM/NQsUj2AxaVnR0FmUbyqbqkiN8elM5UZUvlfOv6PWvFo/MY0+g2MKsZKcPsNEx4h RIVvNpH9FAPY2AFVMCgPFU2MI+DGhckKvDz2sY1mmoSOCsRzPInttFNEYc4uJMm+mpze 0QQg4N/vMBOdmbRVPBi/AtIFen56HYeabRdQEKU3yg+Ws4Eysn03UFOxynaEWxbum8Xw UtwcMnyxPJcYZbtoBwStfpd8iR8cR2/U6gFvjnt78QXriXf2ZFMVYSkZQeRyqGH/B6mc A9Ew== X-Forwarded-Encrypted: i=1; AJvYcCWt2zFGKjtPKAK36eE88OaQTLNuH9OCuX70zYenf76TiJU+iatjnD5UVpTDVgRYa9ZslMs=@lists.linux.dev X-Gm-Message-State: AOJu0Yy6JnHYfzauLSzG4/q3M7Xso40Vcl7uGrO+lgsucY5NZqmZYx8d QHBv4Ip3lNIiLBPq/XWtBA2t31HKWmRqQYYyDwJCwf2Jubl9fry46BJhMmVQeg== X-Google-Smtp-Source: AGHT+IHpSAOikj0Pw9qUy/ufav5/H94vhYgLdOZ5ZWws6VuRg45Il/9rM3D70mqQT4nS8RcavrRJ/g== X-Received: by 2002:a05:6358:7254:b0:1b8:322e:3db with SMTP id e5c5f4694b2df-1becbc887d8mr566945055d.14.1727697898629; Mon, 30 Sep 2024 05:04:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:22 +0000 Subject: [PATCH 27/45] media: cec: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-27-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 The following cocci warnings are fixed: drivers/media/cec/usb/pulse8/pulse8-cec.c:698:2-9: opportunity for str_on_off(data [ 0 ]) drivers/media/cec/usb/pulse8/pulse8-cec.c:705:4-11: opportunity for str_on_off(data [ 0 ]) drivers/media/cec/platform/cec-gpio/cec-gpio.c:138:6-22: opportunity for str_high_low(cec -> hpd_is_high) drivers/media/cec/platform/cec-gpio/cec-gpio.c:141:6-21: opportunity for str_high_low(cec -> v5_is_high) Signed-off-by: Ricardo Ribalda --- drivers/media/cec/platform/cec-gpio/cec-gpio.c | 4 ++-- drivers/media/cec/usb/pulse8/pulse8-cec.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/cec-gpio/cec-gpio.c b/drivers/media/cec/platform/cec-gpio/cec-gpio.c index 98dacb0919b6..49160a15272b 100644 --- a/drivers/media/cec/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/cec/platform/cec-gpio/cec-gpio.c @@ -135,10 +135,10 @@ static void cec_gpio_status(struct cec_adapter *adap, struct seq_file *file) seq_printf(file, "using irq: %d\n", cec->cec_irq); if (cec->hpd_gpio) seq_printf(file, "hpd: %s\n", - cec->hpd_is_high ? "high" : "low"); + str_high_low(cec->hpd_is_high)); if (cec->v5_gpio) seq_printf(file, "5V: %s\n", - cec->v5_is_high ? "high" : "low"); + str_high_low(cec->v5_is_high)); } static int cec_gpio_read_hpd(struct cec_adapter *adap) diff --git a/drivers/media/cec/usb/pulse8/pulse8-cec.c b/drivers/media/cec/usb/pulse8/pulse8-cec.c index ba67587bd43e..0167f21cb116 100644 --- a/drivers/media/cec/usb/pulse8/pulse8-cec.c +++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c @@ -695,14 +695,14 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, return err; pulse8->autonomous = data[0]; dev_dbg(pulse8->dev, "Autonomous mode: %s", - data[0] ? "on" : "off"); + str_on_off(data[0])); if (pulse8->vers >= 10) { cmd[0] = MSGCODE_GET_AUTO_POWER_ON; err = pulse8_send_and_wait(pulse8, cmd, 1, cmd[0], 1); if (!err) dev_dbg(pulse8->dev, "Auto Power On: %s", - data[0] ? "on" : "off"); + str_on_off(data[0])); } cmd[0] = MSGCODE_GET_DEVICE_TYPE; From patchwork Mon Sep 30 12:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816019 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 C941A19C57D for ; Mon, 30 Sep 2024 12:05:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697903; cv=none; b=Py3fWNtvcQdgr8QV2oZoVL1xr3kFk83wvP0pZOEIYettpigjRzeDklbRNNzB9ofNR8IHOe2gWPZvlbNaTOZkL/cXVkq2xUDUs6/blUZuNU6q4Em1Jvc1RrBdF3bwk0ebn6owow/Ip344po+CFossIoDCsIGBQBYM37++EzG4ONU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697903; c=relaxed/simple; bh=eMOK5aR0wLanv4sEh7pDMzrsrhbN/JSAh3wt+zLwIY0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BpwOzD5XMdW31pnPxOHTxORr3t2qvlJEV2n7yXLJ8+dWTkMYVPNmJhMMLhr+Cnp7jWUat8Mft7Pwb7eCx081Ej15iajTylyKPDug7/F+26GsO1UffS1v/Sf/GSuiukQRPhjr8Fjac+YgZIDmkOgdS8cufCiF4uKrDOHP8ncVjJw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=XVLzGdQO; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XVLzGdQO" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-7a99fd0535bso372447985a.3 for ; Mon, 30 Sep 2024 05:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697900; x=1728302700; darn=lists.linux.dev; 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=ZtS18Z/ph+22OpFMjBj6PDOp8BDjMiQU1mRrp+tqPao=; b=XVLzGdQOP3cGAG36YoETPTTOadU55rKlfA42PLF5FyKJq6zybJsV+/tlr650J5abMD ggXvD8yhcPWTFsoMAWTQlZDNLj/BzAaTW1xIt2x8ePZnnJPt/h1HX9CTWIkVLzBoKs/J 6jm0/SKiKa9PR/i4QQmqIECYN/hxhkWx6lIR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697900; x=1728302700; 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=ZtS18Z/ph+22OpFMjBj6PDOp8BDjMiQU1mRrp+tqPao=; b=vPTm3kH2NEcu2nVAT5y0ZetbhHEctEp9r8DERkllmOdrrpXPkJ9I5OOylsoIwi2OAC BDM2bMP6AdW2Ddnb3+SLBPbopDq2tBT0vjiqMUMhyGv4wFRHnJjVxXUA3PMg44ykFszs iUtq+eIkEfzSeof2tkkqxSxOX8Dyq4P9Ib2eftPSLTeEVLYuVnjgG/UZMf+euSOV8Ct1 copNFNFSq8pjSITNKO/O1ytiej5bMQyEbrv36WvBlcdAUmd195ldIPOS90bDsCoDWxed 60HUdckI5MkANB0/hj16fHcvkjGVDx9h1O3QAMSt6Znlg2ANGHFGHqfBLCciuQCFcdz4 ZUjg== X-Forwarded-Encrypted: i=1; AJvYcCUg2WU60frWx+n6UVsckmKFfAweS1hWgPx2fGGpEZ6fVmUoLXlCxuskjkl7Izs2kaGbFZg=@lists.linux.dev X-Gm-Message-State: AOJu0Yy282E2yTxy63NocyO4oJZmR/Dck1eCUnGbtCzoblfqY/he3sFi UkuVZ02rmL9eHgi9AUyQdbR2jraVTfNvLp+nt3rqWP95nKNA4x+38n1vn2Nh8Q== X-Google-Smtp-Source: AGHT+IHa6kByUW3tXKJTo1om4uBb1NLh+sbjdquYal1McTRlR2Y5X69QcY3HAZ4VU5M0CeLNOC2NrA== X-Received: by 2002:a05:6214:448c:b0:6c4:6217:da9c with SMTP id 6a1803df08f44-6cb3b5da202mr213240066d6.17.1727697900493; Mon, 30 Sep 2024 05:05:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:04:59 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:23 +0000 Subject: [PATCH 28/45] media: b2c2: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-28-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 The following cocci warnings are fixed: drivers/media/common/b2c2/flexcop-hw-filter.c:119:20-25: opportunity for str_on_off(onoff) drivers/media/common/b2c2/flexcop-hw-filter.c:12:35-40: opportunity for str_on_off(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/common/b2c2/flexcop-hw-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c index c5a3345c99e9..d64a03452e22 100644 --- a/drivers/media/common/b2c2/flexcop-hw-filter.c +++ b/drivers/media/common/b2c2/flexcop-hw-filter.c @@ -9,7 +9,7 @@ static void flexcop_rcv_data_ctrl(struct flexcop_device *fc, int onoff) { flexcop_set_ibi_value(ctrl_208, Rcv_Data_sig, onoff); - deb_ts("rcv_data is now: '%s'\n", onoff ? "on" : "off"); + deb_ts("rcv_data is now: '%s'\n", str_on_off(onoff)); } void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) @@ -116,7 +116,7 @@ static void flexcop_pid_control(struct flexcop_device *fc, return; deb_ts("setting pid: %5d %04x at index %d '%s'\n", - pid, pid, index, onoff ? "on" : "off"); + pid, pid, index, str_on_off(onoff)); /* First 6 can be buggy - skip over them if option set */ if (fc->skip_6_hw_pid_filter) From patchwork Mon Sep 30 12:04:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816020 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 3103719CD1E for ; Mon, 30 Sep 2024 12:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697905; cv=none; b=JQtEBZbugLLLMBi1NhtRD7GyS1A87WIHBMtvYUlDC++JtZTs2d2HuuYXRcBXG1r/KeqveGgl0GhVPMomieg4YXpi5qi5QAThoPGc7+mdzAPEIgAdItjP+soBjHO18mXYyQgrxd/eIUI7xcqFb86F0U8RYP9yUitCk0kO8iqJyeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697905; c=relaxed/simple; bh=kKpr508Yau4A6DM1O58ZKid3P/LjCOEsyTEfHMo66Y0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l3ykNfk/60qSy0CAxCP3Q/LGQEzbBt/R0W0QnBpXQ8oFfeZJjCurzfRUD8jtB9ZuOnSzPHYKrOF3mLFmEMyXAlufUXGGfSow90EMwtKDIawojVsYyRfPs6BxSrEa4KmEpEeosWvwIgMk7OZMOrHwzA8C+WolzGEBOHog2Z3NG8w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=TSvigwrp; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TSvigwrp" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6cb2c5128d5so31325506d6.0 for ; Mon, 30 Sep 2024 05:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697903; x=1728302703; darn=lists.linux.dev; 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=pF9yJ7oppQKnmh5ZAzfDc5uXy0x2qr1GXsQ4Q40pH48=; b=TSvigwrpqd1u8WrKop4jjmZ8KPP77si5j49pYeB7R3dcbC7By1rBdZBYUlQh7iwvHx 5IRvxZl+V0kVValIhHAVWxAqPdz46J3Iczo0g7ZMDvNs0Pa8y908jHQOl4XwAE5a+K4K 3ANM0WmstbZ37nXkF/JSxZq1cxsjigsjxvRa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697903; x=1728302703; 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=pF9yJ7oppQKnmh5ZAzfDc5uXy0x2qr1GXsQ4Q40pH48=; b=IQQQCnxzA6Anq8DnscnDc5QSh3kZnkzKXPBjY0rSgVsNPdagC2+crfLTpnKzPerzaS Th3rYn5eFmXECUh4pCPv5PHU1tgaTiA2AxEuUya/690AmPgTyXuH9HQbLxXImWnlzi7t 390WVIrqXqH6vhzcDZF58fvPdNBmDQTG5KTHNRqiw8k1on8iLyYLz7qYkzclfFTi66y9 ZOTWIfPHV9D4cdCfVGhO+GRpqgPHOXUJ4Fv7ru+fqgcCg8aLbrW+kBn2grZdu9E/oYVt XWSl7hNkgXf8cZIS32koXaIXVOIHZxC4ztU470/JG1Xztu1f040JvnoS5XhGT6S3kSTO 7Hmg== X-Forwarded-Encrypted: i=1; AJvYcCVqz6v53dxC6+0d6Un8ZVKlKCWrAw8fk+BMcjmh4CDMQkJobEQbXEpor81ybC0gFhfu2sY=@lists.linux.dev X-Gm-Message-State: AOJu0YwUIHpjgdzcOh/TDlK8nUopQ74Gs/O74g/vHq/wzF6Lpbj/O7XO TdM3Qe+aY+Mv0Yx2uCDW/UcdszEnTejCJZITjtF3diuaOtpfsTmeacx0TgY07A== X-Google-Smtp-Source: AGHT+IEAFwwRA71MkCRUwImfi9uBIeNCYwuxiEwHafmSSDdtTJviDnVg18iocWAWeF5m9aVEXLwnZA== X-Received: by 2002:a05:6214:5a08:b0:6c5:b709:55c6 with SMTP id 6a1803df08f44-6cb3b63b3aamr219594876d6.42.1727697902571; Mon, 30 Sep 2024 05:05:02 -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.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:01 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:24 +0000 Subject: [PATCH 29/45] media: siano: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-29-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 The following cocci warning is fixed: drivers/media/common/siano/sms-cards.c:329:36-41: opportunity for str_enabled_disabled(onoff) Signed-off-by: Ricardo Ribalda --- drivers/media/common/siano/sms-cards.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c index d4a116ab6c88..e9aa95233ff1 100644 --- a/drivers/media/common/siano/sms-cards.c +++ b/drivers/media/common/siano/sms-cards.c @@ -8,6 +8,7 @@ #include "sms-cards.h" #include "smsir.h" #include +#include static struct sms_board sms_boards[] = { [SMS_BOARD_UNKNOWN] = { @@ -326,7 +327,7 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) int board_id = smscore_get_board_id(coredev); struct sms_board *board = sms_get_board(board_id); - pr_debug("%s: LNA %s\n", __func__, onoff ? "enabled" : "disabled"); + pr_debug("%s: LNA %s\n", __func__, str_enabled_disabled(onoff)); switch (board_id) { case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: From patchwork Mon Sep 30 12:04:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816021 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.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 CA86E19D08A for ; Mon, 30 Sep 2024 12:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697907; cv=none; b=PACi7MXZzXHjg3GfBVl3WZBV+OH73C9b6DECfaoqo4yyA+xjP0TaaUmyMnInqxoOcktPZtdSpSHLu2Nkj+ISWmJQX7rSaFi1HJiRpJKWC/cJ7xvhneuohAIwHstCKq7c1O3W63MyMOKj1rUK0q0JBrUXHNrNwe5IZfUUsTNjm0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697907; c=relaxed/simple; bh=87v9QUWrd9KJQVHdmwih7BqMWpDw/nyVGryHPM6oqVg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i5zVS+awwDYWWJIU3R+tDX8k8Gh0WK6lVo8SuDJMEss1fcrIwi2zYlYV3IM4nBsdQjxOrM9BwgcSLh4J5f64BzbpyJU2LxmBcNO4nkvx3VgqrfiNyGTFLhPefmv80EOOronwLcx4kpD/8AEXaU5eQJeZ0B9T7URE6ddrwQvUbH8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=YcrjuNJ3; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YcrjuNJ3" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6cb2f271043so47473036d6.0 for ; Mon, 30 Sep 2024 05:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697905; x=1728302705; darn=lists.linux.dev; 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=Ebt+1b/55aPXlqauBXJO18wSUl/XzTUjhH2wTMyzrFA=; b=YcrjuNJ3uag0To/ZCkz24RG24lFx0V4nRouhwJj2HzWAFdafnWvR800RmYiGTopH+n aI7mkec5beGXBQmFAySdQy+ZRwD4O/T+dPHxrb8GWyYabMdvWrcxDcAwods59uPFsbgm jJqlGctijQAE0hg4gmRRYsv5AkVccyZdeU0Dw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697905; x=1728302705; 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=Ebt+1b/55aPXlqauBXJO18wSUl/XzTUjhH2wTMyzrFA=; b=frPPrLZmmmT7ScU0Oxq/B6CwAqQMwnCXjOvzeGCtmf/diCnPBbqNW6zetUCk/UCifu Y4ZF0qw0yiRsuo2JUA/lrgIASPjSo30XHr2kD7h9QhfnrE+NWSxzTZNxDdgVH8l74knt jPtJfrGXnvTKDazr3iqL4/geNoZb/LEr7T0HiHxJbqq1kg1p75rtY+x/giZ90LADAxig LYETGSU+mr2Yl+9j81SSr6CDDh83ln5nyh5H5if4Oq2BTVbdJzB9NPMNZLUJ6scc3C7X 16Yzc9DufBxuK5VQrW9oJE6aDYbT48EVl+ssvsg3LU+ES/nG96IvdQEoinTMmrM2pmPL maYA== X-Forwarded-Encrypted: i=1; AJvYcCVGaj1qR8qFourPdM2U3+LTOpHJgKgPNoBy7O1F+wnso/yAMwO4VkNOGS8N+3jrtBLuV+c=@lists.linux.dev X-Gm-Message-State: AOJu0YySbNDb1Sk5w1Wiv0mTt9+Sylvq9IwtUp+WJ8Or3QPgkJGFoTwv Yj+LlWwjm7yaX+HjKjXFVL7NuNjosP0A+/5z944M2gULCxc4K7uWiC2zeTnsQA== X-Google-Smtp-Source: AGHT+IG7DxsLwmOc7mkRl/MFKW8HAXRHroSnhiAWX2HVxDFuz0PGg7dWtpjL7qcJseQqckH9Ha41Tg== X-Received: by 2002:a05:6214:448c:b0:6c1:8663:e8f0 with SMTP id 6a1803df08f44-6cb3b61465amr169180096d6.28.1727697904581; Mon, 30 Sep 2024 05:05:04 -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.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:04 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:25 +0000 Subject: [PATCH 30/45] media: i2c: cx25840: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-30-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 The following cocci warnings are fixed: drivers/media/i2c/cx25840/cx25840-ir.c:1089:4-9: opportunity for str_enabled_disabled(filtr) drivers/media/i2c/cx25840/cx25840-ir.c:1028:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_DMD) drivers/media/i2c/cx25840/cx25840-ir.c:1113:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_MOD) drivers/media/i2c/cx25840/cx25840-ir.c:1030:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_RFE) drivers/media/i2c/cx25840/cx25840-ir.c:1115:4-21: opportunity for str_enabled_disabled(cntrl & CNTRL_TFE) drivers/media/i2c/cx25840/cx25840-ir.c:1101:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_ROE) drivers/media/i2c/cx25840/cx25840-ir.c:1107:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RSE) drivers/media/i2c/cx25840/cx25840-ir.c:1097:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_RTE) drivers/media/i2c/cx25840/cx25840-ir.c:1135:4-21: opportunity for str_enabled_disabled(irqen & IRQEN_TSE) drivers/media/i2c/cx25840/cx25840-ir.c:1026:4-21: opportunity for str_yes_no(cntrl & CNTRL_RXE) drivers/media/i2c/cx25840/cx25840-ir.c:1111:4-21: opportunity for str_yes_no(cntrl & CNTRL_TXE) drivers/media/i2c/cx25840/cx25840-ir.c:1103:4-21: opportunity for str_yes_no(stats & STATS_RBY) drivers/media/i2c/cx25840/cx25840-ir.c:1099:4-21: opportunity for str_yes_no(stats & STATS_ROR) drivers/media/i2c/cx25840/cx25840-ir.c:1105:4-21: opportunity for str_yes_no(stats & STATS_RSR) drivers/media/i2c/cx25840/cx25840-ir.c:1095:4-21: opportunity for str_yes_no(stats & STATS_RTO) drivers/media/i2c/cx25840/cx25840-ir.c:1131:4-21: opportunity for str_yes_no(stats & STATS_TBY) drivers/media/i2c/cx25840/cx25840-ir.c:1133:4-21: opportunity for str_yes_no(stats & STATS_TSR) drivers/media/i2c/cx25840/cx25840-core.c:2369:2-8: opportunity for str_enable_disable(enable) drivers/media/i2c/cx25840/cx25840-core.c:2392:2-8: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/cx25840/cx25840-core.c | 4 ++-- drivers/media/i2c/cx25840/cx25840-ir.c | 34 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index a90a9e5705a0..dd8474609092 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c @@ -2366,7 +2366,7 @@ static int cx25840_s_audio_stream(struct v4l2_subdev *sd, int enable) return 0; v4l_dbg(1, cx25840_debug, client, "%s audio output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (enable) { v = cx25840_read(client, 0x115) | 0x80; @@ -2389,7 +2389,7 @@ static int cx25840_s_stream(struct v4l2_subdev *sd, int enable) u8 v; v4l_dbg(1, cx25840_debug, client, "%s video output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); /* * It's not clear what should be done for these devices. diff --git a/drivers/media/i2c/cx25840/cx25840-ir.c b/drivers/media/i2c/cx25840/cx25840-ir.c index 8cef9656c612..6f3978135178 100644 --- a/drivers/media/i2c/cx25840/cx25840-ir.c +++ b/drivers/media/i2c/cx25840/cx25840-ir.c @@ -1023,11 +1023,11 @@ int cx25840_ir_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "IR Receiver:\n"); v4l2_info(sd, "\tEnabled: %s\n", - cntrl & CNTRL_RXE ? "yes" : "no"); + str_yes_no(cntrl & CNTRL_RXE)); v4l2_info(sd, "\tDemodulation from a carrier: %s\n", - cntrl & CNTRL_DMD ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_DMD)); v4l2_info(sd, "\tFIFO: %s\n", - cntrl & CNTRL_RFE ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_RFE)); switch (cntrl & CNTRL_EDG) { case CNTRL_EDG_NONE: s = "disabled"; @@ -1086,33 +1086,33 @@ int cx25840_ir_log_status(struct v4l2_subdev *sd) pulse_width_count_to_us(FIFO_RXTX, rxclk), pulse_width_count_to_ns(FIFO_RXTX, rxclk)); v4l2_info(sd, "\tLow pass filter: %s\n", - filtr ? "enabled" : "disabled"); + str_enabled_disabled(filtr)); if (filtr) v4l2_info(sd, "\tMin acceptable pulse width (LPF): %u us, %u ns\n", lpf_count_to_us(filtr), lpf_count_to_ns(filtr)); v4l2_info(sd, "\tPulse width timer timed-out: %s\n", - stats & STATS_RTO ? "yes" : "no"); + str_yes_no(stats & STATS_RTO)); v4l2_info(sd, "\tPulse width timer time-out intr: %s\n", - irqen & IRQEN_RTE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_RTE)); v4l2_info(sd, "\tFIFO overrun: %s\n", - stats & STATS_ROR ? "yes" : "no"); + str_yes_no(stats & STATS_ROR)); v4l2_info(sd, "\tFIFO overrun interrupt: %s\n", - irqen & IRQEN_ROE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_ROE)); v4l2_info(sd, "\tBusy: %s\n", - stats & STATS_RBY ? "yes" : "no"); + str_yes_no(stats & STATS_RBY)); v4l2_info(sd, "\tFIFO service requested: %s\n", - stats & STATS_RSR ? "yes" : "no"); + str_yes_no(stats & STATS_RSR)); v4l2_info(sd, "\tFIFO service request interrupt: %s\n", - irqen & IRQEN_RSE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_RSE)); v4l2_info(sd, "IR Transmitter:\n"); v4l2_info(sd, "\tEnabled: %s\n", - cntrl & CNTRL_TXE ? "yes" : "no"); + str_yes_no(cntrl & CNTRL_TXE)); v4l2_info(sd, "\tModulation onto a carrier: %s\n", - cntrl & CNTRL_MOD ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_MOD)); v4l2_info(sd, "\tFIFO: %s\n", - cntrl & CNTRL_TFE ? "enabled" : "disabled"); + str_enabled_disabled(cntrl & CNTRL_TFE)); v4l2_info(sd, "\tFIFO interrupt watermark: %s\n", cntrl & CNTRL_TIC ? "not empty" : "half full or less"); v4l2_info(sd, "\tCarrier polarity: %s\n", @@ -1128,11 +1128,11 @@ int cx25840_ir_log_status(struct v4l2_subdev *sd) pulse_width_count_to_us(FIFO_RXTX, txclk), pulse_width_count_to_ns(FIFO_RXTX, txclk)); v4l2_info(sd, "\tBusy: %s\n", - stats & STATS_TBY ? "yes" : "no"); + str_yes_no(stats & STATS_TBY)); v4l2_info(sd, "\tFIFO service requested: %s\n", - stats & STATS_TSR ? "yes" : "no"); + str_yes_no(stats & STATS_TSR)); v4l2_info(sd, "\tFIFO service request interrupt: %s\n", - irqen & IRQEN_TSE ? "enabled" : "disabled"); + str_enabled_disabled(irqen & IRQEN_TSE)); return 0; } From patchwork Mon Sep 30 12:04:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816022 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 54E3F19D8AC for ; Mon, 30 Sep 2024 12:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697909; cv=none; b=NI0wbzY8zV/BpIssW7y/xv/I7K7wStQ0gYZNSY92cuNfweSO57rZ7WfF+YTO9+e/Cm7Ryio5kF1qI66xrkUVsOdDd1CGJLJI6pjYd0ZA1xkp+SIHYPEYfnie5MXChTK18OS3kOhDSdaHqzTgnoujknFM74a7cAnw/avNeAz34WA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697909; c=relaxed/simple; bh=4z/LssQ02GJNR8bA1yxT0qSzeZ6+9fo+8Pg8B3PGX2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=depQl1leJUM2S1XBG7Wk0hi0NNDlg9KSSZOUvmIzdlKXe+MHs1lm+4paX5E+NmSxo+xLhO8uMv4q33g7pXzEFblXMrYZMJNddnYxtnikQf9JbCNjkFU30KV/uz2DAz/3gviw81RuEIXWQwjHXLiP8qU30+k7uoay3oiBwcqcm5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Oamac5fh; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Oamac5fh" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6cb2e136da3so29189746d6.1 for ; Mon, 30 Sep 2024 05:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697907; x=1728302707; darn=lists.linux.dev; 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=yeZpI3Ra5CG7IMhE/CKrUPUz5revSFC/2gaO36DfqMw=; b=Oamac5fhOb8o0MSSeG49lQ8abYntP8QHiTR3Wiu2Yct9inkzHqxnbzCojw1epHGdYG r+sadzeG+cO4aCs+sLEqZz/ttHVsGctppcTY13ji1mJKPW/RszqMAzjRyPlRi+qm8Shu DOEAbfU5uzn6IhWJh2CrfWjgTu2RHwn1m1mZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697907; x=1728302707; 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=yeZpI3Ra5CG7IMhE/CKrUPUz5revSFC/2gaO36DfqMw=; b=MP0z0ieosGi/Nu2u5vz+afhIPhWOKJyUrJiYBg+lxP/lyQYxLjeIK9KmqALCmcRa9w rEmkO7Qj3UbC/V5LjolTFV/KdFYc0dWdJ1VWbNrEXHmWPAsRYKY8tD3yeUjRneYVEahe lCBwNHHRjojE4B6c0FV4Qs7gwwOCkFHm3XdDaSms8LJejvl0AQomf6T1+dzlzIzSxU1L 3JUk7Ofiehwh0JvzUUSepc8mxPDHq8vJa4U5m3Kj6QaDd14ngCG35/jlZbeoL1M5LvHi dvveXjc2MOaMmgtv4uFyBsF1pUaRlIrQY9z2OTagmdxM4kcMlaHhJZ1gJCz0kjUeoqf1 Ff4w== X-Forwarded-Encrypted: i=1; AJvYcCUijzLNYVPOeV9pXxUPmBGdkNHlug4c0evT/s0BDtuHtRn8Up2UUjndspLK77roOVl3H1I=@lists.linux.dev X-Gm-Message-State: AOJu0Yws2X8P3WbAACzXpweXTWImjGWjxZsC5WuazFNARd5L0URnsoLi hlXuaMFgBbWP0Hbz7A0OaKK+2ZjvEfsbvwjFN0XCyAlLHwFsRWpRyq/4aynklw== X-Google-Smtp-Source: AGHT+IFyOtAPK8xGQ/QMRxJMYu6WDsr9USOQ8VSoGNgApI/9s4N+ulaKyT/ysJasxumVieqsjFFOrQ== X-Received: by 2002:a05:6214:3f84:b0:6cb:455e:da5 with SMTP id 6a1803df08f44-6cb455e0e83mr174779006d6.45.1727697907195; Mon, 30 Sep 2024 05:05:07 -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.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:06 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:26 +0000 Subject: [PATCH 31/45] media: i2c: vpx3220: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-31-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 The following cocci warning is fixed: drivers/media/i2c/vpx3220.c:404:41-47: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/vpx3220.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/vpx3220.c b/drivers/media/i2c/vpx3220.c index 5f1a22284168..c5b031dd59e7 100644 --- a/drivers/media/i2c/vpx3220.c +++ b/drivers/media/i2c/vpx3220.c @@ -401,7 +401,7 @@ static int vpx3220_s_routing(struct v4l2_subdev *sd, static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable) { - v4l2_dbg(1, debug, sd, "s_stream %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "s_stream %s\n", str_on_off(enable)); vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00)); return 0; From patchwork Mon Sep 30 12:04:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816023 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 4B5E819D88B for ; Mon, 30 Sep 2024 12:05:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697910; cv=none; b=XeswdCi4bEeOZ9kIhFFtIYsL8FT9JxWCWpQ6vbPB9R5nAFYkA4zBXmH3+15o1mzSsYnjG4TMcNxAQN/Ngz1xs1ELHpcVu6IG0v4bgn3bw+uNLP2VyJ/lTKgLSEr5MjxH2m/guKPlvZtYzxPzz3ZoOAQK1qM37ljGJfYXvLp3PQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697910; c=relaxed/simple; bh=uih8QEqTTkP4DXsgDAU2UHGmO9M1hExX6/d1paS6Nuw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qKPBvvkVlUEer7JvRoFt7jKXbNPCSywt7R4kCvFkdcoopMPK2P3eeWdq0r8h4bl7jY/Oh0/wWVJZWRy5varK5W0ifnnC3CW1oaFL+XIxiUQcKWqpg7n0OGYuEYiMJcPqU3HAGxYKVZEc13lZLyLg+tDJrL8qAtlLUGEvZ9gwK38= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gWo+ANUE; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gWo+ANUE" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6cb2dffcdbbso37873816d6.1 for ; Mon, 30 Sep 2024 05:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697908; x=1728302708; darn=lists.linux.dev; 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=tASyZsxMamepS+/aqpGaV+hKbka/53sBNF0loAvAB9A=; b=gWo+ANUEiHHQkfwCoEaMiBC2JoZAJ9CNqf8wuQYp6zt9MhVKuJXObyVTgVb8J5oTea 6zhPnjAbnjQLksAhuhS72LgAZR9ScerNlE2KlYXRj/qW7EadbyOr9L4OMOkBFgI7sCBV Cq7/lBL/32lKCNBI3aDiiQu/1OJgewwWJO1Ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697908; x=1728302708; 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=tASyZsxMamepS+/aqpGaV+hKbka/53sBNF0loAvAB9A=; b=NUUL0EZ2eIsFINrY26HxEJWCUWxpdYZ7Xnt/2By2AitfABf7+DcZTZ+DvorLBUNqQv emCT7XOrRmvUUphag5XrENQ1bVO4fuSaaB0+jZjhV0oWv1O+UosCuSYVKlkVMyzs9wPE bYXg/n0e1JoWWhUyEkk5rf6R1+nnp42l4jNG7I1vFNEh4mnLvhmU6JgXhUUn+ayCZLJp 3sHcKo8JHbxY+C7jWZc4faan6SZXvM97M9/Qzbil+7GqDvj1D4iW6Fs1otQtfPv+0XUi /XAIEW2uozwu9NW3uk2+hfAegh9y+EGT6odVROJ4WAxNeCKJbrA+ROLVcXKZGH6NJBQD uGYA== X-Forwarded-Encrypted: i=1; AJvYcCVBw/mJ6WUs05LplsDRRVH5Xgy90YuE5HQuWbK0hd1snBdGm319IPsP5b56MIULQJcpAWA=@lists.linux.dev X-Gm-Message-State: AOJu0YxUcmhdlNL9LBc+mvqpzOlmXoUQPqTeIj/7gurvssJgFLeFfrPi J8vLKBCm0Bwd0rQRBEWL8sL3ITVewNPusqPBbwTsIiQjx7SmN1X4Z5yNXukH2A== X-Google-Smtp-Source: AGHT+IFjm/EtrgyOgYzJ6FCtv8A70AwY6h/u/nfabbLzk2VgNMjTcGoqCqNUVQwkIEHXuuvTS3xGsw== X-Received: by 2002:a05:6214:4881:b0:6c7:c645:df60 with SMTP id 6a1803df08f44-6cb3b686f6cmr211008966d6.41.1727697908426; Mon, 30 Sep 2024 05:05:08 -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.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:08 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:27 +0000 Subject: [PATCH 32/45] media: i2c: tvp7002: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-32-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 The following cocci warning is fixed: drivers/media/i2c/tvp7002.c:775:5-22: opportunity for str_yes_no(device -> streaming) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tvp7002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index c09a5bd71fd0..2acf93a90c34 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -772,7 +772,7 @@ static int tvp7002_log_status(struct v4l2_subdev *sd) bt->width, bt->height); } v4l2_info(sd, "Streaming enabled: %s\n", - device->streaming ? "yes" : "no"); + str_yes_no(device->streaming)); /* Print the current value of the gain control */ v4l2_ctrl_handler_log_status(&device->hdl, sd->name); From patchwork Mon Sep 30 12:04:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816024 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.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 3DED419E7C7 for ; Mon, 30 Sep 2024 12:05:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697913; cv=none; b=WFTM9Zh+iJaw+hCpqbBQ2flEkFIXS63iHtUU0sW1bklI/N5ib/x0mFMzrumYwm/z+zM6XqiuAeTuhkETuxaGrodCHIRs9jGzbV4ADWlMJQAUXWKmuQCac+WwZTjhtlhL4q5YZwRJQsiJGhZJEKw895DLEdWIY/yKqcIRY6FEnYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697913; c=relaxed/simple; bh=e8rYUX5LldEEYF8NKNEpIaRx2U0eGPd3BaBieyMSmPw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fUBCWDZHCUn3B2oVcEK99nB7wTfYCEEyaWsiuxt6VQ9ICJ3pDQ+L/RwKxIkef72bWkLuEqKejQLT9k6Ai+wGQMCcXeu5wEI9mvgMtxe3AX/KBA4378oA006Ks7Oftmw5BEmO0yTUCFqW5D38dRfgNSBcjuXc26wBrlRjCLkL1jU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=NdjQuLOU; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NdjQuLOU" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6cb4f1137a8so13033256d6.2 for ; Mon, 30 Sep 2024 05:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697911; x=1728302711; darn=lists.linux.dev; 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=D8e26HE+3E35YBzu5RrV0IHIpztUFBPs/lzx1XUAlbA=; b=NdjQuLOU7NQzb6CUeHtscaQyo3tl43/MQrtLe1MF2aF5DUQpI2qN5fw9GXf3S72eWd BNXn848ZNuNZLV2wzBCz90p6jO+EEjJC6STQN3Ge67g122WPSzjGbkqa6sb6sHVv/6B2 9tTbko7BKGTwIYmLQwtpIv3Y0NGVtRLD37tlw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697911; x=1728302711; 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=D8e26HE+3E35YBzu5RrV0IHIpztUFBPs/lzx1XUAlbA=; b=PIPH/Vpsqc7PI7+yVrbNxP5RRylJBTHDY9PftOgoA5/wl3eX0Mebq//5e0rIZV7+SM LP1q5iL2GbH5E384BXL7r/Xm4R6DxeV2TOjMGvr/uqMU0pecW+CJszGZl5umKtad3+FW dYHIijpJW1OthUrBllqJxD5SpiaFNlAZ0KTT3T+gSV1AnwJZQVgH7+UpcDzDE/nP6jMv KJQxCO1gebK/9TRcClmWWnAgV02RMN2lwDs1M9X+ABhMhe2ObrxYWqbpsXRbmnQnDhhi Kw7pMnII9TG+p86Jz/muykVSeFwpMPbKr/BiVrYlGgJ9xk8eyAF0LWVJngq7AHjcoyg0 TWeA== X-Forwarded-Encrypted: i=1; AJvYcCV7qKTmXZWMorXHh0Bdfe7VHsnb8llUPXC8qL5eG98OG1hb/zn9g7nXZ/JUJbWwdBFXCIU=@lists.linux.dev X-Gm-Message-State: AOJu0Yxt4W7kA8l9YZHKcff768l4MGmBu4mKCNj17QV9JJtVoK8xm2rN b4LD8qnON6iN62HrPz0TU26Jb1GNgzaxGkrfDPhuzo/t5MksN6rzlGSzrkcAyQ== X-Google-Smtp-Source: AGHT+IEpi/h9qBTzENrO9vK1BVrLpd+v0VWjCMyXcKhCb+KBXNEG/xGQiqpkb/xdSgfcL4ga0CqsLg== X-Received: by 2002:a05:6214:2dc4:b0:6c5:5f04:3665 with SMTP id 6a1803df08f44-6cb3b6618e5mr175354206d6.48.1727697910946; Mon, 30 Sep 2024 05:05:10 -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.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:09 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:28 +0000 Subject: [PATCH 33/45] media: i2c: ths8200: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-33-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 The following cocci warnings are fixed: drivers/media/i2c/ths8200.c:133:4-19: opportunity for str_enabled_disabled(( reg_03 & 0x20 )) drivers/media/i2c/ths8200.c:149:52-54: opportunity for str_on_off(on) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/ths8200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index 686f10641c7a..a6d2fb64f563 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c @@ -130,7 +130,7 @@ static int ths8200_log_status(struct v4l2_subdev *sd) 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, "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 +146,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; From patchwork Mon Sep 30 12:04:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816025 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.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 F388619E7EB for ; Mon, 30 Sep 2024 12:05:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697914; cv=none; b=HcepGv9MC9kkFgsXv4l4RaPyXmcuKTd/ZsVL8Iua+FYupasMwvAxDBxYl8OyvLYPMwWtz+JojpZwPkIc7mbisPpdHNih2sHYzpLh4jNGgUCguumoZtb+Q0AjvbgGxRHJB7puG4Ab9ozAJsXv3FUgtdZqyefCvkMC/XJE8PfHmLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697914; c=relaxed/simple; bh=+YlokRj+2d48flI/asuiz7UPyCUXWUPJX4RPdyyncNc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TqZ3JEcB0aCI1nfPfz0/8wQ8Ug6lrKT8DQ+YFR0RtuLXIi5kXWJ3lajbjC3Wem/Dds8XZ9X1MwWKWJNZuOvaiHVK3uVVTI4iGB4q1crS1ktqftFv6tsmHnSXecVqeWdw7RRxN1U29i/jIJ82eres2Cb4gGssxgZsKUfAJvoi5O8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cqMEhTa4; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cqMEhTa4" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6cb3ba0a9a2so24004276d6.2 for ; Mon, 30 Sep 2024 05:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697912; x=1728302712; darn=lists.linux.dev; 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=3Y9A3WlXYOmIt22yAkVtKfWzTv1HcbDXEuxLhuXF1BM=; b=cqMEhTa4SQP65vJAauwkFLReBnSqczUYyVvFTrYMRR8EDs23VOx/tRSd/2Zl8XOb4f c2b61KJvjJmAA4/X5cHmJtHbe+qAUPYDSUHNWfzEPDgXmTvL75wBrsS7RO5F81Ew/ThT RrEtF98uDbxzLK7bF+WqpLqwz9XE2ZRF+Wi/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697912; x=1728302712; 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=3Y9A3WlXYOmIt22yAkVtKfWzTv1HcbDXEuxLhuXF1BM=; b=Smv5UQJPdb/vFjIk5Ayz9j6PO5qiGtWK0TMihnLz63GGxImPNUpRpEG+NuGGWIlNv8 bo9yEfxUaoyBaeKK+6Jq72/2QF61vt94V3+k+ExZSXdB7S6C7O3d1xBu63vA1/3/4JO0 byO/clzKBLkyj8u7YTcPVr/4BeVSsNdmeMWr2ZKbWE8nRiEs8+mrCh96tQXHzdmmFlG3 S6AX0LVyPNMgxAmpHR9f79HccjJmKSbyu6qfcozPzmZmFYaQQTtsao+ANY5AtpvK5t+w +dVNPhdFVg+1auY+/dgYjMoRaOzQJepqCEy8Vw1qnA6/HGX9QVldLw3WqCrfGZUBmrZv KQMA== X-Forwarded-Encrypted: i=1; AJvYcCW2QvGO2kI+nYwyga+AH8Tpeerip0Fi88W+viDrorHc3qWDeVMTvY5blAdRHQ1NKUllBOQ=@lists.linux.dev X-Gm-Message-State: AOJu0YyiKhEqQF4WxRhxlqgWygbWqWNe6zU9bcEfVk3lcO3aqMWnLSID 8U3ZaKc89mOe4M/ObojEfIVpKyeQlK6k4atqzjX4QYG8Yd48eBAxSaLbkbJRrA== X-Google-Smtp-Source: AGHT+IEeEfZlZQBmO8RZI8xNY8EgNRIjUt1ZXgq35BOYTCkW0tdPK9t40pOtA1wbfy30W9apcgwPGQ== X-Received: by 2002:a05:6214:4198:b0:6cb:6655:e02d with SMTP id 6a1803df08f44-6cb6655e354mr40552846d6.3.1727697912026; Mon, 30 Sep 2024 05:05:12 -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.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:11 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:29 +0000 Subject: [PATCH 34/45] media: i2c: tda1997x: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-34-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 The following cocci warnings are fixed: drivers/media/i2c/tda1997x.c:1976:4-29: opportunity for str_yes_no(tda1997x_detect_tx_5v ( sd )) drivers/media/i2c/tda1997x.c:1978:4-30: opportunity for str_yes_no(tda1997x_detect_tx_hpd ( sd )) drivers/media/i2c/tda1997x.c:1972:37-56: opportunity for str_yes_no(state -> edid . present) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tda1997x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3b7e5ff5b010..867c635fa37f 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -1969,13 +1969,13 @@ static int tda1997x_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----Chip status-----\n"); v4l2_info(sd, "Chip: %s N%d\n", state->info->name, state->chip_revision + 1); - v4l2_info(sd, "EDID Enabled: %s\n", state->edid.present ? "yes" : "no"); + v4l2_info(sd, "EDID Enabled: %s\n", str_yes_no(state->edid.present)); v4l2_info(sd, "-----Signal status-----\n"); v4l2_info(sd, "Cable detected (+5V power): %s\n", - tda1997x_detect_tx_5v(sd) ? "yes" : "no"); + str_yes_no(tda1997x_detect_tx_5v(sd))); v4l2_info(sd, "HPD detected: %s\n", - tda1997x_detect_tx_hpd(sd) ? "yes" : "no"); + str_yes_no(tda1997x_detect_tx_hpd(sd))); v4l2_info(sd, "-----Video Timings-----\n"); switch (tda1997x_detect_std(state, &timings)) { From patchwork Mon Sep 30 12:04:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816026 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 E0C7418F2D5 for ; Mon, 30 Sep 2024 12:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697918; cv=none; b=lC85mjFbRffcptziKhfDnxIa8r2tm/hpN/QnbXBJfadMC8MZKnL3w1YFOnwZrXBCGM7Ad/Jr0uLQTEG6qNuYINrhLASzuAqbyhVa4rcswTIhL6rfM9khp7OGGFCGdJGIecEzMsfjiYJhyi6r218svG2TgZY5mW+JN9x02O6XWN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697918; c=relaxed/simple; bh=3h1xLkczeXS4EF70Q4dOKgJowO9hqNEwbJIxu3+uvHM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jBG+U9WURJbSoVlFV8Y0tNeYY/FPkMIGoAtT7jOKYj9un6XWr7dZUd5j0YJgKNPqgsCpEuV/US/Z//E9FiFXPk6PO26hpUUeDqJ3lTo/uw8Ah7sOK0GSg925SkdtVFrPvm+3uV4Qn/gW3MqgFdDRa4DygpSiO8v3zoSY3posujE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fdjJbNAm; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fdjJbNAm" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6cb2e5d0104so32211456d6.3 for ; Mon, 30 Sep 2024 05:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697914; x=1728302714; darn=lists.linux.dev; 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=27WoLnk5gPTNJ0m2rtIWHwrzMjQJ4zxEXFjS8vXg2Uk=; b=fdjJbNAmOc7TAibTQhFmChev3S8Ozks843DlWt4jB0EDDGqTs4zDjBjYLwxuyl+i+p Ckh55Laz1Zp1DGJouGPtsZiVFLAf9flo8/8kMEqQcbDDw4MEx33dXq62xq01LrGf50pV oI+SUcr9SGmU78+uTCtDaSt4N4rXoHwIO37wM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697914; x=1728302714; 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=27WoLnk5gPTNJ0m2rtIWHwrzMjQJ4zxEXFjS8vXg2Uk=; b=dvXgc2QoIB6xlBZ6VES5bxoAam+dHxOXHImbSZu2eoeFpPAGoh7qOVtH4ep+919ghs obG2cVZ8hclipk20AiGEJrfcEpzF93hF698x746Hlzh3hJhy7VbIyc+Sxd0Na7/5h1X3 iS5ZAZxZ2MlyDu8i6b3wIKRhIRcvEuZ22cORrsB/p66q1A5y8fi3MXt/PcrWGwghGPHR AnXpSRJy5+jqPOEpTb74p2IqDe+3jcy1G8D20DKDtpR1g9nvIGt8Q0v5TaR6X/m/aah/ iskm5S2cKkd9H3TQck7dQSpJNWg/TWYtQ8d9OT8JVnvdMlf7aOat7u3KfI0BozObelUs HExw== X-Forwarded-Encrypted: i=1; AJvYcCWnbZWy2eujDTuCWDiHv7EzBOAgD8GHTmHqxtmS6sFLfuOkLlxNf1i4PhSQJDOoCmhMOjM=@lists.linux.dev X-Gm-Message-State: AOJu0Yzwf0tOqRFnTPQ66EQ7ScL9dfUNs/DgdXovP13bk6eb1uMO/Pjw ydCg/1mys1guV/4Pct2xAGINiyJ5mxFru9GTvENT47XyxaMht53C8B+Oxt1I5A== X-Google-Smtp-Source: AGHT+IEmtR/kCt9kuVkbj7/r3Fqa0DixhR1uM5cl6xJKRSOoPA3YSLhx2F2SjU4khmzc/KfhSVtoIQ== X-Received: by 2002:a05:6214:4a87:b0:6cb:6059:92a with SMTP id 6a1803df08f44-6cb60590d50mr62400906d6.10.1727697913781; Mon, 30 Sep 2024 05:05:13 -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.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:12 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:30 +0000 Subject: [PATCH 35/45] media: i2c: tc358743: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-35-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 The following cocci warnings are fixed: drivers/media/i2c/tc358743.c:370:46-52: opportunity for str_enable_disable(enable) drivers/media/i2c/tc358743.c:1325:32-63: opportunity for str_on_off(hdmi_sys_status & MASK_S_AVMUTE) drivers/media/i2c/tc358743.c:1264:35-54: opportunity for str_on_off(sysctl & MASK_SLEEP) drivers/media/i2c/tc358743.c:1187:14-19: opportunity for str_yes_no(tx_5v) drivers/media/i2c/tc358743.c:1266:3-33: opportunity for str_yes_no(hdmi_sys_status & MASK_S_DDC5V) drivers/media/i2c/tc358743.c:1319:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_HDCP) drivers/media/i2c/tc358743.c:1281:3-35: opportunity for str_yes_no(hdmi_sys_status & MASK_S_PHY_PLL) drivers/media/i2c/tc358743.c:1283:3-36: opportunity for str_yes_no(hdmi_sys_status & MASK_S_PHY_SCDT) drivers/media/i2c/tc358743.c:1279:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_SYNC) drivers/media/i2c/tc358743.c:1277:3-32: opportunity for str_yes_no(hdmi_sys_status & MASK_S_TMDS) drivers/media/i2c/tc358743.c:1274:3-37: opportunity for str_yes_no(( i2c_rd16 ( sd , CECEN ) & MASK_CECEN )) drivers/media/i2c/tc358743.c:1309:3-42: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_HLT )) drivers/media/i2c/tc358743.c:1306:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_RXACT )) drivers/media/i2c/tc358743.c:1303:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_TXACT )) drivers/media/i2c/tc358743.c:1300:3-44: opportunity for str_yes_no(( i2c_rd16 ( sd , CSI_STATUS ) & MASK_S_WSYNC )) drivers/media/i2c/tc358743.c:1268:3-50: opportunity for str_yes_no(( i2c_rd8 ( sd , EDID_MODE ) & MASK_EDID_MODE_E_DDC )) drivers/media/i2c/tc358743.c:1271:3-41: opportunity for str_yes_no(( i2c_rd8 ( sd , HPD_CTL ) & MASK_HPD_OUT0 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tc358743.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 65d58ddf0287..f2e1e55ae190 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -367,8 +367,8 @@ static void tc358743_delayed_work_enable_hotplug(struct work_struct *work) static void tc358743_set_hdmi_hdcp(struct v4l2_subdev *sd, bool enable) { - v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, enable ? - "enable" : "disable"); + v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, + str_enable_disable(enable)); if (enable) { i2c_wr8_and_or(sd, HDCP_REG3, ~KEY_RD_CMD, KEY_RD_CMD); @@ -1184,7 +1184,7 @@ static void tc358743_hdmi_sys_int_handler(struct v4l2_subdev *sd, bool *handled) bool tx_5v = tx_5v_power_present(sd); v4l2_dbg(1, debug, sd, "%s: Tx 5V power present: %s\n", - __func__, tx_5v ? "yes" : "no"); + __func__, str_yes_no(tx_5v)); if (tx_5v) { tc358743_enable_edid(sd); @@ -1261,26 +1261,24 @@ static int tc358743_log_status(struct v4l2_subdev *sd) !!(sysctl & MASK_CECRST), !!(sysctl & MASK_CTXRST), !!(sysctl & MASK_HDMIRST)); - v4l2_info(sd, "Sleep mode: %s\n", sysctl & MASK_SLEEP ? "on" : "off"); + v4l2_info(sd, "Sleep mode: %s\n", str_on_off(sysctl & MASK_SLEEP)); v4l2_info(sd, "Cable detected (+5V power): %s\n", - hdmi_sys_status & MASK_S_DDC5V ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_DDC5V)); v4l2_info(sd, "DDC lines enabled: %s\n", - (i2c_rd8(sd, EDID_MODE) & MASK_EDID_MODE_E_DDC) ? - "yes" : "no"); + str_yes_no(i2c_rd8(sd, EDID_MODE) & MASK_EDID_MODE_E_DDC)); v4l2_info(sd, "Hotplug enabled: %s\n", - (i2c_rd8(sd, HPD_CTL) & MASK_HPD_OUT0) ? - "yes" : "no"); + str_yes_no(i2c_rd8(sd, HPD_CTL) & MASK_HPD_OUT0)); v4l2_info(sd, "CEC enabled: %s\n", - (i2c_rd16(sd, CECEN) & MASK_CECEN) ? "yes" : "no"); + str_yes_no(i2c_rd16(sd, CECEN) & MASK_CECEN)); v4l2_info(sd, "-----Signal status-----\n"); v4l2_info(sd, "TMDS signal detected: %s\n", - hdmi_sys_status & MASK_S_TMDS ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_TMDS)); v4l2_info(sd, "Stable sync signal: %s\n", - hdmi_sys_status & MASK_S_SYNC ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_SYNC)); v4l2_info(sd, "PHY PLL locked: %s\n", - hdmi_sys_status & MASK_S_PHY_PLL ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_PHY_PLL)); v4l2_info(sd, "PHY DE detected: %s\n", - hdmi_sys_status & MASK_S_PHY_SCDT ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_PHY_SCDT)); if (tc358743_get_detected_timings(sd, &timings)) { v4l2_info(sd, "No video detected\n"); @@ -1297,17 +1295,13 @@ static int tc358743_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Lanes in use: %d\n", state->csi_lanes_in_use); v4l2_info(sd, "Waiting for particular sync signal: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_WSYNC) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_WSYNC)); v4l2_info(sd, "Transmit mode: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_TXACT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_TXACT)); v4l2_info(sd, "Receive mode: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_RXACT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_RXACT)); v4l2_info(sd, "Stopped: %s\n", - (i2c_rd16(sd, CSI_STATUS) & MASK_S_HLT) ? - "yes" : "no"); + str_yes_no(i2c_rd16(sd, CSI_STATUS) & MASK_S_HLT)); v4l2_info(sd, "Color space: %s\n", state->mbus_fmt_code == MEDIA_BUS_FMT_UYVY8_1X16 ? "YCbCr 422 16-bit" : @@ -1316,14 +1310,14 @@ static int tc358743_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----%s status-----\n", is_hdmi(sd) ? "HDMI" : "DVI-D"); v4l2_info(sd, "HDCP encrypted content: %s\n", - hdmi_sys_status & MASK_S_HDCP ? "yes" : "no"); + str_yes_no(hdmi_sys_status & MASK_S_HDCP)); v4l2_info(sd, "Input color space: %s %s range\n", input_color_space[(vi_status3 & MASK_S_V_COLOR) >> 1], (vi_status3 & MASK_LIMITED) ? "limited" : "full"); if (!is_hdmi(sd)) return 0; - v4l2_info(sd, "AV Mute: %s\n", hdmi_sys_status & MASK_S_AVMUTE ? "on" : - "off"); + v4l2_info(sd, "AV Mute: %s\n", + str_on_off(hdmi_sys_status & MASK_S_AVMUTE)); v4l2_info(sd, "Deep color mode: %d-bits per channel\n", deep_color_mode[(i2c_rd8(sd, VI_STATUS1) & MASK_S_DEEPCOLOR) >> 2]); From patchwork Mon Sep 30 12:04:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816027 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 AC0C319F41D for ; Mon, 30 Sep 2024 12:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697918; cv=none; b=NXB7rcUdpvFZHei2bzlIr1P2lC4Ipg4afScApmdYsi8DH1KGTReh2GzUCEDAKcB0qDj6YohRPdn9iNULs90Bx0J8KIRfAhYRmM6ySzDOzcodbzs/GxtmT3Vt4hkaPna7plV2XTFsVCg55f8imyNw/wTnLyagv01YBaWVgc2LSL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697918; c=relaxed/simple; bh=fxwhWvjSILXxCjv9CXZoVUVadgI45kHnpUpllcnsAAE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e9c4ABLdMsQ/FB//+uKqX4JZZ+5AaBqHTSUDpAnIy+QQ+9KJu68GCGzAHOeEQwNzileIF7ptwJrmzCyrRuzUxabsEIjSiYIGRZc5MmTtbJuYoOllHN2wM38bLS8yfFzHGmn+zH0qcqomgde8xJ4qDByhiKFb1O+MRzDPzkfHYwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=oIWQyhHD; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oIWQyhHD" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6cb2dffcdbbso37874826d6.1 for ; Mon, 30 Sep 2024 05:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697916; x=1728302716; darn=lists.linux.dev; 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=Y1nqJxv+kHTFXHSCWxO1NaLDK6vY0ti6KAFzNxfjGjU=; b=oIWQyhHDPCIG2Y7P9/ka7J/2ZU/gTxgvESM1JQq0e+vyLVjM5wzkYLfOBVWmZpGm1e FVjhnlR4P3o1B76zXpjg1vB76h5OB4V62PGcnvnmx7rmf3eqrMsg2WH6rKifab+4TQVZ ZnN6d4xqDHlR/SE2D/ultT5dWCivhAfpgHbKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697916; x=1728302716; 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=Y1nqJxv+kHTFXHSCWxO1NaLDK6vY0ti6KAFzNxfjGjU=; b=YLnKEeeTUrwzX5t1OZ4KFTtMoJbj+3ZC6RCc9BUwzxG6f3DfBQ+YZSrGmk+xoEPmb6 89xX8wBawp3v4UT0ju10hpJYm3LW7ziNXKI1Vw9fOFH3HMeAJ5doPxYPDunoD3Lxy96T MigQsD6WY4jMVuAuZ55yYGzUAgvADPF5OoFlo4wrBxLF1EY9T4H48E1mcg6RNjRWugGY m1gzPVFEpmU67fNyJ+wZlxsBX1knx9arPjUQm0iVmQC3quLPCYEmu9en38KiHopzRr0r Ow2lixmye7faiCAbhH89FL6nr2sDWOHXX0GmmxUw2HrohK5rrL1Hv3nGDliQw3BiH7Ic atNQ== X-Forwarded-Encrypted: i=1; AJvYcCU5SrwR+IYwepHoeFW0J7Hyfwk/gDqYUeJdmlXawUMRhFM001D9Oh0USvBRHRYUzxXtKvM=@lists.linux.dev X-Gm-Message-State: AOJu0Yz4w1frjj+sOON3WaDiz3Ozb9IwQb5qYN3Y+aPtqmM8nWQVq1MS ZX36Krvofbacft1xLfQNYnfrcU3iKX4QabvqNMTZJzao/Y6fCc4whkceTBcmLw== X-Google-Smtp-Source: AGHT+IFHqIZOoSZ0SNoSJp6T9EpjigAIsbvAUF0oGwPlw/LLEGHSlB7PElYqfizjzUxKI+v34TuK6Q== X-Received: by 2002:a05:6214:3c9a:b0:6c3:55f3:ed92 with SMTP id 6a1803df08f44-6cb3b5e7233mr204180416d6.2.1727697915550; Mon, 30 Sep 2024 05:05:15 -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.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:15 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:31 +0000 Subject: [PATCH 36/45] media: i2c: st-mipid02: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-36-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 The following cocci warning is fixed: drivers/media/i2c/st-mipid02.c:552:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/st-mipid02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index b947a55281f0..70a691504eed 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -549,7 +549,7 @@ static int mipid02_s_stream(struct v4l2_subdev *sd, int enable) mipid02_stream_disable(bridge); if (ret) dev_err(&client->dev, "failed to stream %s (%d)\n", - enable ? "enable" : "disable", ret); + str_enable_disable(enable), ret); return ret; } From patchwork Mon Sep 30 12:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816028 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 132D519F474 for ; Mon, 30 Sep 2024 12:05:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697919; cv=none; b=ufQsEQRpREzuN6pQqQ8GV8EGnnj83RaeZC+S/pNNBY5TJ3PGM+tLQ1JUtzpEmSs+wPVO3dAVbVYaCrm9n/jFsb6PN5Px7ADlWiV9DAqRWUD1XV6+fsGav7v3jbQnV1kTw0R7Whc1XzpwbiJ+7co0zt5EWz9Pwxo2cPZLGta+y4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697919; c=relaxed/simple; bh=seoZG/qn3lQcbBj3ynNAVC3sP37LRPVbxYubokeh8WE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MArP2BSCtlrP5NyXUUVp+6tJXwiN6130c8JYr5UlobsIPmTh2CeRx4Gtg1cRKE9MUwPFmdEKYeM/MZsVd9+1lWYwhLc8FootkmLOxg3pOKv6MiCfsLiAM1qqj0mIAN6Rhaf9KdaLe113MVMBaOs5MehU5G6DQChqr/sImrUD2GU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=NFA+SRb1; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NFA+SRb1" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-71100987d1cso2586438a34.2 for ; Mon, 30 Sep 2024 05:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697917; x=1728302717; darn=lists.linux.dev; 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=VS7D6fkzy/mB93t3oLBUPb5JuZ0mJyEpuRoOfQlLof8=; b=NFA+SRb1Q4n+OJBk6dHum66LGBvnSWSbkkxEn2FKMYK4WYXRljdi/MMguOxZS76qaN hUmbtlb/IvX2zm2OHaZ1ZHp3oVMADb+ac4ef8+WwlIpARsdhzywZt+0tvRKUTwpDxAmx SFGgJ5hKthcSEr3znC6WSZP6Tf8JIzaPSuWJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697917; x=1728302717; 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=VS7D6fkzy/mB93t3oLBUPb5JuZ0mJyEpuRoOfQlLof8=; b=Qbjg7n3am56SBBFzf3Wuz0GwU3r7Qkfsq56ZJibFGov304+AHlB65tQSyLDAFPn28/ ZId0H/GKob2C8MmoDy/acJ2rXywJswLrgpDgN8g9+ynbUXlidb5rZh5rxRVuoB9YY661 cv8G+rir1uNROmaZcMfOhAZIKvXhLYGXRh3EAzUBlJy4DByHwsyv4bTEshTxHl31dF0f ppPi3Bim+9xoZE1H9UC8AGE1DOx3FczfEb3MM4uHGW8ITlB0DFg/TsCwtnzIfat86R8o 5X5WvEuIgoEKyTmbXExTKpny3F+H6hrcNz/9lcKZafENxwZED2NmTYmVAekn4q68N3cN QFXQ== X-Forwarded-Encrypted: i=1; AJvYcCVVSVIbenj+U7MrygONIcvw0QuzlCeuVkCIkiEXNjD3DJEFfLEtyJUk4usjXdCVr9OuoJQ=@lists.linux.dev X-Gm-Message-State: AOJu0YxsWgs0ed7cB8wNSTp+feI/R9KjfhSZKiOJv7c/80vnKfLlxBBl a5mLq/i7A9ahGjJEU0dzG9dtCrUEdCoU1uw2hhcPjT12yblYsYGmuhK8o9I1SA== X-Google-Smtp-Source: AGHT+IEsGDncZXqIOKaIooO2hw5tICb0OJqubpFFkQiHlkBn39PImu6hgDgqbreQ/CasmuZpa2D32A== X-Received: by 2002:a05:6358:5288:b0:1ba:580e:dea2 with SMTP id e5c5f4694b2df-1becbc86414mr292235955d.17.1727697917163; Mon, 30 Sep 2024 05:05:17 -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.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:16 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:32 +0000 Subject: [PATCH 37/45] media: i2c: msp3400: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-37-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 The following cocci warnings are fixed: drivers/media/i2c/msp3400-driver.c:341:4-21: opportunity for str_on_off(state -> muted -> val) drivers/media/i2c/msp3400-driver.c:342:4-27: opportunity for str_yes_no(state -> scan_in_progress) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/msp3400-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 4c0b0ad68c08..c7807b17add9 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -338,8 +338,8 @@ static int msp_s_ctrl(struct v4l2_ctrl *ctrl) val = (val * 0x7f / 65535) << 8; dev_dbg_lvl(&client->dev, 1, msp_debug, "mute=%s scanning=%s volume=%d\n", - state->muted->val ? "on" : "off", - state->scan_in_progress ? "yes" : "no", + str_on_off(state->muted->val), + str_yes_no(state->scan_in_progress), state->volume->val); msp_write_dsp(client, 0x0000, val); From patchwork Mon Sep 30 12:04:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816029 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.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 3B40619F41C for ; Mon, 30 Sep 2024 12:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697920; cv=none; b=TeMmTZb76nMzh3VIICZjt4xJNukbJGo95v0Nl26W/fAbFOI6gxc107mfvRycrpq4CRjSd7VOlTj7oGAXHSpe0UbSqViCCtRShjsXfGDAVjRih2Bxbvfe5Mk5JroTa2B9sqmsF0HDCdt7TTBXIGdC37N4gzaqE5MSwRjDjvJ5/wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697920; c=relaxed/simple; bh=aBtuDT9YPo78PM4HWkajYyL24yWOJ9YEO0Dm4FdZ3Rg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XsOUiWwoJMHHN7UBgNR90uFBw1cGqA1XPtjeTmVHn1ye3LQxEhWOdvYdGrVQkrRPdKJ2fgxX/Zx6Hs00fa4t/Z09XexznLt5dhn2/865Q+IvmObugemvU586ZSjdYcG4N0/7wAxZIko7MqcXe0WeAvzxbkCYRdPBTPco2DQw708= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HVM3cgGE; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HVM3cgGE" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6cb2c5128d5so31327106d6.0 for ; Mon, 30 Sep 2024 05:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697918; x=1728302718; darn=lists.linux.dev; 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=HJx29BD9yZboyGEAUyw+4rBBbXZtXq331Q8okj0vBtk=; b=HVM3cgGEbftgIiZZTQni7Y5RfgA+E1VYUI7Y0N0i7O5+/ZLK1CauPuP5GJLFCw/EGp 64iCCtIP7CaMeyGnZWF0Oowrp6exTIGhk3Br40RQNIo4Ft/r8iKVplOLSp9jDClx4kEB bsK/gp5BiOohPw+6UiYzzBdAMNlU8aAkMLNwQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697918; x=1728302718; 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=HJx29BD9yZboyGEAUyw+4rBBbXZtXq331Q8okj0vBtk=; b=Zux6guIfHLQjnPXbeuXqKZsBVx6r2XBpbWUu6iY/7dG6IAHGXuXhei+rT24MwcJyOQ daSX7fYGqdg35wNM+uDdr3qroMabVUQ/wQ2zy+0VIQAhqY91DZxVXiMUfhC9FfQO7wlh Agmg6tkxk2Rtq3Jz40I3XYp3dzG/FIHFdnxtr19f6Q4hyjXKEhuRbNXBbHMgq/JWv0Zw Nly5MLhEj6PZKksvXEcDvKg2TWh4DDlogwrmITwEkOiCeMGqXJ72J4gGrbPisOwFryEQ YUxrEmYxnk0FlooNZaGsC9j3NzkA01X/wrSgZSWXYxUTRY2wlCoB8Yl2TIVYqm7sInUf Qz/g== X-Forwarded-Encrypted: i=1; AJvYcCVSMIfmJEIEujLvzfaC1Yd/UD7cIglq8auqsr4pLmmeMUCClVt6s2M0YDws93kns3n8rlY=@lists.linux.dev X-Gm-Message-State: AOJu0YwzA4LqCVqEMcYCPmR/liHOehcjpKoyZCfwQ5IEae7tGRcAYfm1 /j1c8WZ+ySJL4E24Fe7R9IS4HR+SODfsQMy59v00vdSa8vRwa/OSJFG0AqlAswNirIyYcdg5L3I = X-Google-Smtp-Source: AGHT+IHvBkaWPQbVKiD/u2iOrMRkK3daurGtkkhjknrAX1KIWB3cA5A9a8FHevVPAdBTGyigNIjY6g== X-Received: by 2002:a05:6214:3a88:b0:6cb:2e94:3e24 with SMTP id 6a1803df08f44-6cb3b5b7edcmr189314226d6.11.1727697918247; Mon, 30 Sep 2024 05:05:18 -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.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:17 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:33 +0000 Subject: [PATCH 38/45] media: i2c: max9286: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-38-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 The following cocci warnings are fixed: drivers/media/i2c/max9286.c:1333:3-9: opportunity for str_on_off(enable) drivers/media/i2c/saa7115.c:1366:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/max9286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 9fc4e130a273..d0f542343344 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -1330,7 +1330,7 @@ static int max9286_poc_enable(struct max9286_priv *priv, bool enable) if (ret < 0) dev_err(&priv->client->dev, "Unable to turn power %s\n", - enable ? "on" : "off"); + str_on_off(enable)); return ret; } From patchwork Mon Sep 30 12:04:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816031 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 691C21A01A9 for ; Mon, 30 Sep 2024 12:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697924; cv=none; b=Vt/53PcVBIbXIFYMAYE0wybjAh+zCU9iVQQnVZfryg8ZInRi/abzwt5+azHgxi1uoXr9Ncf2lVmmxGqQFuNwlHomEcY19iJA8VGL21IJDrmV+vVeIhzyuSN0Gap/Ofhfb0n5fFZT5ZUC/IR+56eW5bm5nN6gO4dbjIMVO3HrSQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697924; c=relaxed/simple; bh=TM9r2XK6KcBa1f8v3+Lblr8O3iR5BhJ1JBXQeHslSjE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aDolI01Vvp/7JV5AYXZWdpgnFbF2oDflB9TCdkGH5QHAhM+CQIzaVOpTYXuLzkJVXmwKAE+ZQ/VUiMTqmNP4/MYRLv0SQain6bmfCB3y+yuKZCC0cwKjyKt32WbBvW4gZ59UcWEe6Dd42WQgdf3TCovVpRngTQgsWvBFeuOsuys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hyuXTRb+; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hyuXTRb+" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6cb3cbc28deso36414916d6.3 for ; Mon, 30 Sep 2024 05:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697920; x=1728302720; darn=lists.linux.dev; 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=ckz+f9oQpPUu6rIcK1E7/sklc7IJmpymEtGmVuUIyqc=; b=hyuXTRb+xQ3NcHjL1qE1tZPk1pNWQHk8s06SVEGmGhq9wg29KwoX38gKChj/hFFuK8 Tjr6toyY2MYZnUAallYTOVcDEibKNjl25XuGLkqL52nOix2lfaORD1NdGKD1MVujdhI2 DlXaYjDSjs1gJYwQADiMAxIY81wcY5kpd25/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697920; x=1728302720; 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=ckz+f9oQpPUu6rIcK1E7/sklc7IJmpymEtGmVuUIyqc=; b=ae8EMVsvMcIFZJdmSA+Mds5f0ZTn7nGqKho+qZyR0VALznMCQts80RLFxscB8I4C6b UuXj6dhKlL96+UNZ8UIJ11l79HgH0XSBTsG2zc2hy/b+d6Ojj6pScBdMIQl6ePLcBte4 UojP43pfIUKMMbHjCSG4mP1n61hpQomCJwPPbLQxznfZUDHyxQeU9tmNLwUR3xYrLzG7 iTMCxePtrWV50nADseDdqdgR1BjssiZ92tqxbBh3SGnhcSBEXGDyYmpabuEVcTScJAfR 8QpxAbtVfAOmrYo9jZE6UNBuC3JcIY6bqaxD+5o6RNsiWa6MrcOqnRJPcvxGMTlI7/Um bBpQ== X-Forwarded-Encrypted: i=1; AJvYcCUe/9coqgKzrY1ufk7XwMPJzn0OKuGsvhsAe7d1XfnGkha84vGHfbHdlHy5/LKPSy1mIko=@lists.linux.dev X-Gm-Message-State: AOJu0YySuXHSNhou1utkXdYno7F2jP04KPwr+M/jVijnZkIR8f1Loxcc yFK0bwjc6oaZhra6PQwTLfwwPxFYiziEUtdHAB1nd/Qw054ZlD15ENEStsfM3w== X-Google-Smtp-Source: AGHT+IEi2P8ci2OPbo+jpkaZ22WOo6DK57pM4gbAU29+4tgFAAJdQKDCxefcZ9fdV8Kube5E0H3gmQ== X-Received: by 2002:a05:6214:3a8c:b0:6c3:5c75:d2bc with SMTP id 6a1803df08f44-6cb3b66fab3mr198718286d6.47.1727697920467; Mon, 30 Sep 2024 05:05:20 -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.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:19 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:34 +0000 Subject: [PATCH 39/45] media: i2c: saa717x: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-39-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 The following cocci warning is fixed: drivers/media/i2c/saa717x.c:1091:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa717x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c index b0793bb0c02a..2337cef45e3a 100644 --- a/drivers/media/i2c/saa717x.c +++ b/drivers/media/i2c/saa717x.c @@ -1088,7 +1088,7 @@ static int saa717x_s_stream(struct v4l2_subdev *sd, int enable) struct saa717x_state *decoder = to_state(sd); v4l2_dbg(1, debug, sd, "decoder %s output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); decoder->enable = enable; saa717x_write(sd, 0x193, enable ? 0xa6 : 0x26); return 0; From patchwork Mon Sep 30 12:04:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816030 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 A1A841A01DF for ; Mon, 30 Sep 2024 12:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697924; cv=none; b=FkNXRkGRxZd3OAxPijXlXwtHl1vcR0SIQ6OA/LDMz9+0mj5nPTZAH+xJiuygUGxo4xYfLA/oRw1kbO3yWAwbcyoOL/Gaj2GBP+nKEemSkDsfAAbWc8l0g8E9zRy0pvf8rKhBCGMjf3N1w9oug4l4OD0upYXKuWhqcRtq8RYloAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697924; c=relaxed/simple; bh=r/6qUwtilPc6aiGRZZVb8lZs3Le7IbP8kJgI2X5FyiM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l5f2wIKDf4ZuN84Uc3cQV02PK80SllKBNnp5fMNXLtviuX8rn/mhof0QZsvhxBwtddl+QSKR2H9ffl0TXe0RP0lUwvrsSwkp2UU9ozCCC4mC4BRfa3wxUn9FXSMkpxuVxLQoo/nf4v9NlqfAjREhX5jFZ+zr2J8DTyzuEPujhY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=PiaUP7B/; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PiaUP7B/" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6cb2dffcdbbso37875566d6.1 for ; Mon, 30 Sep 2024 05:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697921; x=1728302721; darn=lists.linux.dev; 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=JU7U+YsXwNUN3GXi+lZlabPGhAkg1lZuiKZFCmpVa4Q=; b=PiaUP7B/WD80DPEFcMFLdPYamaOQfsZKZ4nVxDh1CPY3ME5iq4NAZZOfjJ5x4M3onE cTv5ymS2w6DZpQFKGgnJcp+hxCJ7fRQmkrb5iw4hVC6ZGBV3xly7ks8PsGdY+E1Lu4XC R2wesu/rcmOUnC/HyFDaOb+/BIcArIDij4ssM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697921; x=1728302721; 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=JU7U+YsXwNUN3GXi+lZlabPGhAkg1lZuiKZFCmpVa4Q=; b=BDeJS7Aoe4LpoHLIsxDXz1V0dTTSMmLc0m9D66hgAjQmgIs7XUxVEDH2vFOv4A1vIH NQO/UtKAIEcx6TkK1tPA9UE6TChHhLbD44Lr0LeBOi5Bg4pmHraEshAjpd5UqYhyLO+t PwlWKQy0XX/85fStCNCD/gXUlDL4H8UBF/ckI5TWIEtmgHX18Zpat4kU30dG/JJQ5w73 2ARXOddO9R3Ej6lPjgGF9VpIww2rjGI5qjx/uyHlmyvjbjtBxOTNENUSHktAOBwKO8wW dHdzPZ/+0BlfWkK6e2vmbd03DGyF7ex2enJkBdZ8EopVvSfr0m3ejkM8v+DOJ2WKfHKZ Zu1A== X-Forwarded-Encrypted: i=1; AJvYcCVklPpCTgMAu7ldKvy0wCNnXlzcTTscnZ9nZtDQwELHWu62mtJ9yjfV1FP1XxsZdTWnreM=@lists.linux.dev X-Gm-Message-State: AOJu0Yy/BG5kQ342OztTrHQPW/i70FEfX2v+oHMcYMSkv2Qx8ImYe29e QzItpuaxiplQJ2tqSlh1c3a3WjoPvnRKGzoNtmzzO0FkX/GF6oT4r1xpPriRXA== X-Google-Smtp-Source: AGHT+IFo7OOUc+eOD+KctwzfWQcOtVnWKBIl/eyXC/k7ALK2/LWIOZekEy/aM6hhFvO+98exx2mm7Q== X-Received: by 2002:a05:6214:310a:b0:6cb:52c9:b91e with SMTP id 6a1803df08f44-6cb52c9bbcbmr87563466d6.35.1727697921599; Mon, 30 Sep 2024 05:05:21 -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.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:21 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:35 +0000 Subject: [PATCH 40/45] media: i2c: saa7127: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-40-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 The following cocci warnings are fixed: drivers/media/i2c/saa7127.c:678:33-49: opportunity for str_enabled_disabled(state -> cc_enable) drivers/media/i2c/saa7127.c:677:33-50: opportunity for str_enabled_disabled(state -> vps_enable) drivers/media/i2c/saa7127.c:379:19-25: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:346:49-55: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:430:42-48: opportunity for str_on_off(enable) drivers/media/i2c/saa7127.c:405:42-48: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7127.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c index 818ed19cf37b..1ea5e4b9019d 100644 --- a/drivers/media/i2c/saa7127.c +++ b/drivers/media/i2c/saa7127.c @@ -343,7 +343,8 @@ static int saa7127_set_vps(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 0 || data->line != 16)) return -EINVAL; if (state->vps_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", + str_on_off(enable)); saa7127_write(sd, 0x54, enable << 7); state->vps_enable = enable; } @@ -376,7 +377,7 @@ static int saa7127_set_cc(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_d return -EINVAL; if (state->cc_enable != enable) { v4l2_dbg(1, debug, sd, - "Turn CC %s\n", enable ? "on" : "off"); + "Turn CC %s\n", str_on_off(enable)); saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION, (state->xds_enable << 7) | (enable << 6) | 0x11); state->cc_enable = enable; @@ -402,7 +403,7 @@ static int saa7127_set_xds(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 1 || data->line != 21)) return -EINVAL; if (state->xds_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn XDS %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn XDS %s\n", str_on_off(enable)); saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION, (enable << 7) | (state->cc_enable << 6) | 0x11); state->xds_enable = enable; @@ -427,7 +428,7 @@ static int saa7127_set_wss(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_ if (enable && (data->field != 0 || data->line != 23)) return -EINVAL; if (state->wss_enable != enable) { - v4l2_dbg(1, debug, sd, "Turn WSS %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "Turn WSS %s\n", str_on_off(enable)); saa7127_write(sd, 0x27, enable << 7); state->wss_enable = enable; } @@ -674,8 +675,10 @@ static int saa7127_log_status(struct v4l2_subdev *sd) output_strs[state->output_type] : "disabled"); v4l2_info(sd, "WSS: %s\n", state->wss_enable ? wss_strs[state->wss_mode] : "disabled"); - v4l2_info(sd, "VPS: %s\n", state->vps_enable ? "enabled" : "disabled"); - v4l2_info(sd, "CC: %s\n", state->cc_enable ? "enabled" : "disabled"); + v4l2_info(sd, "VPS: %s\n", + str_enabled_disabled(state->vps_enable)); + v4l2_info(sd, "CC: %s\n", + str_enabled_disabled(state->cc_enable)); return 0; } From patchwork Mon Sep 30 12:04:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816032 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (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 6EE221A01DF for ; Mon, 30 Sep 2024 12:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697927; cv=none; b=Ojdv/izLav2qS9H75nyYkHTGOK4klObA5hI2J/jcezJ+vVP0Cu7mrF7Gl/ZrpE4ylQEdfl2fBoGgJD1HewMmx0qmRi/FWD9NGh3ZtDT37QNTbHhyxtWxh5ww2soKWv0q5eS3IChGFXTfapdMpCopKuUSWixMJD2jjdjtsGoBRVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697927; c=relaxed/simple; bh=5Rdjy71hTF6/9CoiFrdLRSPgDrn5yL3rP0qGkbkrLQk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DzQKdeaG6c5/HaCmaID0Jjj/yjB4n5PrqcwYYqrcwBWYXAUTi+PI+3xArZts6AO4xw3bbZiH7O3S4VFaWdKkczVRBXWiE0iyDHJkbfP/ZqAoS9r9a6+sblynTYHYgJYjaHnmJkaEF8ETljcwNg8cVO7Dc5oPx/mBUkbpOrQNPR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bJoxXy7A; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bJoxXy7A" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-5e5568f1baaso2414683eaf.2 for ; Mon, 30 Sep 2024 05:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697923; x=1728302723; darn=lists.linux.dev; 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=dipHc0aYdmEBdS77HCaW8bxKOJhKMvnfR/ECPy5ogKA=; b=bJoxXy7AGJVIPlXCfUQJ3uFuQaksPy6w3Ywp7hu2jM2KdOzUlTC+iW1qj1vOT4Ie7m OS+PEqSL/mZnKiqINCrclBgbRReCpmpnB1yToZ/ckXhEauP6qFM3QWsKPdEfNmROOb4W FcQoL/4rn+31O0Si6iKRAJyrj9NyyVjRQhss0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697923; x=1728302723; 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=dipHc0aYdmEBdS77HCaW8bxKOJhKMvnfR/ECPy5ogKA=; b=c0xGpgEWTG7VOvLzWKqX1q1mxgBCYhyBu19+EVhxNYn1Fl+q6/J92FHckDCsFnkCTg fDEe/PfGwwPD0uJNww6A+Io1Y1pj9Bej1uCG+KSQsxI/QqsDmNL5OisbjNGqroE3ZlxP Pqb+queazuKTcbAwRUcivYYrxS2vvHWlAwd9c5b3J5ksqSvK1LrX3Qt5lXjuVesI4L// 8qEeF919KJ5Fx8x6ZkOTKmEhJ1OlWxXw+3hIr3ajEl7605Dm2eXQzX0r/Z3f0hwUW6Zq HxBV6YMYjg1YM/dqMXxxizRpLKNCYhLo4DVm0tVu09BGLRH7pzrYUEn6dC4sRJLvJCUf tQXQ== X-Forwarded-Encrypted: i=1; AJvYcCUj7WITcY5fwYBwcSEE1EcviJ72EstFkwIzYlmZ/22WIpDArQmhFqlNrdfg9VNy5r/8Kw8=@lists.linux.dev X-Gm-Message-State: AOJu0YwXskfcRzSU9ZctFit4Dyk7j9RDV856pqIHUin2ELHzBIevaf9n J0jIPZvAKCmrWAzRMB6wA1ieG/LXFTVH20PTdzFY8syyy82O/Z4ZwxKvGZfkBQ== X-Google-Smtp-Source: AGHT+IFoOt4rzgvhDCZteDnFFmUKzF/AVrjX9ESZ9nyOoTWl+oHTKxHAU5l+hHb9VoTek5XVl6j96w== X-Received: by 2002:a05:6358:784:b0:1b1:ac7f:51d5 with SMTP id e5c5f4694b2df-1becbd0145emr538282555d.22.1727697923522; Mon, 30 Sep 2024 05:05:23 -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.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:23 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:36 +0000 Subject: [PATCH 41/45] media: i2c: saa7115: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-41-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 The following cocci warning is fixed: drivers/media/i2c/saa7115.c:1366:3-9: opportunity for str_enable_disable(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7115.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index a1c71187e773..ff0931cf5ecf 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1363,7 +1363,7 @@ static int saa711x_s_stream(struct v4l2_subdev *sd, int enable) struct saa711x_state *state = to_state(sd); v4l2_dbg(1, debug, sd, "%s output\n", - enable ? "enable" : "disable"); + str_enable_disable(enable)); if (state->enable == enable) return 0; From patchwork Mon Sep 30 12:04:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816033 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 2FF1218EFEB for ; Mon, 30 Sep 2024 12:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697929; cv=none; b=GqUaK/VwzP/ZWjHCfjjqomr6Ps5eW75nrqyJf02pzCUqZ2d5NjuzGyzsp50sBlzLTja6iA0HkOcThdnr6MYW6RhBmLOCOnGwxU5Zn5z82JPv/vOxwFllVihXz8DJvc30K9T/Zf+ZitDGxNWvb2cMEdSd29eZvHP4bJB52gjOVl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697929; c=relaxed/simple; bh=DU6huE3ypM4gV1uvRmGnz4MowVjE75GaWBSN46h3an4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BWKZ3oRMkKhcfvmXm8lUPJZO/vQVY3NOOWmLr+d6ECDcdRj157bVZKdUFbSzrQMIFcgF1WXNZXsOVF7zF1RizRE2XLpftrVuA0f9eHabjleNmCLcteNB/zMi4egk5jqwfDyyb73+r8V9140BPlj1xey1CvdWsgsey98bYYliN7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ilc9yg+q; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ilc9yg+q" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6cb37b34a87so30621566d6.0 for ; Mon, 30 Sep 2024 05:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697925; x=1728302725; darn=lists.linux.dev; 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=azNmlM3B7hyMNMP40kUqke3tzTp1ln1Edxwu7YerKBg=; b=ilc9yg+qTzWNfOgwktqWpjEeiriMpKCSgrONsljtZcX1apAs59BzmNl/bm6IUp3ju5 i2Z9avEsKG6qZVfSBGkvhO5Tlod4CwZTpz4URDIYV5H0q+oOj9ZFS4+yVNvRzpSod4ox ZVfG40tb/67whvxYfDRPD2UrFiUSkBvmEcCgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697925; x=1728302725; 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=azNmlM3B7hyMNMP40kUqke3tzTp1ln1Edxwu7YerKBg=; b=CNa6urhRfllz8atsarKTpAlHvdudPj9OU3pbhZc0ix0N0qesC+bnWFreyh9BGUbZ8V 86mQ17bpZ0cfq9Oy78NoAQilU3Kg7uh0Yrzt23gwO9ntmjzCXWgb7ZjyVUIMSMLoFaUh Qxv1sygGcWNApr+Mu56x6uzi/2eW4yTF+RyPCUbEF58Of/HxuANrgwV2/eoOHpR60jDE 3G+oen69R9iVE4mobM3RJXJP9QFWvVyTkw9Fb21nC4C+Tr8IqZ9Rg7NWtopa9hGhyAd6 rEm5nAJ4uMk5KwLbM7QOFBeB7IDH3eJLrPrtqXnMehO1EbbjrZ01DzXz+bq97P5rDh4P gW+g== X-Forwarded-Encrypted: i=1; AJvYcCXR0iepLPsDmRlCBdse5UpjpfA9fry1NkZiwQCXM8hKVFjjP0W/BtTbtmaRA0Z3aRNuZNs=@lists.linux.dev X-Gm-Message-State: AOJu0YxSpGX90lgC8iHh/9BQSiCsx3q/0U7+82NnsoSADq5clEAC+TTe pT9Fnpsimxrbq2EV48/cMQEyyrpIReH4sCKAsv2cVzBP5b8iXOH5789MpShTRw== X-Google-Smtp-Source: AGHT+IH+OoBvU1VpQTPHiaktqSzIksNgZvG/jG37uysXmmuE+j75SqTMgbPUwFz7aDU3AoUz/9R6MA== X-Received: by 2002:a05:6214:450a:b0:6c5:60a1:d99d with SMTP id 6a1803df08f44-6cb3b64c714mr169599236d6.47.1727697925305; Mon, 30 Sep 2024 05:05:25 -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.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:24 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:37 +0000 Subject: [PATCH 42/45] media: i2c: saa7110: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-42-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 The following cocci warning is fixed drivers/media/i2c/saa7110.c:313:37-43: opportunity for str_on_off(enable) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/saa7110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/saa7110.c b/drivers/media/i2c/saa7110.c index 942aeeb40c52..15134ac706d7 100644 --- a/drivers/media/i2c/saa7110.c +++ b/drivers/media/i2c/saa7110.c @@ -310,7 +310,7 @@ static int saa7110_s_stream(struct v4l2_subdev *sd, int enable) if (decoder->enable != enable) { decoder->enable = enable; saa7110_write(sd, 0x0E, enable ? 0x18 : 0x80); - v4l2_dbg(1, debug, sd, "YUV %s\n", enable ? "on" : "off"); + v4l2_dbg(1, debug, sd, "YUV %s\n", str_on_off(enable)); } return 0; } From patchwork Mon Sep 30 12:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816034 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 3030D1A0BFA for ; Mon, 30 Sep 2024 12:05:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697929; cv=none; b=ZLfzguWtX7bcDf7IlBrV2FfzkfD4oNdfjaI9LjbRvsu4QLit55k2L+lUpQsnu4gyKiq7oXZMyb3ArMxuIUet3Y8LyqDAMsa9qlcF0g/ez7VVy2Fwk9F3XhVTWFDZuYm9InpXreqcVJYKjwG6WuHMOhsgDqBg+K9ar7PRDDnqXn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697929; c=relaxed/simple; bh=C1FeHCl55MtKfgHMCIuiQaToVMk1Xx41zJXxbZM8knw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IOBusXp20yPoo4HCBZ5ZzalJRsNBPnAGFmK6piuV7Hv1Yu9wJbFlHg5xSJHpXPzOAHkPZ8Emg5Ag6atAllau35DUVW5SxgeP+Vthk8ANEfcrF0Dqkj7gQcKmBe8ouANe35W+fIBze8HLoMs5SL5KWyIO3vHxx3Hc4cTV7qndTLw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nMH5zvlF; arc=none smtp.client-ip=209.85.219.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nMH5zvlF" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6cb2dffcdbbso37876306d6.1 for ; Mon, 30 Sep 2024 05:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697927; x=1728302727; darn=lists.linux.dev; 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=GL1+Q9/ULYlU3CLmPIk9AVOdXWpb/NtMEppJq3PJtYk=; b=nMH5zvlFphz3ATCA6ReAitWzgbZ6TyRJCsewjbrp6mIfMwyycqiXwPfhmPyTtOkoJj pigy/wXwWHHRn6YJWVuQ5PjUnurciS1euyLrthC+6oWgUTWm4epaAsB7TbjuBPMU5jiH D5mf0iZpjVOtLiDXyo0MJAWMzyPvneC3vVpmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697927; x=1728302727; 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=GL1+Q9/ULYlU3CLmPIk9AVOdXWpb/NtMEppJq3PJtYk=; b=mKXJ8Nl8t0TzKXdUWO4okVk0kYFwzvTc4onHg5Qlqnc+RMPKi1ImJLzQcSHgBfq62A jRQ9xAFMG+a3JySgYs+BMKsEHbW3ECGFRUn19+P9zQaLbVqXPB1j/1hUI+4sYqBvx9va solTOSMHGVk4SRy8Iu2e1wqNESSKWMjkQgyinI3YG2Jn7fQocjU9EdJHyyeEVnzPoIlW p+nmzhaO+v3lPjR1iqhQqidk+yHj6pPd7Jt1Yj8eaZxhjQtpyTuv8zei0kz7SRyh1KD2 d4ONMDjcMpcV1iBCC03Hqsmpz7IP/ETn3Q6Lod4aai3opWYPeZwmw/aRgwk49h9cnEU1 /nMQ== X-Forwarded-Encrypted: i=1; AJvYcCXuV51ED8FrfV5fgNzJW6BTAUmlRkCPTh/NJHapbdh2cqEZ59gBPm1TLAb/QzqUlKiLfyg=@lists.linux.dev X-Gm-Message-State: AOJu0YxwZvgKuLAip0dRnAyabr7+QAPRMKJtMzKULgG2hV3cIJzOeFsu Gpg4n6OZM1Eo8x9L1vW9mmVWOu+uJhK1DGJS+W6Pb0M3KVaVB6HWt92rACKmWw== X-Google-Smtp-Source: AGHT+IG/6are8ci6AYDSQshUu34zjFa2sn9Z7jhsZeKvJuNj89zUt3QMjrvn9kvAxF3Mp7T2iyMvYw== X-Received: by 2002:a05:6214:5587:b0:6cb:3c08:30a0 with SMTP id 6a1803df08f44-6cb3c0830c5mr167635306d6.49.1727697927150; Mon, 30 Sep 2024 05:05:27 -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.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:26 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:38 +0000 Subject: [PATCH 43/45] media: i2c: adv7842: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-43-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 The following cocci warnings are fixed: drivers/media/i2c/adv7842.c:2761:5-29: opportunity for str_true_false(io_read ( sd , 0x6f ) & 0x01) drivers/media/i2c/adv7842.c:2754:5-29: opportunity for str_true_false(io_read ( sd , 0x6f ) & 0x02) drivers/media/i2c/adv7842.c:2821:3-31: opportunity for str_true_false(( hdmi_read ( sd , 0x05 ) & 0x40 )) drivers/media/i2c/adv7842.c:2763:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x01 )) drivers/media/i2c/adv7842.c:2756:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x02 )) drivers/media/i2c/adv7842.c:2765:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x10 )) drivers/media/i2c/adv7842.c:2758:5-31: opportunity for str_true_false(( io_read ( sd , 0x6a ) & 0x20 )) drivers/media/i2c/adv7842.c:2736:4-22: opportunity for str_enabled_disabled(reg_io_0x21 & 0x01) drivers/media/i2c/adv7842.c:2735:4-22: opportunity for str_enabled_disabled(reg_io_0x21 & 0x02) drivers/media/i2c/adv7842.c:2737:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7842.c:2812:4-24: opportunity for str_enabled_disabled(( reg_io_0x02 & 0x08 )) drivers/media/i2c/adv7842.c:2679:3-30: opportunity for str_enabled_disabled(( sdp_read ( sd , 0x12 ) & 0x08 )) drivers/media/i2c/adv7842.c:2730:4-52: opportunity for str_enabled_disabled(( ( reg_rep_0x7d & 0x04 ) && ( reg_rep_0x77 & 0x04 ) )) drivers/media/i2c/adv7842.c:2732:4-52: opportunity for str_enabled_disabled(( ( reg_rep_0x7d & 0x08 ) && ( reg_rep_0x77 & 0x08 ) )) drivers/media/i2c/adv7842.c:2768:5-33: opportunity for str_on_off(! ! ( cp_read ( sd , 0xff ) & 0x10 )) drivers/media/i2c/adv7842.c:2843:3-31: opportunity for str_on_off(( hdmi_read ( sd , 0x04 ) & 0x40 )) drivers/media/i2c/adv7842.c:2654:2-29: opportunity for str_on_off(( sdp_read ( sd , 0x56 ) & 0x01 )) drivers/media/i2c/adv7842.c:2823:3-31: opportunity for str_yes_no(( hdmi_read ( sd , 0x04 ) & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7842.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 014fc913225c..a43479c3ff03 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -2651,7 +2651,7 @@ static int adv7842_sdp_log_status(struct v4l2_subdev *sd) io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f); v4l2_info(sd, "SDP: free run: %s\n", - (sdp_read(sd, 0x56) & 0x01) ? "on" : "off"); + str_on_off(sdp_read(sd, 0x56) & 0x01)); v4l2_info(sd, "SDP: %s\n", sdp_signal_detected ? "valid SD/PR signal detected" : "invalid/no signal"); if (sdp_signal_detected) { @@ -2676,7 +2676,7 @@ static int adv7842_sdp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "SDP: %s\n", (sdp_read(sd, 0x57) & 0x08) ? "Interlaced" : "Progressive"); v4l2_info(sd, "SDP: deinterlacer %s\n", - (sdp_read(sd, 0x12) & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(sdp_read(sd, 0x12) & 0x08)); v4l2_info(sd, "SDP: csc %s mode\n", (sdp_io_read(sd, 0xe0) & 0x40) ? "auto" : "manual"); } @@ -2727,15 +2727,13 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "HDMI/DVI-D port selected: %s\n", state->hdmi_port_a ? "A" : "B"); v4l2_info(sd, "EDID A %s, B %s\n", - ((reg_rep_0x7d & 0x04) && (reg_rep_0x77 & 0x04)) ? - "enabled" : "disabled", - ((reg_rep_0x7d & 0x08) && (reg_rep_0x77 & 0x08)) ? - "enabled" : "disabled"); + str_enabled_disabled((reg_rep_0x7d & 0x04) && (reg_rep_0x77 & 0x04)), + str_enabled_disabled((reg_rep_0x7d & 0x08) && (reg_rep_0x77 & 0x08))); v4l2_info(sd, "HPD A %s, B %s\n", - reg_io_0x21 & 0x02 ? "enabled" : "disabled", - reg_io_0x21 & 0x01 ? "enabled" : "disabled"); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x21 & 0x02), + str_enabled_disabled(reg_io_0x21 & 0x01)); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { int i; @@ -2751,21 +2749,21 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----Signal status-----\n"); if (state->hdmi_port_a) { v4l2_info(sd, "Cable detected (+5V power): %s\n", - io_read(sd, 0x6f) & 0x02 ? "true" : "false"); + str_true_false(io_read(sd, 0x6f) & 0x02)); v4l2_info(sd, "TMDS signal detected: %s\n", - (io_read(sd, 0x6a) & 0x02) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x02)); v4l2_info(sd, "TMDS signal locked: %s\n", - (io_read(sd, 0x6a) & 0x20) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x20)); } else { v4l2_info(sd, "Cable detected (+5V power):%s\n", - io_read(sd, 0x6f) & 0x01 ? "true" : "false"); + str_true_false(io_read(sd, 0x6f) & 0x01)); v4l2_info(sd, "TMDS signal detected: %s\n", - (io_read(sd, 0x6a) & 0x01) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x01)); v4l2_info(sd, "TMDS signal locked: %s\n", - (io_read(sd, 0x6a) & 0x10) ? "true" : "false"); + str_true_false(io_read(sd, 0x6a) & 0x10)); } v4l2_info(sd, "CP free run: %s\n", - (!!(cp_read(sd, 0xff) & 0x10) ? "on" : "off")); + str_on_off(cp_read(sd, 0xff) & 0x10)); v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n", io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f, (io_read(sd, 0x01) & 0x70) >> 4); @@ -2809,7 +2807,7 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) (reg_io_0x02 & 0x02) ? "RGB" : "YCbCr", (((reg_io_0x02 >> 2) & 0x01) ^ (reg_io_0x02 & 0x01)) ? "(16-235)" : "(0-255)", - (reg_io_0x02 & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x02 & 0x08)); v4l2_info(sd, "Color space conversion: %s\n", csc_coeff_sel_rb[cp_read(sd, 0xf4) >> 4]); @@ -2818,9 +2816,9 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "-----%s status-----\n", is_hdmi(sd) ? "HDMI" : "DVI-D"); v4l2_info(sd, "HDCP encrypted content: %s\n", - (hdmi_read(sd, 0x05) & 0x40) ? "true" : "false"); + str_true_false(hdmi_read(sd, 0x05) & 0x40)); v4l2_info(sd, "HDCP keys read: %s%s\n", - (hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no", + str_yes_no(hdmi_read(sd, 0x04) & 0x20), (hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : ""); if (!is_hdmi(sd)) return 0; @@ -2840,7 +2838,7 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd) (hdmi_read(sd, 0x5e) << 8) + hdmi_read(sd, 0x5f)); v4l2_info(sd, "AV Mute: %s\n", - (hdmi_read(sd, 0x04) & 0x40) ? "on" : "off"); + str_on_off(hdmi_read(sd, 0x04) & 0x40)); v4l2_info(sd, "Deep color mode: %s\n", deep_color_mode_txt[hdmi_read(sd, 0x0b) >> 6]); From patchwork Mon Sep 30 12:04:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816035 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 415CA1A2631 for ; Mon, 30 Sep 2024 12:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697932; cv=none; b=PNB0QTq3giby9o062/9MQc+djNbY50FLXegCeSq1FGlagJ5T4HeOjFkK7HdYYXVhMstEQpUt93F8yB/vM/Lh0kW0vEY50y5qHRh5IPGBXbq9i9AE+tmdBXsHUnz65EwLpGM7H6yjBGSa251BoX8Gark/7a29ilELtHmFSOLHL4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697932; c=relaxed/simple; bh=LEyRnQlk/VvUqFfADZuaXZpU9psw9Z1DNm9sbFANuMY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nS2ZZgYuGbybFct6jIQ6p3dCUWjOI4vOJWUhJZKJyzF2B1SaR4pHvcNgNnKn3N746vLf+XbBLqotbTdQbaSk031EW5pihwDJUzckv7KnNbVL5odYMiz0ENfc63N75DRJj9Ij1Gp8FzzelKVce2f9h+s/kx3Z39foVIsTYfkuaM4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HY3Pj7q2; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HY3Pj7q2" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6cb4c013b78so18086886d6.1 for ; Mon, 30 Sep 2024 05:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697929; x=1728302729; darn=lists.linux.dev; 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=NEpH3GW+zX127Rx2gWkJapzmZ8AtweIcRQ6dozRhT1Y=; b=HY3Pj7q247LtamiRFBIWCj1Nf9JE39i/5TdVN/RcgmzbukzxiPQ9QNPKbTVzC3/aaT ZILtm2TLp+MonEYHgv9RS5gpuBLpIF/PObtctop7vELzflKkSgvCArqD4IndAUT18Vgu urL7qIaH0xLBh1NbaUJClJMCTARoo+Vtw4OII= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697929; x=1728302729; 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=NEpH3GW+zX127Rx2gWkJapzmZ8AtweIcRQ6dozRhT1Y=; b=snGqucF2z2ij5Pu7ovFeTIz0RwuYK4PVbWIzAzrm8fW01fONSUw34LWV3+RqYifKQY f5E4nrWRxgbhr5okjZCQWZ2M3Ffx22M0eVNI0s13hBZdLnb/YNJIQ6/dqZZrkaIidDcS Eo44Wi25tJcE88YdSGLMRQifVaaRRr9M8Qsqk8XykwPwP7Uct9fIvxMQvU/J9kF+jWt5 JMcZWAcc6Z4EGSeUVP5/cC4XSvulOIfqYG9wAB3gmboP7Uy+4u2YtpHol7BUKa2h1o8t iX6epbMhGctq/S9HbVlQqdKCF56I/1eghdbCsATFnHIa/FcqvqiM/6/of+EmZS2Vm0W5 PbHA== X-Forwarded-Encrypted: i=1; AJvYcCW0ugZjt3PnWi4spDxKe0WKkJFndO8sRYl5IFenDxElZzndrR3C3DXCl9ZHtwPbCfUYCfI=@lists.linux.dev X-Gm-Message-State: AOJu0YxWO2OSXeB8o/veQpo8R3W4+g9fyUfziiXS7dKzcuxbyOzF9ZAN UZBl6TDVH52vj+lrrbiG61OMtkERErqaoSO6ogen7yO5B8z2FjCFS2itYfuy6w== X-Google-Smtp-Source: AGHT+IFPaIZM1NSUWS2N20Z229u6ehVGSu/pXbG6WOauy86M5vVJLdj9bB3eMmf2b81ROre6rRHWmQ== X-Received: by 2002:a05:6214:3207:b0:6c5:7446:4fdf with SMTP id 6a1803df08f44-6cb3b5e283dmr198571366d6.24.1727697929145; Mon, 30 Sep 2024 05:05:29 -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.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:28 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:39 +0000 Subject: [PATCH 44/45] media: i2c: adv76xx: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-44-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 The following cocci warnings are fixed: drivers/media/i2c/adv7604.c:2641:3-31: opportunity for str_true_false(( hdmi_read ( sd , 0x05 ) & 0x40 )) drivers/media/i2c/adv7604.c:2595:34-48: opportunity for str_false_true(no_lock_cp ( sd )) drivers/media/i2c/adv7604.c:2593:36-52: opportunity for str_false_true(no_lock_sspd ( sd )) drivers/media/i2c/adv7604.c:2594:36-52: opportunity for str_false_true(no_lock_stdi ( sd )) drivers/media/i2c/adv7604.c:2592:3-19: opportunity for str_false_true(no_lock_tmds ( sd )) drivers/media/i2c/adv7604.c:2590:3-21: opportunity for str_false_true(no_signal_tmds ( sd )) drivers/media/i2c/adv7604.c:2568:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7604.c:2630:3-23: opportunity for str_enabled_disabled(( reg_io_0x02 & 0x08 )) drivers/media/i2c/adv7604.c:2597:3-20: opportunity for str_on_off(( in_free_run ( sd ) )) drivers/media/i2c/adv7604.c:2664:33-61: opportunity for str_on_off(( hdmi_read ( sd , 0x04 ) & 0x40 )) drivers/media/i2c/adv7604.c:2643:3-31: opportunity for str_yes_no(( hdmi_read ( sd , 0x04 ) & 0x20 )) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7604.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 48230d5109f0..fb74f2947413 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -2565,8 +2565,8 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) ((edid_enabled & 0x02) ? "Yes" : "No"), ((edid_enabled & 0x04) ? "Yes" : "No"), ((edid_enabled & 0x08) ? "Yes" : "No")); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { int i; @@ -2587,14 +2587,14 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) ((cable_det & 0x04) ? "Yes" : "No"), ((cable_det & 0x08) ? "Yes" : "No")); v4l2_info(sd, "TMDS signal detected: %s\n", - no_signal_tmds(sd) ? "false" : "true"); + str_false_true(no_signal_tmds(sd))); v4l2_info(sd, "TMDS signal locked: %s\n", - no_lock_tmds(sd) ? "false" : "true"); - v4l2_info(sd, "SSPD locked: %s\n", no_lock_sspd(sd) ? "false" : "true"); - v4l2_info(sd, "STDI locked: %s\n", no_lock_stdi(sd) ? "false" : "true"); - v4l2_info(sd, "CP locked: %s\n", no_lock_cp(sd) ? "false" : "true"); + str_false_true(no_lock_tmds(sd))); + v4l2_info(sd, "SSPD locked: %s\n", str_false_true(no_lock_sspd(sd))); + v4l2_info(sd, "STDI locked: %s\n", str_false_true(no_lock_stdi(sd))); + v4l2_info(sd, "CP locked: %s\n", str_false_true(no_lock_cp(sd))); v4l2_info(sd, "CP free run: %s\n", - (in_free_run(sd)) ? "on" : "off"); + str_on_off(in_free_run(sd))); v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n", io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f, (io_read(sd, 0x01) & 0x70) >> 4); @@ -2627,7 +2627,7 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) (reg_io_0x02 & 0x02) ? "RGB" : "YCbCr", (((reg_io_0x02 >> 2) & 0x01) ^ (reg_io_0x02 & 0x01)) ? "(16-235)" : "(0-255)", - (reg_io_0x02 & 0x08) ? "enabled" : "disabled"); + str_enabled_disabled(reg_io_0x02 & 0x08)); v4l2_info(sd, "Color space conversion: %s\n", csc_coeff_sel_rb[cp_read(sd, info->cp_csc) >> 4]); @@ -2638,9 +2638,9 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Digital video port selected: %c\n", (hdmi_read(sd, 0x00) & 0x03) + 'A'); v4l2_info(sd, "HDCP encrypted content: %s\n", - (hdmi_read(sd, 0x05) & 0x40) ? "true" : "false"); + str_true_false(hdmi_read(sd, 0x05) & 0x40)); v4l2_info(sd, "HDCP keys read: %s%s\n", - (hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no", + str_yes_no(hdmi_read(sd, 0x04) & 0x20), (hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : ""); if (is_hdmi(sd)) { bool audio_pll_locked = hdmi_read(sd, 0x04) & 0x01; @@ -2661,7 +2661,8 @@ static int adv76xx_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "Audio N: %u\n", ((hdmi_read(sd, 0x5d) & 0x0f) << 16) + (hdmi_read(sd, 0x5e) << 8) + hdmi_read(sd, 0x5f)); - v4l2_info(sd, "AV Mute: %s\n", (hdmi_read(sd, 0x04) & 0x40) ? "on" : "off"); + v4l2_info(sd, "AV Mute: %s\n", + str_on_off(hdmi_read(sd, 0x04) & 0x40)); v4l2_info(sd, "Deep color mode: %s\n", deep_color_mode_txt[(hdmi_read(sd, 0x0b) & 0x60) >> 5]); v4l2_info(sd, "HDMI colorspace: %s\n", hdmi_color_space_txt[hdmi_read(sd, 0x53) & 0xf]); From patchwork Mon Sep 30 12:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13816036 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 EC30D1A2540 for ; Mon, 30 Sep 2024 12:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697933; cv=none; b=aMaA5HC7xX2+4+iXllUIF0NG/2nzjC1DkWh3Lb3khkBttDv/6xj3UkUkxBXmjQe2UKwjEw6BagC7F4wV1RgbE8wRJXGLJsLcbS24YGm7XQLD3Gc1G8OjigWaIwEQHILwB4pjT5hAN+W0z3cD+W81IMc8vdhSC6zeWUILecdrLpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727697933; c=relaxed/simple; bh=jY1WzcwZ9RpRPpmgPFLEyMqg1JCaHzSShjO6IWqlOD4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=obEJypVf+0YD/imvY0oe1uUitmnzC6TbkCf8+OY7SDVOY/UTIv6oj+psJaKqo6Q7m0o5JW8UrQ5iq/jXXYgNHD0Zydk7pUMisgFFfpK+VzWpu/KcsIbHmBkNBKQxRRk8h36K2vv4mHOgO+35jM/sCjSnQxjSzXEswVeOZdzADYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=U+lpVBYY; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="U+lpVBYY" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-71100987d1cso2586632a34.2 for ; Mon, 30 Sep 2024 05:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727697931; x=1728302731; darn=lists.linux.dev; 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=y4CZBI+n6IjdrtDGuJsp4m8Z3nCdNkGXw0PtmNPGNzY=; b=U+lpVBYYJuytLftGA/jsECgMA/TPtgf5B3qPcpM9r9DMpiPZmMcR3GqtjrAZ18PXkd izwQyLtUiL1pDHPDefjs7SnVi+KoJBWFPJ/rnJvol06Nyri0nc0GHi8MK6R6DpmP8FbX 4QbAOwJG/m/uxF6NZPUHl9TWZ50URmIMW6Ayg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727697931; x=1728302731; 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=y4CZBI+n6IjdrtDGuJsp4m8Z3nCdNkGXw0PtmNPGNzY=; b=ZNBOgTJ+lPerKxKQkwL/1NxJpHsXctmWk+Kl9DbNgjiwbTwIxQE69RNx6TuUo7lcd0 mLUP3aZofbyVj0R/C/eNzwgfurOMn4OZAorp2gPH0bGMh1dQM7oQUbkc0QIqWgKo13r3 OQQXFu9Fpd8fQrEJ/7Byesl9pm3Dbk/KNilxtbS4th5d1TaDGAXuniF5Uglw0ygnf+eh VOkCIveHIDXvVjlRVc9dnPcO/AxVdERzKWD+TiVCNpPFV6GWadasjTwcPhoWiGAU0aQC GaYidwk3yWJ0B2MkR94M62jfn3Zr6kxVEPnT0J60I4muNsgDNDLiNZpFomLeMtn4E8Py IIrA== X-Forwarded-Encrypted: i=1; AJvYcCUxy+q14JMp4hqymA0YmiMsDHjVt5/GbT8MdOmGQPxJrFzIccV5c8rnj4nw28hNy6lb3Tc=@lists.linux.dev X-Gm-Message-State: AOJu0YxP9QJxz8FYTb6AdNDgpRgbcD3BKWRaZD3t45OU0IZbwrOLM9zv pwiGMAWRLZbDw90dQcFnMNJNqdjbAQSm2DqxVNW9aglrWAMSDXt1TOKdrc+QHg== X-Google-Smtp-Source: AGHT+IF0K+EHYN7PignB/8NYu53YVj7j++O0mwk1W5RBN0+QHuQojpzGFveGrxjlPlRfoI1UafopSQ== X-Received: by 2002:a05:6358:2c8e:b0:1b5:c4f3:faec with SMTP id e5c5f4694b2df-1becbb585e8mr274204655d.4.1727697931042; Mon, 30 Sep 2024 05:05:31 -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.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:05:30 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 30 Sep 2024 12:04:40 +0000 Subject: [PATCH 45/45] media: i2c: adv7511: Use string_choices helpers Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240930-cocci-opportunity-v1-45-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 The following cocci warnings are fixed: drivers/media/i2c/adv7511-v4l2.c:873:46-52: opportunity for str_enable_disable(enable) drivers/media/i2c/adv7511-v4l2.c:620:28-51: opportunity for str_enabled_disabled(state -> cec_enabled_adap) drivers/media/i2c/adv7511-v4l2.c:642:52-54: opportunity for str_on_off(on) drivers/media/i2c/adv7511-v4l2.c:568:29-44: opportunity for str_on_off(state -> power_on) Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/adv7511-v4l2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c index e9406d552699..d9af81015e72 100644 --- a/drivers/media/i2c/adv7511-v4l2.c +++ b/drivers/media/i2c/adv7511-v4l2.c @@ -565,7 +565,7 @@ static int adv7511_log_status(struct v4l2_subdev *sd) "9", "A", "B", "C", "D", "E", "F" }; - v4l2_info(sd, "power %s\n", state->power_on ? "on" : "off"); + v4l2_info(sd, "power %s\n", str_on_off(state->power_on)); v4l2_info(sd, "%s hotplug, %s Rx Sense, %s EDID (%d block(s))\n", (adv7511_rd(sd, 0x42) & MASK_ADV7511_HPD_DETECT) ? "detected" : "no", (adv7511_rd(sd, 0x42) & MASK_ADV7511_MSEN_DETECT) ? "detected" : "no", @@ -617,8 +617,8 @@ static int adv7511_log_status(struct v4l2_subdev *sd) v4l2_info(sd, "i2c cec addr: 0x%x\n", state->i2c_cec_addr); - v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ? - "enabled" : "disabled"); + v4l2_info(sd, "CEC: %s\n", + str_enabled_disabled(state->cec_enabled_adap)); if (state->cec_enabled_adap) { for (i = 0; i < ADV7511_MAX_ADDRS; i++) { bool is_valid = state->cec_valid_addrs & (1 << i); @@ -639,7 +639,7 @@ static int adv7511_s_power(struct v4l2_subdev *sd, int on) const int retries = 20; int i; - 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; @@ -870,7 +870,8 @@ static void adv7511_set_isr(struct v4l2_subdev *sd, bool enable) u8 irqs_rd; int retries = 100; - v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, enable ? "enable" : "disable"); + v4l2_dbg(2, debug, sd, "%s: %s\n", __func__, + str_enable_disable(enable)); if (state->enabled_irq == enable) return;