media: dvb-core: get rid of mmap reserved field
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 21 Dec 2017 15:57:13 +0000 (10:57 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 28 Dec 2017 16:17:31 +0000 (11:17 -0500)
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 <mchehab@s-opensource.com>
Documentation/media/uapi/dvb/dmx-expbuf.rst
Documentation/media/uapi/dvb/dmx-qbuf.rst
Documentation/media/uapi/dvb/dmx-querybuf.rst
Documentation/media/uapi/dvb/dmx-reqbufs.rst
drivers/media/dvb-core/dvb_vb2.c
include/uapi/linux/dvb/dmx.h

index 51df34c..2d96cfe 100644 (file)
@@ -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`
index b20b815..b48c493 100644 (file)
@@ -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
index 46a50f1..89481e2 100644 (file)
@@ -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.
index 0749623..14b80d6 100644 (file)
@@ -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
index fa1dcde..68c59a4 100644 (file)
@@ -143,7 +143,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);
 }
 
index e212aa1..5f3c5a9 100644 (file)
@@ -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)