RE: [PATCH] staging: most: video: fixed a parentheses coding style issue.

From: David Laight
Date: Fri Dec 18 2020 - 04:51:20 EST


From: Joe Perches
> Sent: 17 December 2020 23:58
>
> On Thu, 2020-12-17 at 15:45 -0800, Daniel West wrote:
> > 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.

>
> > diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> []
> > @@ -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)
>
> 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)