From patchwork Fri Sep 8 20:52:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9945027 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 7131D604D4 for ; Fri, 8 Sep 2017 20:53:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6433A205A4 for ; Fri, 8 Sep 2017 20:53:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 593DB28901; Fri, 8 Sep 2017 20:53:24 +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=unavailable 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 09D2C205A4 for ; Fri, 8 Sep 2017 20:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595AbdIHUxJ (ORCPT ); Fri, 8 Sep 2017 16:53:09 -0400 Received: from mout.web.de ([212.227.17.12]:53773 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932214AbdIHUxH (ORCPT ); Fri, 8 Sep 2017 16:53:07 -0400 Received: from [192.168.1.2] ([92.228.166.205]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lhvlm-1d3fBS19Eo-00n5KU; Fri, 08 Sep 2017 22:52:32 +0200 Subject: [PATCH 2/3] [media] s5p-mfc: Improve a size determination in s5p_mfc_alloc_memdev() From: SF Markus Elfring To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, Andrzej Hajda , Jeongtae Park , Kamil Debski , Kyungmin Park , Marek Szyprowski , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <482a6c92-a85e-0bcd-edf7-3c2f63ea74c5@users.sourceforge.net> Message-ID: <003abb1f-4dc6-91ca-9d03-cae13dc4ff6f@users.sourceforge.net> Date: Fri, 8 Sep 2017 22:52:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <482a6c92-a85e-0bcd-edf7-3c2f63ea74c5@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:6VemIDPuFiCtm/88OYBveSuRzRal9WdesAXet13nnYg8WOhp5MD GUGMl/BKrKl3hJ7CCnvs+ZKbODk5R3Cp7cA1s1OhJPjBXls2HQlDtiewgBq0FhBnBGyXyAD 3rIlh1n75tmLbobglvcQ0Yyat4dJopaOXsCniVQr6iW0+8UBfG1BOvwUBfF3oi8xIqcyN+R 5Y6fj/SyokcPfK1Tr11UA== X-UI-Out-Filterresults: notjunk:1; V01:K0:v13Zv+nBrfw=:u32zxPzK7O9Ly0lXhvsBO6 CO4VEajzce3YU3jUscJBmS+qjXIzOhoq5+vDcUDZeYQ7+2pjLKRKGgQ6pvBNW/VuxOzjl0GUQ 0+jHQHp+5fKFtE++u7c8aT/UG3jGVGXZcSb2U9+H1DW/1hVbyemLN4yhD06GzIO0divloj0vF SYBY7ieF39yjLfx3oKJA/KGEdVHfKkZfZPX3Uf8/to4dq9YhUlmRt6ToFrzTbXDfcbQppF+bH eKD3S4CxOR2Dgu7G3lHb5DnzuNNX4X08x8T8hYj3+qWgO/azYBepPicAAsnByeHi+hG7KMrxh OWFBwNRfeukgU6tLk2g+cL6LRpZqMc6kNuGo1XDEQhPAGyG6HJdY1LaDP/Pmcc6kb3i5UOuV8 wDqp3LNOXOlle1XapnsHehpc4jsT4VzbIkdJfZU3KBahhpN4d56bIsPa4U/qFqTBXvIqktckB q7vNkdHVpsRM10RvaZYWMddGEuxZP2rJrUCuMprR7kyYRX/g6Z1HZktu7bGOqzImKVmDzbHAP 76td8oeIhZcw1rg96EFHmSbsB6eaIdkCmrvjaWn1wmHWXWPRCHHnduhLKhyXepGBwQykrKWQb 25ypK4EiyYd3ROj4BCdIvHL5xf30Q6pJiI+6eD3aLqgOVxaCpvZJRJQI/ByiFAstEJyKw7bMT odLkErmG3XmdhtyzudSJJfpkggh39eY22Dk+JkPmsIfYzGA5+Gwdec+asM0KMvtg7aGH4iFuP QFyxz0spsw4jCysS7GBbfhVp14nU3mncrDpkRgg73D3cC3KfMk1vGJYGt7X+ohq7bXoSYxwLL wTkz/D2FCAQWcTh6yGIqmwhzSgNpGLewbboLTbp15poBXIrunc= 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: Fri, 8 Sep 2017 22:30:09 +0200 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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Sylwester Nawrocki --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 8af45d53846f..abfb70b07032 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1083,7 +1083,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, struct device *child; int ret; - child = devm_kzalloc(dev, sizeof(struct device), GFP_KERNEL); + child = devm_kzalloc(dev, sizeof(*child), GFP_KERNEL); if (!child) return NULL;