From patchwork Sun Nov 26 20:43:52 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: 10075537 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 45C37602BD for ; Sun, 26 Nov 2017 20:44:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39AEF28AB5 for ; Sun, 26 Nov 2017 20:44:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D72B28AB7; Sun, 26 Nov 2017 20:44:06 +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 DA92728AB5 for ; Sun, 26 Nov 2017 20:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751662AbdKZUoF (ORCPT ); Sun, 26 Nov 2017 15:44:05 -0500 Received: from mout.web.de ([212.227.15.3]:64274 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbdKZUoE (ORCPT ); Sun, 26 Nov 2017 15:44:04 -0500 Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MFcPd-1eOGK41XJV-00EdVy; Sun, 26 Nov 2017 21:43:53 +0100 Subject: [PATCH 2/2] video: fbdev-MMP: Improve a size determination in path_init() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <293fb9cb-3020-bded-b1bd-67bbb2820aa2@users.sourceforge.net> Date: Sun, 26 Nov 2017 21:43:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:BZFHVDuxf8IGBn2GxI6KWKVrI4ILVxPVlbeVjOCyK94jR6jeSHb yCZ5S+ca8Guiv5537EvL9XLplnypHFDQqUxFPEL3oXifOQdMO7vnvoZxQCDMrWgZSw0qDqP u+Ygki6nRF7D9bPI4xKDZOcSI6c8REUnp5zBOpeXs76aXl05WLFikvluZWEDNv1p0ztmwYC stq9ZEFuOKsIASMzLgzoA== X-UI-Out-Filterresults: notjunk:1; V01:K0:yomNqRysLDk=:uYYFjveUC0QY74ylsAgaTZ ir0RiexjmeQyfWlYjRhEI8QqEK+gDBfTAon0CnAHcNS2WXJgqVjaiMTqm8Zq6oQDHf3wOg6u1 pU69PQQ/IKaR3g1z4jZNgREEDbjvy6D8YogY0XEg1eNK18sNZHN3XfJG/KSsk36JiDePov5FA 3ZQuf7dba8HL1Pivj6aDtUUiUvbn5PD8BcVcgGUnaPYeuT5ejTrcRQXOvPioAAGSye6CKd53Q gkFZ63ARrp9Z6S/JWttFq3eso4go04As+Ah+FADXwUbecSeB+BiqYBs/GXjMGbcpIP8q1pTx+ ha72uNMJ1d1jCoX9YU8aMGgOlwPpAGdCuszQaNG18rbmvP7evBESr6REtIDzjrNnFrA3ec3M4 wrhq1CzJNtdSZ16pvTIe4UACMJdMCiTcMRXoo7uORlug16i3OqHUiBE2izHnG8v9bo2+LDUbn eRf7QkiwFs9D4ITd4AnRv+48IRDfDd/ZolM1eSowXs1l+jw0xQcsiiaBS+C7ha0L5xeJLFWDW g6ER7dM9V8nwVql5lyjB3iDTHzNPnl/tSEghVdOX0wmIatLMgXLFiyfIQ+F83nMpCRC5pbCcY jOS3TfD4i/+mXEoFCOz/iYyeRUL9pModS5fWjmCVm35mJi5sNW+zNpXZGbvf3eM74kJH4lDkk 1vtSHBYAYinvf0m9vTWmkOvHKm6/GduTXTbDvK+IOsxPcEmw09YTwrzGG0PGI/4ZfVDrZmIsG jHMr42/Lc503NkN3jKTo3InSmFEFwD6Xrd/U4f+6w/N5Hj/WDlxVswB55x9WBUYCEANynoIYi jgmnbA00U2Lf6lZsqQ4YfGpNMxBjQAN46YRpIvf00BbeadTln8= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 26 Nov 2017 21:21:33 +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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 9f912ea0bfce..fcdbb2df137f 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -406,7 +406,7 @@ static int path_init(struct mmphw_path_plat *path_plat, dev_info(ctrl->dev, "%s: %s\n", __func__, config->name); /* init driver data */ - path_info = kzalloc(sizeof(struct mmp_path_info), GFP_KERNEL); + path_info = kzalloc(sizeof(*path_info), GFP_KERNEL); if (!path_info) return 0;