public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
Date: Fri, 7 Nov 2014 16:31:41 +0100	[thread overview]
Message-ID: <20141107163141.3866f3c4@bbrezillon> (raw)
In-Reply-To: <545CDB8D.4080406@xs4all.nl>

On Fri, 07 Nov 2014 15:47:41 +0100
Hans Verkuil <hverkuil@xs4all.nl> wrote:

> Nitpicks:
> 
> On 11/07/14 15:07, Boris Brezillon wrote:
> > Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel
> > users don't have access to these definitions.
> > 
> > We have to keep this definition for user-space users even though they're
> > encouraged to move to the new media_bus_format enum.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > ---
> >  include/uapi/linux/v4l2-mediabus.h | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
> > index 3d87db7..4f31d0e 100644
> > --- a/include/uapi/linux/v4l2-mediabus.h
> > +++ b/include/uapi/linux/v4l2-mediabus.h
> > @@ -15,6 +15,14 @@
> >  #include <linux/videodev2.h>
> >  #include <linux/media-bus-format.h>
> >  
> > +#ifndef __KERNEL__
> > +
> > +/*
> > + * enum v4l2_mbus_pixelcode and its defintions are now deprecated, and
> 
> defintions -> definitions
> 
> > + * MEDIA_BUS_FMT_ defintions (defined in media-bus-format.h) should be
> 
> and again...
> 
> > + * used instead.
> 
> I would also add something like this:
> 
> "New defines should only be added to media-bus-format.h. The v4l2_mbus_pixelcode
> enum is frozen."

I'll fix those typos and add this sentence.

> 
> > + */
> > +
> >  #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name)	\
> >  	MEDIA_BUS_FMT_ ## name = V4L2_MBUS_FMT_ ## name
> >  
> > @@ -102,6 +110,7 @@ enum v4l2_mbus_pixelcode {
> >  
> >  	V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32),
> >  };
> > +#endif /* __KERNEL__ */
> >  
> >  /**
> >   * struct v4l2_mbus_framefmt - frame format on the media bus
> > 
> 
> Can you move this struct forward to before the v4l2_mbus_pixelcode enum? That way
> the obsolete code is at the end of the header. People might miss this struct
> otherwise.

Sure.

Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2014-11-07 15:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 14:07 [PATCH v3 00/10] [media] Make mediabus format subsystem neutral Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 01/10] [media] Move mediabus format definition to a more standard place Boris Brezillon
2014-11-07 15:24   ` Sakari Ailus
2014-11-07 16:09     ` Boris Brezillon
2014-11-07 16:28     ` [PATCH v4 " Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 02/10] [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 03/10] [media] Make use of the new media_bus_format definitions Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 04/10] [media] i2c: Make use of media_bus_format enum Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 05/10] [media] pci: Make use of MEDIA_BUS_FMT definitions Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 07/10] [media] usb: Make use of media_bus_format enum Boris Brezillon
2014-11-07 14:07 ` [PATCH v3 08/10] staging: media: Make use of MEDIA_BUS_FMT_ definitions Boris Brezillon
2014-11-08  9:11   ` Prabhakar Lad
2014-11-07 14:07 ` [PATCH v3 09/10] gpu: ipu-v3: Make use of media_bus_format enum Boris Brezillon
2014-11-07 15:05   ` Philipp Zabel
2014-11-07 14:07 ` [PATCH v3 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Boris Brezillon
2014-11-07 14:47   ` Hans Verkuil
2014-11-07 15:31     ` Boris Brezillon [this message]
2014-11-07 16:27     ` [PATCH v4 " Boris Brezillon
2014-11-07 22:47       ` Sakari Ailus
2014-11-08  0:38         ` Boris Brezillon
2014-11-07 14:51 ` [PATCH v3 00/10] [media] Make mediabus format subsystem neutral Hans Verkuil
     [not found] ` <1415369269-5064-7-git-send-email-boris.brezillon@free-electrons.com>
2014-11-08  9:18   ` [PATCH v3 06/10] [media] platform: Make use of media_bus_format enum Prabhakar Lad
2014-11-11  4:42     ` Sekhar Nori
2014-11-11  7:49       ` Sekhar Nori
2014-11-08 15:47 ` [PATCH v5 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Boris Brezillon
2014-11-10 11:09   ` Hans Verkuil
2014-11-10 17:02     ` Boris Brezillon

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=20141107163141.3866f3c4@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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