From patchwork Mon Dec 26 20:51:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9488797 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 4558160839 for ; Mon, 26 Dec 2016 20:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 373A41FF35 for ; Mon, 26 Dec 2016 20:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A4921FFBD; Mon, 26 Dec 2016 20:52:16 +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 D0D8F1FF35 for ; Mon, 26 Dec 2016 20:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755786AbcLZUvy (ORCPT ); Mon, 26 Dec 2016 15:51:54 -0500 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 Received: from [192.168.1.2] ([77.182.133.191]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MIeQO-1cNpA31Hz6-002EDw; Mon, 26 Dec 2016 21:51:23 +0100 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <9268b60d-08ba-c64e-1848-f84679d64f80@users.sourceforge.net> X-Provags-ID: V03:K0:ZCXr3Eaa/4BPYcjBGftXxtdBBqJJ6FO8qnbtuwKoou+FTtPaOXc prn12DqU0dwAm5T/RCES4mdG7x5FpqD7FApB+NavK+ctbxgZtIS2spzAnCsfVGshpw+wU5g Ul55jbGHGJFCdiTvCmkc11OU0Hegxfn0D+OjgsyGWJ5qFTVXVAc/zmAlrQrxni7DggzPnja P9+d8mDjjt1hfPESYdmsA== X-UI-Out-Filterresults: notjunk:1; V01:K0:3H62EuRARcs=:lFi/hcIRS6O1uQdoUOjFxS PN2Qugkivc4JTUOGi25LGSMrk9ylS0TbdnVSqUpagQxWDS4gaPm8gNcJ/dO1pOalzMsmr6Pds cMO5BxrfjYSphNykhygGgZjZQjUaGIE/pIIC8IWubEeVYRNo3MD25D+eG91AFq6BEV0Wl8D1j zFPXjfv+SLTegnHslC+6PEXmQ87lVwYYZu06/oI74TvcubqKCo7d1qFmyqC5UQBCKrlLCgO3y lmiIxxyaoWhV0JdQJcdWX5DfBt5dsZ7b4ElWI4x2kV15zDq7m1wFiYezU8bHuAE/Ttdj3rGzD pBQCbvZuLYtIwLyK9mD0FpftOGiTE4YkkEQGdm9YvJIgoxwYBMHvyMmwQzYBlovJsTXcv1Z/p /B2nPC6gVuWw8Y99VdW85M3XurDzy/mQ84f6Z5ikbb+rfaZXjgmHWVAcAau9uyO1X2msaPDOh bKY5l7sicCMoXF/Q6lIfp3pv+pS1God33Lz29PIwP1go1kqJ2+bECXrfJ64Ay6YRoEXFnlFwo GClgbL69LujBLWOBk5Z0g21YGOdeWAkcfAeMswUwGKhDRAmBKb9l8sjdQBmqoxthhwQKkDJEg zITcypEJLGbda18aySyV+O4s4Ntok8ld9Vy0zSFYr9fqyk2RiGZBYpFD0pl0lsuGP1RKv/CgX QHhN1+Y2f5r7/hzIWPTdKoG/3xA/yLFFO0Jogylv1yrQbVp8ZRE+7mMnSzkYJxOaQxcM1ge61 bCtmoueY9/5ovnKYq11q+sHxstqgCJTuxjcxO04uiFjaYTVL0rLZ1a36SXjIF6Gs/3Oy6RMcS cIHyR8W 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 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;