lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240930-cocci-opportunity-v1-6-81e137456ce0@chromium.org>
Date: Mon, 30 Sep 2024 12:04:01 +0000
From: Ricardo Ribalda <ribalda@...omium.org>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>, 
 Bingbu Cao <bingbu.cao@...el.com>, Tianshu Qiu <tian.shu.qiu@...el.com>, 
 Mauro Carvalho Chehab <mchehab@...nel.org>, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 Hans de Goede <hdegoede@...hat.com>, Andy Shevchenko <andy@...nel.org>, 
 Hans Verkuil <hverkuil@...all.nl>, Mike Isely <isely@...ox.com>, 
 Olli Salonen <olli.salonen@....fi>, 
 Maxim Levitsky <maximlevitsky@...il.com>, Sean Young <sean@...s.org>, 
 Sergey Kozlov <serjk@...up.ru>, Abylay Ospan <aospan@...up.ru>, 
 Jemma Denson <jdenson@...il.com>, 
 Patrick Boettcher <patrick.boettcher@...teo.de>, 
 Ming Qian <ming.qian@....com>, Zhou Peng <eagle.zhou@....com>, 
 Andy Walls <awalls@...metrocast.net>, 
 Laurent Pinchart <laurent.pinchart@...asonboard.com>, 
 Michal Simek <michal.simek@....com>, 
 Jean-Christophe Trotin <jean-christophe.trotin@...s.st.com>, 
 Philipp Zabel <p.zabel@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>, 
 Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>, Eddie James <eajames@...ux.ibm.com>, 
 Joel Stanley <joel@....id.au>, Andrew Jeffery <andrew@...econstruct.com.au>, 
 Hans Verkuil <hverkuil-cisco@...all.nl>, Tomasz Figa <tfiga@...omium.org>, 
 Marek Szyprowski <m.szyprowski@...sung.com>, 
 Tim Harvey <tharvey@...eworks.com>, 
 Benjamin Mugnier <benjamin.mugnier@...s.st.com>, 
 Sylvain Petinot <sylvain.petinot@...s.st.com>, 
 Jacopo Mondi <jacopo+renesas@...ndi.org>, 
 Kieran Bingham <kieran.bingham+renesas@...asonboard.com>, 
 Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>, 
 Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
Cc: linux-media@...r.kernel.org, linux-staging@...ts.linux.dev, 
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
 imx@...ts.linux.dev, openbmc@...ts.ozlabs.org, 
 linux-aspeed@...ts.ozlabs.org, Ricardo Ribalda <ribalda@...omium.org>
Subject: [PATCH 06/45] media: em28xx: Use string_choices helpers

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 <ribalda@...omium.org>
---
 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;
 		}

-- 
2.46.1.824.gd892dcdcdd-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ