Message ID | 1415369269-5064-11-git-send-email-boris.brezillon@free-electrons.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1XmkEe-0004p6-Uf; Fri, 07 Nov 2014 15:09:56 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1XmkEd-0002Pc-3S; Fri, 07 Nov 2014 15:09:56 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbaKGOIu (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 7 Nov 2014 09:08:50 -0500 Received: from down.free-electrons.com ([37.187.137.238]:59139 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752015AbaKGOID (ORCPT <rfc822; linux-media@vger.kernel.org>); Fri, 7 Nov 2014 09:08:03 -0500 Received: by mail.free-electrons.com (Postfix, from userid 106) id 218B2742; Fri, 7 Nov 2014 15:08:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 69FF973F; Fri, 7 Nov 2014 15:08:02 +0100 (CET) From: Boris Brezillon <boris.brezillon@free-electrons.com> To: Mauro Carvalho Chehab <m.chehab@samsung.com>, Hans Verkuil <hans.verkuil@cisco.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, linux-media@vger.kernel.org, Sakari Ailus <sakari.ailus@iki.fi> Cc: linux-arm-kernel@lists.infradead.org, linux-api@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Guennadi Liakhovetski <g.liakhovetski@gmx.de>, Boris Brezillon <boris.brezillon@free-electrons.com> Subject: [PATCH v3 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Date: Fri, 7 Nov 2014 15:07:49 +0100 Message-Id: <1415369269-5064-11-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415369269-5064-1-git-send-email-boris.brezillon@free-electrons.com> References: <1415369269-5064-1-git-send-email-boris.brezillon@free-electrons.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.11.7.135722 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_RCPTS_TO_X5 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Boris BREZILLON
Nov. 7, 2014, 2:07 p.m. UTC
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(+)
Comments
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." > + */ > + > #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. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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
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 + * MEDIA_BUS_FMT_ defintions (defined in media-bus-format.h) should be + * used instead. + */ + #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