Received: by 10.223.185.111 with SMTP id b44csp476976wrg; Fri, 9 Mar 2018 08:04:43 -0800 (PST) X-Google-Smtp-Source: AG47ELv0VQ8rV2/tXRsqJjRczi2AXmCAIeXHQSwI3MnQRCvXDUlOkOEV6oOmOBxRvou5fQiXbZrA X-Received: by 2002:a17:902:5a44:: with SMTP id f4-v6mr27861565plm.116.1520611483029; Fri, 09 Mar 2018 08:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520611482; cv=none; d=google.com; s=arc-20160816; b=CQ1avfj2SpYu62T1F+iltdBgfleNLqUpUnGcYRX03IW2QLm4igI9L+SIJzyHz7B2NN kF9AhKagwNRUUobLKMwIx6hXW0H1oeBb2Gqj3nmPXgslUFaK+EsV43C82wWSYHnX62rQ 0wHum+gtjWelJd4fMPcO/cUjmS4hUMRfkfTvb5qIxcvdVt3hoRcDC41JLpao49VI3+vN LHXOdX8QakAFnchBJEuiBcG8REuj1Lrcp4MH1eisQ7XDAnVSjcBT76SS27kQqZp209Nf vUIF4TNSQZBULFu/GeSaih7QNAk5VCwbvVP+allUAj97bY84Kyio1DQPmV5SZdOLn0FS mdbQ== 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=5DYqM0lShBGRQ/b7KtVcZ8x1ebdgzLNdnhg4shOBkLQ=; b=B+an9A+WxIHUwc4nqg1CtHb2nZRIHfcW6OfwHKdCer6Yechuj/4a2yUmnk8erJOUob smPzU8zA88GhKcX9IDvXrANTkwXpAIbV0al0w/0s6J1hbsx9W6lrE/0wcHOuH/ZY1N9P ApOGswkDkBE31f4Vdii1ZcjMNfuc3EeclRC8sFUN5oPqIT1VDb7PuVcD2YXud+an9oCQ l7aH6G19uYkDoC8bx+PKjwul1RWgRh5tKSHCMpuN+8gAZk1vSHRCEkzNuF/SLWJJCAJV mDMrd/vSqD4WcY/3uP+4C+4Q6HcXgsUdmZJFvRGidz7limdzF8bMLVN4u/EeKVvHIso9 APsg== 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 j66si1054469pfj.181.2018.03.09.08.04.27; Fri, 09 Mar 2018 08:04:42 -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 S1751223AbeCIQDX (ORCPT + 99 others); Fri, 9 Mar 2018 11:03:23 -0500 Received: from mout.web.de ([212.227.17.11]:53821 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbeCIQDW (ORCPT ); Fri, 9 Mar 2018 11:03:22 -0500 Received: from [192.168.1.2] ([92.228.30.253]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MfHk6-1fI2YT29YA-00OmJw; Fri, 09 Mar 2018 17:02:35 +0100 Subject: [PATCH v2 02/17 2/3] mfd: abx500-core: Improve two size determinations in abx500_register_ops() From: SF Markus Elfring To: Linus Walleij , Lee Jones , linux-arm-kernel@lists.infradead.org Cc: LKML , kernel-janitors@vger.kernel.org References: <6c8ff539-9e9d-635b-22a8-df8100ac8156@users.sourceforge.net> Message-ID: Date: Fri, 9 Mar 2018 17:02:34 +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: <6c8ff539-9e9d-635b-22a8-df8100ac8156@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:kkBA5WO2vLtleggucBzZ4/Lz2igcPNT++1gfwDYDiCQsS8GpNw/ vaaMZo7fHiWk+UM1/hHjp6O+H8HgSscn/ntgwd3QD9KpwY/4c6/eHcqKaRQzpnTdjM+t/tF ZAsdylCXaotiLwu1FXuld/rp8CB6u+pZo0xYjdsx4nUdlhrhuf6BZO8B9fTD4KXDi3kFic1 o+0pxTmqoIdrJ20Gde9uQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:aOxZlWtCkec=:opStOHHlRg/mjN8mOUtV8T sl3UcJT5JuXJKdp5O4fJMej7nlr+OBrrDQJowkd5Wn/o9b8TH+nwiRFD+Aa3UAzBm3eL/TIFn WCZNuZZaYTrPOcRKMI8DLtboBjgzqnz1C+TUZUIV2C+4/fH9sg2FuDYfFv5lEQyZxUw6EW2ry dOHY7jZrvjd/4XI9OvdLZ6OPoqq7mUflpiF5PDZA4S93a1FZDCzmXzBQW+kKT19M/5m+gUbCJ fsLWHvRPxd7HLg6+vID2eH/z8k9N4RDUGnL7dFtqf5ikvEPprdu+FPYIeRhrH25oazzBEjPhi 3GuVM8QXalbqt550G52w6yDTPX/c9OUcGwG+UTYEdBjF/UbxqyNg24y0p2hhPFlEaaq+84oOf KfapcPLvqUfc3FKRm1v5KgQDLkZvtOuy9s5bcF7vDTrc7JQXapFkw+y145ena+8HlPKvOxIHB INgP4XuzL7G2/hV5Q9fWpndhLB2z9rMLmY5fIdce9OiSAGr24h6x587/TG3Bok7MUny29we+C qfq+LUA1hZzTegkHTEmGON65Rk2q1g5hEAxfj9setdeSZwRJIQIev3fbJfPsviyuy2AL/JccR cVFMNq9HgNM3d58RMxMr0rwSQ0fLIYUJEsC9zK9dt5sYvkTMDr3/od4sic3mrFvvzw9z7gYh5 CB8cv2es0Kt76Ax71I/HQdafToFW551IooYHNZwHxuNH1u+4lYbOAfyZJktL7RL8LTPBSyiGa sLgfnndc0sZFrfOMV5tckK4wj6Ayq46nVmLNFV2O+SMy5hzuaJXtGlGJLQ5QV+9pB4dKxotLL KBLLP6PgvT6JLHKyMlgmpmp+rUlETk6LYxX5iwYh8tkziS9D4s= 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 12:46:47 +0100 Replace the specification of two 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 Reviewed-by: Linus Walleij --- v2: Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308. drivers/mfd/abx500-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c index c8c9d41abcaa..17176e91cbd0 100644 --- a/drivers/mfd/abx500-core.c +++ b/drivers/mfd/abx500-core.c @@ -37,14 +37,12 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops) { struct abx500_device_entry *dev_entry; - dev_entry = devm_kzalloc(dev, - sizeof(struct abx500_device_entry), - GFP_KERNEL); + dev_entry = devm_kzalloc(dev, sizeof(*dev_entry), GFP_KERNEL); if (!dev_entry) return -ENOMEM; dev_entry->dev = dev; - memcpy(&dev_entry->ops, ops, sizeof(struct abx500_ops)); + memcpy(&dev_entry->ops, ops, sizeof(*ops)); list_add_tail(&dev_entry->list, &abx500_list); return 0; -- 2.16.2