linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Antti Palosaari <crope@iki.fi>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Nick Dyer <nick@shmanahar.org>, Shuah Khan <shuah@kernel.org>,
	Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Subject: Re: [PATCH v2 50/58] v4l2-core: don't break long lines
Date: Wed, 19 Oct 2016 07:56:52 -0200	[thread overview]
Message-ID: <20161019075652.36f59b7b@vento.lan> (raw)
In-Reply-To: <20161019070916.GQ9460@valkosipuli.retiisi.org.uk>

Em Wed, 19 Oct 2016 10:09:16 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> On Tue, Oct 18, 2016 at 06:46:02PM -0200, Mauro Carvalho Chehab wrote:
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> > index c52d94c018bb..26fe7aef1196 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -174,8 +174,7 @@ static void v4l_print_querycap(const void *arg, bool write_only)
> >  {
> >  	const struct v4l2_capability *p = arg;
> >  
> > -	pr_cont("driver=%.*s, card=%.*s, bus=%.*s, version=0x%08x, "
> > -		"capabilities=0x%08x, device_caps=0x%08x\n",
> > +	pr_cont("driver=%.*s, card=%.*s, bus=%.*s, version=0x%08x, capabilities=0x%08x, device_caps=0x%08x\n",
> >  		(int)sizeof(p->driver), p->driver,
> >  		(int)sizeof(p->card), p->card,
> >  		(int)sizeof(p->bus_info), p->bus_info,  
> 
> I still wouldn't do this to v4l2-ioctl.c. It does not improve grappability
> because of the format strings. 

The main reason that made me do this patch series is to identify the lack
of KERN_CONT at the media subsystem.

The grep I'm using to identify missing KERN_CONT lines actually tests
for a string line that doesn't end with "\n", like:

	$ git grep '("' drivers/media/|grep -v KERN_|grep -v '\\n'|grep -v MODULE

That's said, the format strings don't hurt grep:

	$ git grep -E "driver=.*bus=.*device_caps="
	drivers/media/v4l2-core/v4l2-ioctl.c:   pr_cont("driver=%.*s, card=%.*s, bus=%.*s, version=0x%08x, capabilities=0x%08x, device_caps=0x%08x\n",

> Some are also really long such as the one a
> few chunks below.

Yeah, but it gives a bad coding style example. I prefer to have the core
subsystem as close as possible of the coding style I would like to see
at the drivers code I review. Btw, at least on my 1920x1050 monitor,
if I open a console full screen, only one line of v4l2-ioctl.c is bigger
than the terminal column size.

> Other than that, this looks very nice now. Your script makes me wonder,
> though, whether there should be a tool to automatically improve coding style
> for cases such as this. I didn't realise so many strings were actually
> split. I'm sure also the rest of the kernel would benefit from such a tool.
> With the increased number of lines of code, the special cases that need to
> be handled manually must decrease as well or it becomes unfeasible.

Yeah, I was also thinking that there would be a way less places than
what it was hit by this script.

The script on this patch is generic enough to be used to fix such cases
on other subsystems, although it needs some polish to cover a few corner
cases. I suspect it shouldn't be hard to integrate it to checkpatch.pl
to be used with --fix.

Thanks,
Mauro

  reply	other threads:[~2016-10-19 14:43 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 20:45 [PATCH v2 00/58] don't break long lines on strings Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 01/58] b2c2: don't break long lines Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 02/58] cx25840: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 03/58] smiapp: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 04/58] soc_camera: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 05/58] b2c2: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 06/58] bt8xx: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 07/58] cx18: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 08/58] cx23885: " Mauro Carvalho Chehab
2016-10-19  7:36   ` Hans Verkuil
2016-10-18 20:45 ` [PATCH v2 09/58] cx88: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 10/58] ddbridge: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 11/58] dm1105: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 12/58] ivtv: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 13/58] meye: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 14/58] pt1: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 15/58] saa7134: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 16/58] saa7164: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 17/58] solo6x10: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 18/58] ttpci: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 19/58] tw68: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 20/58] davinci: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 21/58] exynos4-is: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 22/58] marvell-ccic: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 23/58] omap: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 24/58] omap3isp: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 25/58] s5p-mfc: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 26/58] c8sectpfe: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 27/58] ti-vpe: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 28/58] si470x: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 29/58] si4713: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 30/58] wl128x: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 31/58] au0828: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 32/58] b2c2: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 33/58] cpia2: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 34/58] cx231xx: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 35/58] dvb-usb: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 36/58] dvb-usb-v2: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 37/58] em28xx: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 38/58] gspca: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 39/58] hdpvr: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 40/58] pvrusb2: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 41/58] pwc: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 42/58] siano: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 43/58] stkwebcam: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 44/58] tm6000: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 45/58] ttusb-budget: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 46/58] ttusb-dec: " Mauro Carvalho Chehab
2016-10-18 20:45 ` [PATCH v2 47/58] usbvision: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 48/58] uvc: " Mauro Carvalho Chehab
2016-10-20 11:06   ` Laurent Pinchart
2016-10-21 10:13     ` Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 49/58] zr364xx: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 50/58] v4l2-core: " Mauro Carvalho Chehab
2016-10-19  7:09   ` Sakari Ailus
2016-10-19  9:56     ` Mauro Carvalho Chehab [this message]
2016-10-18 20:46 ` [PATCH v2 51/58] dvb-frontends: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 52/58] common: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 53/58] firewire: " Mauro Carvalho Chehab
2016-10-18 23:03   ` Takashi Sakamoto
2016-10-19  7:56     ` Stefan Richter
2016-10-19 10:20       ` Mauro Carvalho Chehab
2016-10-19 10:19     ` Mauro Carvalho Chehab
2016-10-19 22:55       ` Stefan Richter
     [not found]   ` <20161019100113.077e60f1@kant>
2016-10-19 10:10     ` Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 54/58] i2c: " Mauro Carvalho Chehab
2016-10-19 18:16   ` Lad, Prabhakar
2016-10-20 10:46   ` Laurent Pinchart
2016-10-21 10:25     ` Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 55/58] platform: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 56/58] radio: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 57/58] rc: " Mauro Carvalho Chehab
2016-10-18 20:46 ` [PATCH v2 58/58] tuners: " Mauro Carvalho Chehab

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=20161019075652.36f59b7b@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=crope@iki.fi \
    --cc=guennadi.liakhovetski@intel.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@infradead.org \
    --cc=mchehab@kernel.org \
    --cc=nick@shmanahar.org \
    --cc=pawel@osciak.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shuah@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;
as well as URLs for NNTP newsgroup(s).