Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934695AbeAHQSD (ORCPT + 1 other); Mon, 8 Jan 2018 11:18:03 -0500 Received: from mout.web.de ([212.227.15.4]:55190 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932349AbeAHQSB (ORCPT ); Mon, 8 Jan 2018 11:18:01 -0500 Subject: [PATCH 3/4] misc/ioc4: Improve a size determination in ioc4_probe() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Andrew Morton , Arnd Bergmann , Brent Casavant , Greg Kroah-Hartman , Jeremy Higdon , Pat Gefre Cc: LKML References: <4fb26753-2ae3-7c17-7777-03c6923a1d4b@users.sourceforge.net> Message-ID: <85565afd-5995-83d3-0e7e-3441eeb298c3@users.sourceforge.net> Date: Mon, 8 Jan 2018 17:17:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <4fb26753-2ae3-7c17-7777-03c6923a1d4b@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Pnkw0uYVEEKHygiYd7iyixTRwG6HbRWxRjBIISoW0aPJIsPeZFz vsWD0hhp4PyDKJuUZKy+m0P6nVCooUw+pP8DJOIBpbg37nh6gOi74ZDBX+GiWBkFWXCI56l QjGOy6TQTlD/R6G8wHOSzwCmNyOHyX8t/4Zns9gpMeFvywy/941AFntXbOBGhd22Qbc0UrW PlVNly39TFQZ8w9gmPqUA== X-UI-Out-Filterresults: notjunk:1;V01:K0:7OEx0fGq4/k=:023r9lTr54837rjjaAKgKp yF00HgcFZhCaOVC/8xnMVikvDLCI7a8l1Bu/gEPXD8R0Kbz0qGrPZDfM6k6hztmR5K0OJma/T hgv7rKnlO4v5/VRX8BXki5t3NsSn4dVMyKjjEiUIgYzeO9FcrAFVmLyG1AmfbL7op5BemeFND FAJIbUBlflVzbtvY0Rn7Vz/DP+YiVIaHoajrSjX8n393BZyYdYICGBIoezBUCI+iQQ5W91pJn 6+W/CgJf/fP8ZKMJzhU1lm7qXvnhbYi8Yj/fWFell+RXlc0gEnA+dwnDMnCfejrlweEDq1sEY X8FN+3PIzueV8L0Rcg5yaYZT9sEzTwGyGAQG0WIev0Mpbhw5dSY57S4piuaS4AaVuiBof3vSK HwiG7FpPi6VKt3qAxI4WWGVaPtahcueglqu8Jp26yhRizZw96AqfZoQUImxk00jxmVXCr73P7 g9583s/IanBJPf8d4hZHHE8yAXe9s3GbT/2GK22r3Tntm67pCNXjf3bomPuLw0u0gva4L045n m7wfqusNPrZjMaNyFetSP34XUinXwuDSJCu7czxXTVe9aXCQNBv8dFcu8Y1gzYCtHDYUNhLQH Dm6lOK34NVlKsJcG3TVmQTT0+UBbeh6fqdu+uffI8FWq4HmERsU00V0H6yx5148ax0+ajW7sR 4lAle4Ojc2jM4NH2WcaAV6CLHrE2X8MkIOKBanDjU/ZORFIQYJd5z/4NXfGuF4mCtBp7jUToB AorG7EPG0awxKSOjmyG0Q2lBFUeh3xU2mn8kGNEkClH4vNUAg3V9gE8ZPRVh07/s9I2sEgPdm 6S15CDXqZ4TsLNbyzvtdhm94ASwXnW/S7IEqSUqkGEEwdkgWSQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Mon, 8 Jan 2018 16:18:52 +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/misc/ioc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c index 5bd422498fff..704e13382df0 100644 --- a/drivers/misc/ioc4.c +++ b/drivers/misc/ioc4.c @@ -295,7 +295,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) pci_set_master(pdev); /* Set up per-IOC4 data */ - idd = kmalloc(sizeof(struct ioc4_driver_data), GFP_KERNEL); + idd = kmalloc(sizeof(*idd), GFP_KERNEL); if (!idd) { ret = -ENOMEM; goto out_idd; -- 2.15.1