Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754682AbeAGVEB (ORCPT + 1 other); Sun, 7 Jan 2018 16:04:01 -0500 Received: from mout.web.de ([212.227.15.14]:60070 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeAGVD7 (ORCPT ); Sun, 7 Jan 2018 16:03:59 -0500 Subject: [PATCH 2/2] misc/apds9802als: Improve a size determination in apds9802als_probe() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman Cc: LKML References: Message-ID: Date: Sun, 7 Jan 2018 22:03:56 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:6HyxnQ0WNNeg0gb6Hl0K+e8m5G+fMsuavGtLv+wsT0L3zlP8x4o PhyWfBLnpK+zKjllAdQS8e7Db8ZnHfCHN+hvoA2vUFDqoOsi1wlJKRtGd4avmjXzVNOKg6a cSlmQ5OW+pM3fOhrfjgFsgwoaRckLI0BQPoCnVKsSQQgIanAOh5FEYBaroFqPU21uQ4710V GBR+SEXSLthVpDGEB+aZQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:9MmrPnRvVUY=:W0fVa7XbZxyLkJSHWTDj9B RDENp+i4Xslrd0LIqHWteYnzcoGLePAzq++MxiE+Xg6GHk+UwswOqhkftjeAS4QHuZFQaZ9OR TB0OKSh87ML/mPsqUdTXQ088tg3LVhwbkJaLQRy3sMk91sDiOjtz5pGBLeg9lApcYAEYQuJ1w FcvCQLeD6VsC396g2wYtIF0NApxlmZKJ2HqKB++6Uwhue2wbXrugdDWanSw2lBeXEdRfzcEa2 GfqnnXjgudr+o0qSSUoZPKbCD5+kKMErOXtS1xarkAC3L7Z+eHvhBVTXA8YUvz/Eki1su2pqt FFeHw6QDJvcPxZOZWz4MQWXj+nhL4zEr6jZ6Y0wd6JqgKW3bjVCMCiUjEqybJgBzhwMWdtbzM tQnbNHvqNvD/R1Z/PJPpR8wTsbgDc0ZX3aAkv2fZ8KzWpZ9JTULKzSRzZCjsA39RJZ05HkaI3 8wPoNK5/yfn3H+TgITN2m+OTOLMw8dgUbNW+MR/dz+m7ZOFUHyfd+qV2eloU6O64wEGyGZeaY U9nLVAl7fC6QNOLmuxkXoS2eH0aVsOgn6C6x5g1pjZ0S+czLOoRFOZd/XeXmwvCPRfFkvA/lR V5c06H+LPyD2i0A4Gfjinj1uIf0Jb43k+j/TvPExaJ9wrlVy1ejyi+Y+X/gwcXtHgKbAaJ+w9 znjAjXWq/eiI2bC9ejU80oQs20B5IyqfIKRrdszYWuJHP6jQqTMqBqoXtlqlOWREHl4PqgsF6 yJbWB+hBWTSC5ubtx4rZi/waR9hmGXI+A97pjxvXf9fo80fOzLd/Wx6ZQBUgDHnmEHNVeFfdN L4M4LSJVZe0MHY57zrCvTdJS96GpFR5CQcRi4LpvoeMHsZyWKs= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Sun, 7 Jan 2018 21:48:50 +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/apds9802als.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index fa548796c92e..acf467666737 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -228,9 +228,8 @@ static int apds9802als_probe(struct i2c_client *client, const struct i2c_device_id *id) { int res; - struct als_data *data; + struct als_data *data = kzalloc(sizeof(*data), GFP_KERNEL); - data = kzalloc(sizeof(struct als_data), GFP_KERNEL); if (!data) return -ENOMEM; -- 2.15.1