From: Lei Huang <huanglei814@163.com>
To: mchehab@kernel.org
Cc: johan@kernel.org, hverkuil+cisco@kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Lei Huang <huanglei@kylinos.cn>
Subject: [PATCH v2 04/17] media: s2255: Use consistent braces on all arms of if/else statements
Date: Mon, 20 Jul 2026 10:54:33 +0800 [thread overview]
Message-ID: <20260720025438.207149-5-huanglei814@163.com> (raw)
In-Reply-To: <20260720025438.207149-1-huanglei814@163.com>
From: Lei Huang <huanglei@kylinos.cn>
Fix all 5 'CHECK: braces {} should be used on all arms of this statement'
issues reported by checkpatch.pl in s2255drv.c. Add braces to else and
else-if branches that were missing them for consistency with other
branches.
Signed-off-by: Lei Huang <huanglei@kylinos.cn>
---
drivers/media/usb/s2255/s2255drv.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 78011f5fe99c..a759ba9a6d51 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -534,8 +534,9 @@ static void s2255_fwchunk_complete(struct urb *urb)
return;
}
data->fw_loaded += len;
- } else
+ } else {
atomic_set(&data->fw_state, S2255_FW_LOADED_DSPWAIT);
+ }
return;
}
@@ -839,8 +840,9 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
mode.scale = SCALE_4CIFSI;
else
mode.scale = SCALE_4CIFS;
- } else
+ } else {
mode.scale = SCALE_2CIFS;
+ }
} else {
mode.scale = SCALE_1CIFS;
@@ -1122,8 +1124,9 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i)
vc->width = LINE_SZ_4CIFS_PAL;
vc->height = NUM_LINES_4CIFS_PAL * 2;
}
- } else
+ } else {
return -EINVAL;
+ }
vc->std = i;
if (mode.restart)
s2255_set_mode(vc, &mode);
@@ -1306,11 +1309,11 @@ static int vidioc_s_parm(struct file *file, void *priv,
return -EBUSY;
def_num = (mode.format == FORMAT_NTSC) ? 1001 : 1000;
def_dem = (mode.format == FORMAT_NTSC) ? 30000 : 25000;
- if (def_dem != sp->parm.capture.timeperframe.denominator)
+ if (def_dem != sp->parm.capture.timeperframe.denominator) {
sp->parm.capture.timeperframe.numerator = def_num;
- else if (sp->parm.capture.timeperframe.numerator <= def_num)
+ } else if (sp->parm.capture.timeperframe.numerator <= def_num) {
sp->parm.capture.timeperframe.numerator = def_num;
- else if (sp->parm.capture.timeperframe.numerator <= (def_num * 2)) {
+ } else if (sp->parm.capture.timeperframe.numerator <= (def_num * 2)) {
sp->parm.capture.timeperframe.numerator = def_num * 2;
fdec = FDEC_2;
} else if (sp->parm.capture.timeperframe.numerator <= (def_num * 3)) {
@@ -2058,9 +2061,9 @@ static void read_pipe_completion(struct urb *purb)
return;
}
- if (status == 0)
+ if (status == 0) {
s2255_read_video_callback(dev, pipe_info);
- else {
+ } else {
pipe_info->err_count++;
dprintk(dev, 1, "%s: failed URB %d\n", __func__, status);
}
--
2.25.1
next prev parent reply other threads:[~2026-07-20 2:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 2:54 [PATCH v2 00/17] media: s2255: Coding style cleanup Lei Huang
2026-07-20 2:54 ` [PATCH v2 01/17] media: s2255: Rename CamelCase goto labels to snake_case Lei Huang
2026-07-20 2:54 ` [PATCH v2 02/17] media: s2255: Rename remaining CamelCase identifiers " Lei Huang
2026-07-20 2:54 ` [PATCH v2 03/17] media: s2255: Remove unnecessary spaces after casts Lei Huang
2026-07-20 2:54 ` Lei Huang [this message]
2026-07-20 2:54 ` [PATCH v2 05/17] media: s2255: Replace NULL comparisons with ! notation Lei Huang
2026-07-20 2:54 ` [PATCH v2 06/17] media: s2255: Fix alignment to match open parenthesis Lei Huang
2026-07-20 2:54 ` [PATCH v2 07/17] media: s2255: Remove multiple blank lines and before close braces Lei Huang
2026-07-20 2:54 ` [PATCH v2 08/17] media: s2255: Add blank lines after function/struct/enum declarations Lei Huang
2026-07-20 2:54 ` [PATCH v2 09/17] media: s2255: Add spaces around multiplication operators Lei Huang
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=20260720025438.207149-5-huanglei814@163.com \
--to=huanglei814@163.com \
--cc=huanglei@kylinos.cn \
--cc=hverkuil+cisco@kernel.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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
all inboxes | Powered by JetHome®