linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: Re: [PATCH 2/8] media: v4l2-ioctl.h: convert debug into an enum of bits
Date: Tue, 19 Dec 2017 16:05:46 +0200	[thread overview]
Message-ID: <1829332.DyU8Vvd1sp@avalon> (raw)
In-Reply-To: <1615432.c1z8s9p1mm@avalon>

On Tuesday, 19 December 2017 16:02:02 EET Laurent Pinchart wrote:
> On Tuesday, 19 December 2017 13:39:27 EET Sakari Ailus wrote:
> > Hi Mauro,
> > 
> > On Mon, Dec 18, 2017 at 05:53:56PM -0200, Mauro Carvalho Chehab wrote:
> > > The V4L2_DEV_DEBUG_IOCTL macros actually define a bitmask,
> > > but without using Kernel's modern standards. Also,
> > > documentation looks akward.
> > > 
> > > So, convert them into an enum with valid bits, adding
> > > the correspoinding kernel-doc documentation for it.
> > 
> > The pattern of using bits for flags is a well established one and I
> > wouldn't deviate from that by requiring the use of the BIT() macro. There
> > are no benefits that I can see from here but the approach brings
> > additional
> > risks: misuse of the flags and mimicing the same risky pattern.
> > 
> > I'd also like to echo Laurent's concern that code is being changed in odd
> > ways and not for itself, but due to deficiencies in documentation tools.
> > 
> > I believe the tooling has to be improved to address this properly. That
> > only needs to done once, compared to changing all flag definitions to
> > enums.
> 
> That's my main concern too. We really must not sacrifice code readability or
> writing ease in order to work around limitations of the documentation
> system. For this reason I'm strongly opposed to patches 2 and 5 in this
> series.

And I forgot to mention patch 8/8. Let's drop those three and improve the 
documentation system instead.

> > Another point I want to make is that the uAPI definitions cannot be
> > changed: enums are thus an option in kAPI only.
> 
> And furthermore using enum types in the uAPI is a bad idea as the enum size
> is architecture-dependent. That's why we use integer types in structures
> used as ioctl arguments.
> 
> > Improved KernelDoc tools would thus also allow improving uAPI macro
> > documentation --- which is more important anyway.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2017-12-19 14:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1513625884.git.mchehab@s-opensource.com>
2017-12-18 19:53 ` [PATCH 1/8] media: v4l2-device.h: document helper macros Mauro Carvalho Chehab
2017-12-18 19:53 ` [PATCH 2/8] media: v4l2-ioctl.h: convert debug into an enum of bits Mauro Carvalho Chehab
2017-12-19 11:39   ` Sakari Ailus
2017-12-19 14:02     ` Laurent Pinchart
2017-12-19 14:05       ` Laurent Pinchart [this message]
2017-12-19 15:34         ` Mauro Carvalho Chehab
2017-12-20 10:47           ` Laurent Pinchart
2017-12-20 13:34             ` Mauro Carvalho Chehab
2017-12-19 14:12       ` Sakari Ailus
2017-12-19 15:37         ` Mauro Carvalho Chehab
2017-12-19 17:17           ` Laurent Pinchart
2017-12-19 19:20             ` Mauro Carvalho Chehab
2017-12-18 19:53 ` [PATCH 3/8] media: v4l2-async: simplify v4l2_async_subdev structure Mauro Carvalho Chehab
2017-12-18 20:01   ` Benoit Parrot
2017-12-18 22:27   ` Alexandre Belloni
2017-12-19  8:27   ` Sakari Ailus
2017-12-19  9:16   ` Philipp Zabel
2017-12-18 19:53 ` [PATCH 4/8] media: v4l2-async: better describe match union at async match struct Mauro Carvalho Chehab
2017-12-18 19:53 ` [PATCH 5/8] media: v4l2-mediabus: convert flags to enums and document them Mauro Carvalho Chehab
2017-12-19  9:30   ` Philipp Zabel
2017-12-19 11:11     ` Mauro Carvalho Chehab
2017-12-18 19:54 ` [PATCH 6/8] media: v4l2-subdev: get rid of __V4L2_SUBDEV_MK_GET_TRY() macro Mauro Carvalho Chehab
2017-12-18 19:54 ` [PATCH 7/8] media: v4l2-subdev: document remaining undocumented functions Mauro Carvalho Chehab
2017-12-18 19:54 ` [PATCH 8/8] media: v4l2-subdev: use kernel-doc markups to document subdev flags 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=1829332.DyU8Vvd1sp@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@infradead.org \
    --cc=mchehab@s-opensource.com \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.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).