From: Markus Elfring <elfr...@users.sourceforge.net>
Date: Mon, 26 Dec 2016 20:56:41 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>
---
 drivers/media/v4l2-core/videobuf-dma-sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c 
b/drivers/media/v4l2-core/videobuf-dma-sg.c
index d09ddf2e56fe..070ba10bbdbc 100644
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c
+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -618,7 +618,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
        last = first;
 
        /* create mapping + update buffer list */
-       map = kmalloc(sizeof(struct videobuf_mapping), GFP_KERNEL);
+       map = kmalloc(sizeof(*map), GFP_KERNEL);
        if (!map) {
                retval = -ENOMEM;
                goto done;
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to