Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932222AbeAHNJk (ORCPT + 1 other); Mon, 8 Jan 2018 08:09:40 -0500 Received: from mout.web.de ([212.227.15.3]:59895 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757367AbeAHNJh (ORCPT ); Mon, 8 Jan 2018 08:09:37 -0500 Subject: [PATCH 2/3] misc/ibmasm: Improve a size determination in ibmasm_init_one() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Andy Shevchenko , Anton Vasilyev , Arnd Bergmann , Greg Kroah-Hartman , Jiri Kosina Cc: LKML References: <842e4179-dbac-cd43-e320-c5009d896a28@users.sourceforge.net> Message-ID: Date: Mon, 8 Jan 2018 14:09:32 +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: <842e4179-dbac-cd43-e320-c5009d896a28@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:I86I5TWQrtVm6PEdxLf9Vy1hfx2v7wH1Huple45F2+TX3yZ5pZu Y2ghcKdYzsMHUwRnWwBU1P2BTXebja9UWjJp3Nv/kJ9oxJx0zfOJZ0J1GzrL81OwmJmg8tu 7sPrqBuh+5vVjkbivRC5DoBp+KDoUHfzMCQbHIj3+BoecSE64GlhI+NBNCkXMhS27DKJ6/U 0Og0mXfsNYTPPGiNgDgQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:NWm3IlsebRA=:+Hg5iVtsKQGnT0h9T+D/Oi ReKVSA+n5TurUJrOV372Qe4qEolC8mLA8X/7DZzrkZJcOQJGRAgg77cwkB5WLC0jz9L7cvh// NVPrYmQylWg/5S7aqrr6HEJ1yrXP8i7aiYZIRf3hZBW0MW3Z0XT9ttQKoICvwzC24dvtT2/37 Mhm1a2TJI7Fjs4l3em7FkKDY0qPHrPvPo7DFH0d6xYJO7wk16fB0i4GuHrm/BIAfFclAcRrFC EJUSPqvr3OWRTNHTCtQBnwstAHvM2/bhGpI8Ixylv2cS+LWsuVPrL4JAZXwuFtotSjaGTXf8F TEyTzjOzADTM98UNX4L8CAvWQ20GADowzA6yvvD35mxzhDz2vw/J7dO5lRKFWxcNdy4eGD8ZY BFvAhPvW/c7CVRpaR7VGDqA1e7jERBcIt9mvuOWMvoi8ijwPIiaXearGf7T2roGOPW6CqDMVI bGc4Oz7VDFdY2aMgQY94zlcBohPScBMw3pbrursRmd/Ivweb3Qmu6qGYFecOnmRh32OrOZfXm A65mjp3P82zPzzCzNBMp4SLXkJFXAABrNRLjorwzds/x2HpVHMCB3s7X1X4KjNXtFnVj1OAdo 7OHjLJZm3eFsWPLVL7IZYWEJiMLVJmT/SgVonq7azQWYAKB8FuAbVibXVBWCzpp+BWcFV6/LU xLPLsl77/fcFyMSq1T5IwGMq3sHt+Lt2QnoHlf+P4jAHPsoXIcJgPN/rWoGU2bJ9FNefiFart k/Wvr0osMqnWhIdnvuuzRoMEcL8BLZnEHl1NdFh6oSCx95Sc1Lhj9x9Vq9nnxGQCkiG1Qi2ST KXckS/4+4T8AhDr7ci46teN+rMaaY1ER5WFGWOHlPNOr2bQjUw= 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 13:43:20 +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/ibmasm/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index d22b3c428ca9..894397b1ee51 100644 --- a/drivers/misc/ibmasm/module.c +++ b/drivers/misc/ibmasm/module.c @@ -78,7 +78,7 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* vnc client won't work without bus-mastering */ pci_set_master(pdev); - sp = kzalloc(sizeof(struct service_processor), GFP_KERNEL); + sp = kzalloc(sizeof(*sp), GFP_KERNEL); if (sp == NULL) { result = -ENOMEM; goto error_kmalloc; -- 2.15.1