Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbeAPITg (ORCPT + 1 other); Tue, 16 Jan 2018 03:19:36 -0500 Received: from mout.web.de ([212.227.17.12]:49376 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbeAPITf (ORCPT ); Tue, 16 Jan 2018 03:19:35 -0500 Subject: [PATCH 2/2] mfd: smsc-ece1099: Improve a size determination in smsc_i2c_probe() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Lee Jones Cc: LKML References: <978023d9-01f2-3a16-5eba-e06b8359cfc0@users.sourceforge.net> Message-ID: <721383c6-7d82-7911-989d-fb230038a52b@users.sourceforge.net> Date: Tue, 16 Jan 2018 09:19: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: <978023d9-01f2-3a16-5eba-e06b8359cfc0@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:sJ5+RYaOC6a0f9K4cFXAQxS3O7Snp+APV6YOUujTBt4Yobb66tD AhvRH8COEYDlknYK1ujlx0ziQISXxYmFmhY3UGKlD5kNa5U4QP456xw3mOQ/jiVCccqvfmj 3KXrSzaajK6nv7NXy2xqh2WaZ2iXEA54T0S2ALF6ZyDMldl5OQlXPagBGXIEzozD9FVFPMR vsgs2926u/8VYEXQYAEQw== X-UI-Out-Filterresults: notjunk:1;V01:K0:XQinJDDkHV4=:JzTkaK0oNOEPWPft0laAdu 0kCDkanGucmFHQJO8eM9ez8uz9x6lrZzyPgFYUHE22ljrQEHtF5XGN1xKrj0BnfIoO2je+ibI H6+HoI3YnGlbMeoFuXXnCuvmrjAufNgrqiW+tUJH3WW/UsN1CFP7dk2YDeD0zo9Zv8pCCrAdZ GVdAdB/M+JG5jgY92Dhqps2fyURA5TvLVrOuM6uR2l4jbSWWP+6PYUKSG3aD0+vryGl1L5bV0 pbWTX3JRdRkoH9DonafqT1/vHJoxpT22vQ7/wSd3pBCFZs+9uUv/5FingilGUBToc4dAmgYkx 0QACBnYs6s2otg4QNRGyk3gZ5fmDh4LMVdQc9+7GVDG9rlEuAgMd9NXIKK0xBxcIutpvKMIFv W0v890s/z6h+ZGX9H6x13Q6cT2yGzssAYL/NZclOfVeFshwEO5rc5GsiGFjyK7HqKqxmo4VPR 19ZFK7IHIbpM9NW2o7oThbBqq9gaql7b2SHNSrNjKUEONxg15ihba9OpYZMGbFszfOmx2YxfZ /JT+xjOZlWfGNlAZzChpHZOgXN6oG6YZ6Lsyde8A3utapnOjPEUmxkpvNApYbi+6xGGjXUt06 bgLW3uZp5N509Mcy+MdNcloplj0auhPgSwrh5ME5AJL8Ml8/IsDd1a8gS48vdi7y+fJuLkySE +hOFT42XjwoTZ9SmZdEAh+6cUrfyH/41c35Dix6sb3AvFGHjhUWxuwoUU1yeh+JQP4rBy5wPS rTRcC9yX6uV5IcFLJuoI78vXnNN033IfXf5CpYwPwWiiDpPoPmj08iOdWFO2umYHqpMAYGWT8 t/+4plhfr2HqJ8RM2X/cmSi4g9qr7KGV6dOAE97p6pBqzIzt2o= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Tue, 16 Jan 2018 08:58:26 +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/mfd/smsc-ece1099.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c index b9d96651cc0d..6681205dd2c0 100644 --- a/drivers/mfd/smsc-ece1099.c +++ b/drivers/mfd/smsc-ece1099.c @@ -33,12 +33,10 @@ static const struct regmap_config smsc_regmap_config = { static int smsc_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct smsc *smsc; int devid, rev, venid_l, venid_h; int ret; + struct smsc *smsc = devm_kzalloc(&i2c->dev, sizeof(*smsc), GFP_KERNEL); - smsc = devm_kzalloc(&i2c->dev, sizeof(struct smsc), - GFP_KERNEL); if (!smsc) return -ENOMEM; -- 2.15.1