Received: by 10.223.185.111 with SMTP id b44csp487813wrg; Fri, 9 Mar 2018 08:14:06 -0800 (PST) X-Google-Smtp-Source: AG47ELuRCKIICjYORCcAOuELO16dbtcUjHDiNu5b3Q3Yzem3TpMk3YQ8/Ypd/PL+x0BsC2leL8uZ X-Received: by 10.98.7.129 with SMTP id 1mr30662812pfh.133.1520612046292; Fri, 09 Mar 2018 08:14:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520612046; cv=none; d=google.com; s=arc-20160816; b=fZjr3ZDRyenlfL2m/GUOkcE/5V6y8MnWBflyjvwopWhx+5aUw09OekBtIJMFKamqpy M48mTQVZg57PnFY59ozaGJ/SZh4IstJLaDlGDSYJxN7E39rs0CCXODc7AbXS4sqvw+jM W6G5ktOAr4Iavz+MO93TwdiVn7HpAkkRY9uY1WLmkwkU6aRP4Y1tMvAqzaqM0ST3V7Lu xLYXC4cNUCmlHqE2cqx4zlH0EFS0X6wQoFMBTu9nVKj6oGG5XdHGydSRbV1WzlDZKmw9 q9h/MnH05vtAGW5jaNMZnM0nAMgiu67ZXp+ujc2Ccl20GNj3oP+dSW0B0EmYAs4FEIIp utaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=1MlyrxczpmXH0TQvqIIB7QzvvdPKUY8NmHs9kAJCnm8=; b=nXTOANtchbBTj+hwXnjd5cADskfkTBVQutzlhMB97mUZNOXjyyne/l3kcvQdlVk1FV ZfcgfeR58MTfLKY6AAAg1KGB2GiwXpecl4rg6yTv9AKBIiZqglg2aJa+TGiSTBN6z+Ej UDOAkO0NfqgmlkZGAER3xYl67fVPfrDHhBrvk2eISXwJsJU1J/PDbfn8ieuVhe0UXV9/ CehiZw7xxoYOEXr9tGyfH4H2Z6o/EiIyM5kMh9z6OCyA+nE5WlVfneA+Y67uv/YxnX1F Gy9cXbYTtEzBPgVkFhOJpUzAXVbR1M9qJFA1V7wescQQwX0+7ABRMc/f0Sljg27AJFHf MnxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1-v6si1140870pli.332.2018.03.09.08.13.51; Fri, 09 Mar 2018 08:14:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084AbeCIQMm (ORCPT + 99 others); Fri, 9 Mar 2018 11:12:42 -0500 Received: from mout.web.de ([217.72.192.78]:51495 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbeCIQMl (ORCPT ); Fri, 9 Mar 2018 11:12:41 -0500 Received: from [192.168.1.2] ([92.228.30.253]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LbaBL-1eE5zJ3wWR-00lFXg; Fri, 09 Mar 2018 17:12:39 +0100 Subject: [PATCH v2 05/17 1/2] mfd: sm501: Improve a size determination in two functions From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Lee Jones Cc: LKML References: <5271ab9f-3be1-035c-90c1-8faba2e119b8@users.sourceforge.net> Message-ID: <8141262d-a76d-3085-5502-647f9fd3edfc@users.sourceforge.net> Date: Fri, 9 Mar 2018 17:12:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5271ab9f-3be1-035c-90c1-8faba2e119b8@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:YPluX00BHXKoNkW4tyXK7Xz/bKtFYjxFvj3F6vd07QfwT/TyZLd oiZOgE1U1928GykVmyN5d4L3aILywrC4JrAwGnzZASmMM1dbUiL05y0lErgyAQ0uh96SCqY 541nzRambCyNcJj/V5exo6LKQ/JiBRd7EfUqX0RaEBEZ5ve22QTFCV3VaeRjLQRX3ngD35C FabYnnVvBq5q1L1zYajPA== X-UI-Out-Filterresults: notjunk:1;V01:K0:+6KnNxXXiE4=:QantdofJllkUQNaEyesImb 0FY63jIFO9lSlBKmd1+sRiFKvRewn3rPN7PuzUn3UZVY4jRHc4KIuZU3xrFnawwJUbWriytPl LWUEif7CP6vXAeDhhNrdVi0MPQG3ShZ+qxONgW07YivzyOfAcZd74EIhdOYJZZZj9pdFm2PtU xUzpP2HjlB9E1Oe6F5y+Pf5Cukxf3vasExyPk1W3QgIVXU+dpYZYrsLDezHLNQOPlQxLCyyoq s6GlJ4S3bfPio3pkh2UE0reEgCabPszt7kOB4RkCvD7FfEuVvTG5va28W79B8/6vBQVJoy81q pVoG7a5vjNJ9rpXmMGDkYHDXPLXBEfwSG6RMOHWgknJrARu5i0C+ut8Pa8hFmpZ3lEn1GCfrZ cYso/nBG4kmVBYwNfpEdqbe1ruu3uu0sfuAJ90uojcMTh2rdzKCfeGPaD9vfuR/F6HLFaUFLl hA5QWixZhgZ7fVlGJlHmVT00ikOcigJPxptcDeNiGzTpfllTx6d30IRTyboFIDYjgc6xGBzDr yJ5JIILoUB+dZDeGuFW8Nu3NnU7Q4Ipy38S2qZ9rINTL1hInHsHYaLMENMGTmsPtEjYiQzE+j /FRIdgmxXuOBRevgTu4tR6E2tgJE95ajNhIV+6L/ZneypBdGmVGIK5XX2UNxZU0dJVvbGQqOO W5r2+lEJS24K7IYG19bxRBlabPOnsz5bKz/XId6vlx9inokltzP9mRA/jqp7GFu7MZWUUztRk dVGNF5XQxLpDHFawA/RLlGvqca12Su5hICODaBk+8hHS/GpaWAWj9dM7GKMEnHFXiYs3c86C0 Sumh5otvnhQm1/+Yhv+OvYD+uhNoRCocgJKUKX5/X3j5arhxx8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Thu, 8 Mar 2018 14:05:41 +0100 Replace the specification of data structures by pointer dereferences 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 --- v2: Lee Jones requested a different source code layout for this transformation. The change was rebased on source files from Linux next-20180308. drivers/mfd/sm501.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 7298d6b571a1..4f4957ea8fa3 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1383,7 +1383,7 @@ static int sm501_plat_probe(struct platform_device *dev) struct sm501_devdata *sm; int ret; - sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); + sm = kzalloc(sizeof(*sm), GFP_KERNEL); if (sm == NULL) { ret = -ENOMEM; goto err1; @@ -1572,7 +1572,7 @@ static int sm501_pci_probe(struct pci_dev *dev, struct sm501_devdata *sm; int err; - sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); + sm = kzalloc(sizeof(*sm), GFP_KERNEL); if (sm == NULL) { err = -ENOMEM; goto err1; -- 2.16.2