From patchwork Thu Dec 21 16:18:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10128027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 503046019C for ; Thu, 21 Dec 2017 16:18:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4375729D48 for ; Thu, 21 Dec 2017 16:18:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3847829D54; Thu, 21 Dec 2017 16:18:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFC7B29D48 for ; Thu, 21 Dec 2017 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753770AbdLUQSu (ORCPT ); Thu, 21 Dec 2017 11:18:50 -0500 Received: from osg.samsung.com ([64.30.133.232]:57210 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275AbdLUQSX (ORCPT ); Thu, 21 Dec 2017 11:18:23 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id EC45F19260; Thu, 21 Dec 2017 08:18:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p275p0XRFXSd; Thu, 21 Dec 2017 08:18:17 -0800 (PST) Received: from smtp.s-opensource.com (unknown [177.159.255.83]) by osg.samsung.com (Postfix) with ESMTPSA id 0BB541921C; Thu, 21 Dec 2017 08:18:14 -0800 (PST) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eS3Xv-0005S2-FX; Thu, 21 Dec 2017 14:18:11 -0200 From: Mauro Carvalho Chehab To: Linux Media Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Linux Doc Mailing List , Seung-Woo Kim , Geunyoung Kim , Junghak Sung , Satendra Singh Thakur Subject: [PATCH 09/11] media: dvb-core: get rid of mmap reserved field Date: Thu, 21 Dec 2017 14:18:08 -0200 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "reserved" field was a way, used at V4L2 API, to add new data to existing structs without breaking userspace. However, there are now clever ways of doing that, without needing to add an uneeded overhead. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab --- Documentation/media/uapi/dvb/dmx-expbuf.rst | 2 -- Documentation/media/uapi/dvb/dmx-qbuf.rst | 2 -- Documentation/media/uapi/dvb/dmx-querybuf.rst | 2 -- Documentation/media/uapi/dvb/dmx-reqbufs.rst | 2 -- drivers/media/dvb-core/dvb_vb2.c | 1 - include/uapi/linux/dvb/dmx.h | 3 --- 6 files changed, 12 deletions(-) diff --git a/Documentation/media/uapi/dvb/dmx-expbuf.rst b/Documentation/media/uapi/dvb/dmx-expbuf.rst index 51df34c6fb59..2d96cfe891df 100644 --- a/Documentation/media/uapi/dvb/dmx-expbuf.rst +++ b/Documentation/media/uapi/dvb/dmx-expbuf.rst @@ -36,8 +36,6 @@ This ioctl is an extension to the memory mapping I/O method. It can be used to export a buffer as a DMABUF file at any time after buffers have been allocated with the :ref:`DMX_REQBUFS` ioctl. -The ``reserved`` array must be zeroed before calling it. - To export a buffer, applications fill struct :c:type:`dmx_exportbuffer`. Applications must set the ``index`` field. Valid index numbers range from zero to the number of buffers allocated with :ref:`DMX_REQBUFS` diff --git a/Documentation/media/uapi/dvb/dmx-qbuf.rst b/Documentation/media/uapi/dvb/dmx-qbuf.rst index b20b8153d48d..b48c4931658e 100644 --- a/Documentation/media/uapi/dvb/dmx-qbuf.rst +++ b/Documentation/media/uapi/dvb/dmx-qbuf.rst @@ -45,8 +45,6 @@ numbers range from zero to the number of buffers allocated with one. The contents of the struct :c:type:`dmx_buffer` returned by a :ref:`DMX_QUERYBUF` ioctl will do as well. -The and ``reserved`` field must be set to 0. - When ``DMX_QBUF`` is called with a pointer to this structure, it locks the memory pages of the buffer in physical memory, so they cannot be swapped out to disk. Buffers remain locked until dequeued, until the diff --git a/Documentation/media/uapi/dvb/dmx-querybuf.rst b/Documentation/media/uapi/dvb/dmx-querybuf.rst index 46a50f191b10..89481e24bb86 100644 --- a/Documentation/media/uapi/dvb/dmx-querybuf.rst +++ b/Documentation/media/uapi/dvb/dmx-querybuf.rst @@ -36,8 +36,6 @@ This ioctl is part of the mmap streaming I/O method. It can be used to query the status of a buffer at any time after buffers have been allocated with the :ref:`DMX_REQBUFS` ioctl. -The ``reserved`` array must be zeroed before calling it. - Applications set the ``index`` field. Valid index numbers range from zero to the number of buffers allocated with :ref:`DMX_REQBUFS` (struct :c:type:`dvb_requestbuffers` ``count``) minus one. diff --git a/Documentation/media/uapi/dvb/dmx-reqbufs.rst b/Documentation/media/uapi/dvb/dmx-reqbufs.rst index 0749623d9d83..14b80d60bf35 100644 --- a/Documentation/media/uapi/dvb/dmx-reqbufs.rst +++ b/Documentation/media/uapi/dvb/dmx-reqbufs.rst @@ -42,8 +42,6 @@ allocated by applications through a device driver, and this ioctl only configures the driver into DMABUF I/O mode without performing any direct allocation. -The ``reserved`` array must be zeroed before calling it. - To allocate device buffers applications initialize all fields of the struct :c:type:`dmx_requestbuffers` structure. They set the ``count`` field to the desired number of buffers, and ``size`` to the size of each diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c index 277d33b83089..7b1663f64e84 100644 --- a/drivers/media/dvb-core/dvb_vb2.c +++ b/drivers/media/dvb-core/dvb_vb2.c @@ -140,7 +140,6 @@ static void _fill_dmx_buffer(struct vb2_buffer *vb, void *pb) b->length = vb->planes[0].length; b->bytesused = vb->planes[0].bytesused; b->offset = vb->planes[0].m.offset; - memset(b->reserved, 0, sizeof(b->reserved)); dprintk(3, "[%s]\n", ctx->name); } diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h index e212aa18ad78..5f3c5a918f00 100644 --- a/include/uapi/linux/dvb/dmx.h +++ b/include/uapi/linux/dvb/dmx.h @@ -229,7 +229,6 @@ struct dmx_buffer { __u32 bytesused; __u32 offset; __u32 length; - __u32 reserved[4]; }; /** @@ -244,7 +243,6 @@ struct dmx_buffer { struct dmx_requestbuffers { __u32 count; __u32 size; - __u32 reserved[2]; }; /** @@ -266,7 +264,6 @@ struct dmx_exportbuffer { __u32 index; __u32 flags; __s32 fd; - __u32 reserved[5]; }; #define DMX_START _IO('o', 41)