From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: [PATCH] media: vivid: drop unused 'j' variable
Date: Wed, 23 Sep 2026 10:56:47 +0200 [thread overview]
Message-ID: <41320fe2-0b49-49b9-bbe0-d7107f6f73cd@kernel.org> (raw)
In two places the 'j' index variable was set but never used.
Drop it.
This fixes two compiler warnings:
drivers/media/test-drivers/vivid/vivid-cec.c: In function ‘find_dest_adap’:
drivers/media/test-drivers/vivid/vivid-cec.c:26:25: warning: variable ‘j’ set but not used [-Wunused-but-set-variable=]
26 | unsigned int i, j;
| ^
drivers/media/test-drivers/vivid/vivid-cec.c: In function ‘vivid_cec_bus_thread’:
drivers/media/test-drivers/vivid/vivid-cec.c:116:25: warning: variable ‘j’ set but not used [-Wunused-but-set-variable=]
116 | unsigned int i, j;
| ^
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
---
drivers/media/test-drivers/vivid/vivid-cec.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/media/test-drivers/vivid/vivid-cec.c b/drivers/media/test-drivers/vivid/vivid-cec.c
index 2d15fdd5d999..8d301578e2eb 100644
--- a/drivers/media/test-drivers/vivid/vivid-cec.c
+++ b/drivers/media/test-drivers/vivid/vivid-cec.c
@@ -23,7 +23,7 @@ struct xfer_on_bus {
static bool find_dest_adap(struct vivid_dev *dev,
struct cec_adapter *adap, u8 dest)
{
- unsigned int i, j;
+ unsigned int i;
if (dest >= 0xf)
return false;
@@ -33,13 +33,12 @@ static bool find_dest_adap(struct vivid_dev *dev,
cec_has_log_addr(dev->cec_rx_adap, dest))
return true;
- for (i = 0, j = 0; i < dev->num_inputs; i++) {
+ for (i = 0; i < dev->num_inputs; i++) {
unsigned int menu_idx =
dev->input_is_connected_to_output[i];
if (dev->input_type[i] != HDMI)
continue;
- j++;
if (menu_idx < FIXED_MENU_ITEMS)
continue;
@@ -113,7 +112,7 @@ static void adjust_sfts(struct vivid_dev *dev)
int vivid_cec_bus_thread(void *_dev)
{
u32 last_sft;
- unsigned int i, j;
+ unsigned int i;
unsigned int dest;
ktime_t start, end;
s64 delta_us, retry_us;
@@ -210,13 +209,12 @@ int vivid_cec_bus_thread(void *_dev)
if (first_status == CEC_TX_STATUS_OK) {
if (xfers_on_bus[first_idx].adap != dev->cec_rx_adap)
cec_received_msg(dev->cec_rx_adap, &first_msg);
- for (i = 0, j = 0; i < dev->num_inputs; i++) {
+ for (i = 0; i < dev->num_inputs; i++) {
unsigned int menu_idx =
dev->input_is_connected_to_output[i];
if (dev->input_type[i] != HDMI)
continue;
- j++;
if (menu_idx < FIXED_MENU_ITEMS)
continue;
--
2.53.0
reply other threads:[~2026-09-23 8:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41320fe2-0b49-49b9-bbe0-d7107f6f73cd@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox