Received: by 10.223.176.46 with SMTP id f43csp1259238wra; Wed, 24 Jan 2018 13:23:45 -0800 (PST) X-Google-Smtp-Source: AH8x224Ru0V1hl5oWXHZI2cvf/ACT4PE8RtmTAC6NpKqbwP5rf5rWJTW0zsRF6oHDaO0IH+3XGAz X-Received: by 10.98.1.199 with SMTP id 190mr14268388pfb.124.1516829025536; Wed, 24 Jan 2018 13:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516829025; cv=none; d=google.com; s=arc-20160816; b=VB0T7GDGE7fBy4Ex3N1M7kMlmAjcnS6YRyZrbGKgH+p21XNvVwskLKpVOr4/MpRxUU XDH1ylclLY0CxORvw83h26mYe6ukGeybHmVHCzzty6UxS3A/d3Pl+M9OzK862LL7qC8N tZMGLY9T8RIhZvluNVVt3wM1kHvblKV4krROFtO+Vxgiq7dp1QmEos6K4a4cz/oMLf3w tcic1Sbxp6QsMhCvEu/5eMOaaFYtWchuSr4/Ywenh9Qxs8RcGEzNVEVz8lly8PluyEgJ ILurDRsVn4iGt+kEOoCcItL6D3Tv0jNgc7NDcX48LmB7Y+SjIaW6m5wCoZUCzUZF9YDw 1UpQ== 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=RSDDsRIfelIyyKn5aQWzaXMBOdtbaBXnsB0UtthYVqc=; b=QTJevbbDqXMUvajeIiOjWov2iVxWWAr/KBwu+gfM7UdAW5SSmDi69uCXmQmmlpPuFN K0XYSp4l2rU3QeiIWxQXMqNcTZ8AXsrkeP6e7Y0U5eMCxehhKcbbB9aify2v/h5rTMJ+ F/3dbIqHLmboufRP5wXQOyxwcvRucv46yyihpQlNDiMBWadJVYTIJk6/sjP2aDek5/AY anaBcJ2FtarNoMASRI+EEIvgGuTtgCmIkJcxAEPwS0vCZ0X9l1J44kO8+tx2TAoMYuAf kcLmwOHpLxJl07GuBN4UWWLoWoHqLypfs91qEc5Xf0LYu/8mDCaf9ld3B+/fj+VRk1ZV 7kkw== 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 y6-v6si760491plt.467.2018.01.24.13.23.31; Wed, 24 Jan 2018 13:23:45 -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 S932883AbeAXVWn (ORCPT + 99 others); Wed, 24 Jan 2018 16:22:43 -0500 Received: from mout.web.de ([212.227.15.3]:51363 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932474AbeAXVWl (ORCPT ); Wed, 24 Jan 2018 16:22:41 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MfYXz-1ePn7v1CoN-00P4Sw; Wed, 24 Jan 2018 22:22:36 +0100 Subject: [PATCH 2/2] Input: wm831x-on: Improve a size determination in wm831x_on_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, patches@opensource.cirrus.com, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <43f052c7-c98d-7ca2-08ca-e5428b5ad575@users.sourceforge.net> Date: Wed, 24 Jan 2018 22:22:35 +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:hPuJOXbetr4dGS8KsgB6GwWfcvZb0rkiL395wONQxms7IWxKJox hC02jIVkkAv2qCMgLSqSUWcBvIer4yZWdOTevdQOViAMR2AARuZ0O9BbcD70ea3GdsyWo4d KOM5KTggZgJ50nsKeCQjw1gpEAk5MZ08kcVMs5TKGcMTd9+KpTGb5+l7uoXff1rJAnZCUK/ DMoaJQ6lFW9BkQHm5Pe9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:pF60MYKR1/M=:WkDhwLESaL38vzM3VsnHBr mm8XJnaWWifnydIIMaXDflzhpr9wjhj3YxZYpx10PZDQszUC56zSrWlqQ6Jq4NuoO3fFz4rig oEvUQ277x6676CJnf/HaWSLAK+/yLPLEpRAT+XAmYO0fn9o2IiYVTV4qWRBgjeZJRo6ltGa01 /5tz6DpjY9CsG8GStggM9w2+9s0akGy/1PvKTo+XZXzaR3FZq9geVz7pKCDr2GwylxhtmPs+m kUmYmHl5gQO/6z60QmKrnYHtmBPNnXignCagPapVp1hvk1qZ6bEtQNm8+RJMikWfTAAX424Qo Ffy3tvVKt7c/YjB9t2li9Yi0/n0NkpiKyQTAPHGtkQqn3tKNQyS/2gmuWPNAJ+WJC/bTd9Gd2 yUbzoLJG0lG/eudl6oe+4AUVdsi1O1LYbrV/IfLc0JH/zMSuvuNPcv0uBz5+4odFG2jLu7vWe fy6YO3m73Jh4f1XQH5mbFZZIaUiE8ZwshBdIhw4NmKf0uTHi2PwaiB86c64CK0ZJm5A6t3yhZ uxLTjKDvRbMNYF3FiYgr+J86SwkzpHFCOS1VrpDtnTh/yJexrHVvuVp/otRL+MXTbKJMYyN65 SGjCeK/GtZfCvYxU4oI1qjhWB//bpJVwMSPqx9X4PYdFhKWnanTFjz8RPxgMpMbKEXdMaMrfi bFS1CUbsJ2AqK4j/MMjEE+fAl7A/N7BWvUABLvdQ5XXe4g4MMkjxz7mLw1erchamB/pp3ODyn sayjc6C9WiletrbcYopReRn57/xUmf23iFMqvzAr2UJYUtQica6jx0goydVdx8r9jRv0kjNl4 WPPrE27DEF0JzWtYpYIfug+zhdSh3eklFay7MBXckRzouPodL8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 24 Jan 2018 21:58:42 +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/input/misc/wm831x-on.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index 06f5c4857a0c..0d8f7a11f63d 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c @@ -75,8 +75,7 @@ static int wm831x_on_probe(struct platform_device *pdev) int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); int ret; - wm831x_on = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_on), - GFP_KERNEL); + wm831x_on = devm_kzalloc(&pdev->dev, sizeof(*wm831x_on), GFP_KERNEL); if (!wm831x_on) return -ENOMEM; -- 2.16.1