From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.web.de ([217.72.192.78]:63464 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755778AbcLZUvw (ORCPT ); Mon, 26 Dec 2016 15:51:52 -0500 Subject: [PATCH 6/8] [media] videobuf-dma-sg: Improve a size determination in __videobuf_mmap_mapper() To: linux-media@vger.kernel.org, Dave Hansen , Jan Kara , Javier Martinez Canillas , "Kirill A. Shutemov" , Lorenzo Stoakes , Mauro Carvalho Chehab , Michal Hocko , Sakari Ailus References: <9268b60d-08ba-c64e-1848-f84679d64f80@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <4e7808c8-7619-3a95-a7da-0399f6558dfc@users.sourceforge.net> Date: Mon, 26 Dec 2016 21:51:17 +0100 MIME-Version: 1.0 In-Reply-To: <9268b60d-08ba-c64e-1848-f84679d64f80@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: From: Markus Elfring 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 --- 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