Skip to contentSkip to conversation

staging: most: video: fixed a parentheses coding style issue.

PATCH In review Daniel West 3 participants 5 messages Dec 17, 2020 – Dec 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: most: video: fixed a parentheses coding style issue.

Fixed a coding style issue.

---
 drivers/staging/most/video/video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/most/video/video.c +2 -2
index 829df899b993..c58192ab0c2a 100644
@@ -365,8 +365,8 @@ static const struct video_device comp_videodev_template = {
 
 /**************************************************************************/
 
-static struct most_video_dev *get_comp_dev(
-	struct most_interface *iface, int channel_idx)
+static struct most_video_dev *get_comp_dev
+	(struct most_interface *iface, int channel_idx)
 {
 	struct most_video_dev *mdev;
 	unsigned long flags;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 1 line · Daniel West

Fixed a coding style issue.

It may pass checkpatch without warning, but it's uncommon kernel coding style.

drivers/staging/most/video/video.c

Quoted 1 line
drivers/staging/most/video/video.c +0 -0

[]

drivers/staging/most/video/video.c static const struct video_device comp_videodev_template = { · line 369

Quoted 10 lines
drivers/staging/most/video/video.c +0 -0
@@ -365,8 +365,8 @@ static const struct video_device comp_videodev_template = {

 /**************************************************************************/

drivers/staging/most/video/video.c +2 -2
-static struct most_video_dev *get_comp_dev(
-	struct most_interface *iface, int channel_idx)
+static struct most_video_dev *get_comp_dev
+	(struct most_interface *iface, int channel_idx)

This would be better using any of:

(most common)

static struct most_video_dev *get_comp_dev(struct most_interface *iface,
int channel_idx)

or (less common)

static struct most_video_dev *
get_comp_dev(struct most_interface *iface, int channel_idx)

or (> 80 columns)

static struct most_video_dev *get_comp_dev(struct most_interface *iface, int channel_idx)

#2 lore raw

From: Joe Perches

Quoted 6 lines

Sent: 17 December 2020 23:58

Quoted 1 line · Daniel West

Fixed a coding style issue.

It may pass checkpatch without warning, but it's uncommon kernel coding style.

checkpatch probably shouldn't complain about lines that end in ( if they are function definitions.
Even for function calls you would need to reduce the indentation rather than move the (.
You need the xxx( to be together to help grep patterns.

Quoted 21 lines

drivers/staging/most/video/video.c

Quoted 2 lines
drivers/staging/most/video/video.c +0 -0

[]

drivers/staging/most/video/video.c static const struct video_device comp_videodev_template = { · line 371

Quoted 10 lines
drivers/staging/most/video/video.c +2 -2
@@ -365,8 +365,8 @@ static const struct video_device comp_videodev_template = {
 
 
  /**************************************************************************/
 
 
-static struct most_video_dev *get_comp_dev(
-	struct most_interface *iface, int channel_idx)
+static struct most_video_dev *get_comp_dev
+	(struct most_interface *iface, int channel_idx)

This would be better using any of:

(most common)

static struct most_video_dev *get_comp_dev(struct most_interface *iface,
int channel_idx)

Quoted 8 lines

or (less common)

static struct most_video_dev *
get_comp_dev(struct most_interface *iface, int channel_idx)

or (> 80 columns)

static struct most_video_dev *get_comp_dev(struct most_interface *iface, int channel_idx)

Or shorten the variable/type names a bit so it all fits.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

#3 lore raw
Quoted 10 lines · David Laight

From: Joe Perches

Quoted 6 lines

Sent: 17 December 2020 23:58

Quoted 1 line · Daniel West

Fixed a coding style issue.

It may pass checkpatch without warning, but it's uncommon kernel coding style.

checkpatch probably shouldn't complain about lines that end in ( if they are function definitions.

Opinons vary.

Very few function declaration/definitions in the linux kernel use the one line per argument style (gnu indent -bfde)

type function(

	type argument1,
	type argument2,
	...
	)
{
	...
}

It probably shouldn't be encouraged.

Quoted 3 lines
Quoted 2 lines

or (> 80 columns)
static struct most_video_dev *get_comp_dev(struct most_interface *iface, int channel_idx)

Or shorten the variable/type names a bit so it all fits.

Always a possibility but probably not a good one here as even renaming channel_idx to idx doesn't make it < 80 columns

#4 lore raw

From: Joe Perches

Quoted 20 lines

Sent: 18 December 2020 10:09

Quoted 3 lines · David Laight

From: Joe Perches
checkpatch probably shouldn't complain about lines that end in ( if they are function definitions.

Opinons vary.

Very few function declaration/definitions in the linux kernel use the one line per argument style (gnu indent -bfde)

type function(

	type argument1,
	type argument2,
	...
	)
{
	...
}
Quoted 1 line

It probably shouldn't be encouraged.

The only excuse for anything like that is if there are comments for each parameter that are used to generate the interface documentation.

Using that style for function calls just wastes vertical space. At least that doesn't happen in the kernel.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)