The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Bergh <bergh.jonathan@gmail.com>
To: mchehab@kernel.org
Cc: gregkh@linuxfoundation.org, error27@gmail.com,
	linux-staging@lists.linux.dev, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jonathan Bergh <bergh.jonathan@gmail.com>
Subject: [PATCH 5/5] staging: media: av7110: Fix various formating issues
Date: Sat, 21 Oct 2023 01:23:32 +0200	[thread overview]
Message-ID: <20231020232332.55024-6-bergh.jonathan@gmail.com> (raw)
In-Reply-To: <20231020232332.55024-1-bergh.jonathan@gmail.com>

Fixed the following remaining formatting issues:
 * ensure balanced whitespaces around '&' symbol
 * fix irregular whitespacings in variable assignment statement
 * fix suspect identation after if statement
 * fix instances were trailing statements after case statements were
   not on a newline
 * fixed a block comment to use '*' on succesive lines
 * Remove unneeded braces {} for single line conditional statement

Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com>
---
 drivers/staging/media/av7110/av7110_av.c | 29 +++++++++++++-----------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/media/av7110/av7110_av.c b/drivers/staging/media/av7110/av7110_av.c
index 82d4c02ae3ef..bdef95244121 100644
--- a/drivers/staging/media/av7110/av7110_av.c
+++ b/drivers/staging/media/av7110/av7110_av.c
@@ -241,8 +241,8 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
 		sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8;
 		sync |= DVB_RINGBUFFER_PEEK(buf, 3);
 
-		if (((sync &~0x0f) == 0x000001e0) ||
-		    ((sync &~0x1f) == 0x000001c0) ||
+		if (((sync & ~0x0f) == 0x000001e0) ||
+		    ((sync & ~0x1f) == 0x000001c0) ||
 		    (sync == 0x000001bd))
 			break;
 		printk("resync\n");
@@ -297,10 +297,10 @@ int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
 		return 0;
 
 	case DVB_ADAC_MSP34x0:
-		vol  = (volleft > volright) ? volleft : volright;
-		val	= (vol * 0x73 / 255) << 8;
+		vol = (volleft > volright) ? volleft : volright;
+		val = (vol * 0x73 / 255) << 8;
 		if (vol > 0)
-		       balance = ((volright - volleft) * 127) / vol;
+			balance = ((volright - volleft) * 127) / vol;
 		msp_writereg(av7110, MSP_WR_DSP, 0x0001, balance << 8);
 		msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */
 		msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */
@@ -367,8 +367,8 @@ static int get_video_format(struct av7110 *av7110, u8 *buf, int count)
 		if (p[0] || p[1] || p[2] != 0x01 || p[3] != 0xb3)
 			continue;
 		p += 4;
-		hsize = ((p[1] &0xF0) >> 4) | (p[0] << 4);
-		vsize = ((p[1] &0x0F) << 8) | (p[2]);
+		hsize = ((p[1] & 0xF0) >> 4) | (p[0] << 4);
+		vsize = ((p[1] & 0x0F) << 8) | (p[2]);
 		sw = (p[3] & 0x0F);
 		ret = av7110_set_vidmode(av7110, sw2mode[sw]);
 		if (!ret) {
@@ -1059,13 +1059,16 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
 			continue;
 		}
 		switch (match++) {
-		case 2: if (c == 0x01)
+		case 2:
+			if (c == 0x01)
 				continue;
 			break;
-		case 3: if (c == 0xb5)
+		case 3:
+			if (c == 0xb5)
 				continue;
 			break;
-		case 4: if ((c & 0xf0) == 0x10)
+		case 4:
+			if ((c & 0xf0) == 0x10)
 				continue;
 			break;
 		}
@@ -1073,7 +1076,8 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
 	}
 
 	/* setting n always > 1, fixes problems when playing stillframes
-	   consisting of I- and P-Frames */
+	 * consisting of I- and P-Frames
+	 */
 	n = MIN_IFRAME / len + 1;
 
 	/* FIXME: nonblock? */
@@ -1542,9 +1546,8 @@ static int dvb_video_release(struct inode *inode, struct file *file)
 
 	dprintk(2, "av7110:%p,\n", av7110);
 
-	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+	if ((file->f_flags & O_ACCMODE) != O_RDONLY)
 		av7110_av_stop(av7110, RP_VIDEO);
-	}
 
 	return dvb_generic_release(inode, file);
 }
-- 
2.40.1


  parent reply	other threads:[~2023-10-20 23:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 23:23 [PATCH 0/5] staging: media: av7110: Fix various formatting and small code issues Jonathan Bergh
2023-10-20 23:23 ` [PATCH 1/5] staging: media: av7110: Fix missing newlines after declaration warnings Jonathan Bergh
2023-10-20 23:23 ` [PATCH 2/5] staging: media: av7110: Fix various whitespace checkpatch errors Jonathan Bergh
2023-10-23 14:26   ` Dan Carpenter
2023-10-23 15:24     ` Joe Perches
2023-10-24  4:12       ` Dan Carpenter
2023-10-20 23:23 ` [PATCH 3/5] staging: media: av7110: Remove unnecessary whitespace before quoted newlines Jonathan Bergh
2023-10-23 14:27   ` Dan Carpenter
2023-10-20 23:23 ` [PATCH 4/5] staging: media: av7110: Fix 'long int' and 'unsigned' variable declarations Jonathan Bergh
2023-10-20 23:23 ` Jonathan Bergh [this message]
2023-10-23 14:32   ` [PATCH 5/5] staging: media: av7110: Fix various formating issues Dan Carpenter
2023-11-22 10:57 ` [PATCH 0/5] staging: media: av7110: Fix various formatting and small code issues Hans Verkuil

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=20231020232332.55024-6-bergh.jonathan@gmail.com \
    --to=bergh.jonathan@gmail.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --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