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: 10075539 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 C3BD1602BD for ; Sun, 26 Nov 2017 20:44:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8B4C28AB4 for ; Sun, 26 Nov 2017 20:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADCD828AB6; Sun, 26 Nov 2017 20:44:07 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B4F5228AB4 for ; Sun, 26 Nov 2017 20:44:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C091890B9; Sun, 26 Nov 2017 20:44:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D3C4890B9 for ; Sun, 26 Nov 2017 20:44:01 +0000 (UTC) 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 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= Cc: kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;