Received: by 10.223.176.46 with SMTP id f43csp1041897wra; Wed, 24 Jan 2018 09:41:22 -0800 (PST) X-Google-Smtp-Source: AH8x226DIzrcjh1i44PJyefO/Duh1V+iYGE2skVirLzflrUrIn/k7qTQW7AHoEttzXTt5efWO0gH X-Received: by 10.98.11.218 with SMTP id 87mr13256769pfl.99.1516815682205; Wed, 24 Jan 2018 09:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516815682; cv=none; d=google.com; s=arc-20160816; b=xLI5fAzNznuWjfsH3JDUDCjwfqrVG0PPrGh6IdntDW7xy2+HCubBN62eliyYvu6wVD WMIDnOt88Qx2MLdDfBTLr75ue04UFQrcRWYxwGzTpKhpYfzQ3CBc6VBm06sA/+PweXNJ mSUJtSY+E2WnoLApBKljvxeuyl44R/VQk2i9UfWT5O52og35qsMZq79ewAdCoHHBzoQI G6l4GsjKiKtH6fYl/CPhWc+QDjkH6wLhG9SKI9ENWjSesDPED86BDwsJOfd8MoaoYGJ5 iwPsTd7fK5/HqY+Bxxywd7VWfnVxzO1VKZUzmcwGq98FtMT2gk0gPW+hdl79TMtv6Yfi G9EA== 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=dy+V9VbB2IZ+DqFjci719E5sLvUDNRhkgJbxCxA1/ic=; b=AO+H60YbUkz8qIuCXfOfw4/FcBVH/JjkQbJtD8snD5SO9dDE44oDB5QAvoDRpdWPhG wuJgAX4cGzF+YxVrmjZdFr4ZiWFrmZbvX04doEq4Zd9tIDcpOO+jw34Nrj0aRbhlHuwr DUJS0Q1P6npgma7Hc0bzhgyte0Jx6uZq3Co17d30Z/MvqFBrEYYTqSwAX713AC7nuVvf jeOS99n7hAATZP3encTYkDCiL6iQe7tOjLrxKvsSaXGzHjailmssMkE2WJoKXpcx2cSL /ZO1K8+jKXd8Z+LRjK2DSRIoZJfvW6IBvgFujNpJPhnXIEuz8p91Zpbs+27fYtDhaDqf o4mg== 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 o190si384755pga.553.2018.01.24.09.41.08; Wed, 24 Jan 2018 09:41:22 -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 S964966AbeAXRk3 (ORCPT + 99 others); Wed, 24 Jan 2018 12:40:29 -0500 Received: from mout.web.de ([212.227.15.4]:55628 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964840AbeAXRk1 (ORCPT ); Wed, 24 Jan 2018 12:40:27 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lp9kK-1fIyaL016S-00ewsU; Wed, 24 Jan 2018 18:40:25 +0100 Subject: [PATCH 2/2] Input: arc_ps2: Improve a size determination in two functions From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <38a03d93-7663-f3c3-9066-88cd935e3790@users.sourceforge.net> Date: Wed, 24 Jan 2018 18:40:24 +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:+Z/HI5qHJHQOHGuZ28zoSX/jMsSIw4ihZfKt8lD62+pwO4uQ5/x 0mtGyeb8RikpI6CbxSiR06AjB4vMe2ZvNR+95xyVftB9/bSTd9JVT5aIbyNFpCUBA3JQeps +QJ0dd+gjBE3YtezXg2e/xel6c0tzpfAH0mM4YYqbtrSQhl01cz9VMBGLGV5GZ14Wym4JOn xHH0cH7HcbTESyo4zmhDQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:SWpAjxV9nCI=:I7w45cSnuiqLafEXFEu9er wzGyGkQywDG7kcLtT3rS/hMMgGtGZ2EtaGhj1FgKW9kXVWrdz5MGKcMPNHUjz+lS5s8DTMCSs UPOXFLMtSqP5XpmUyb8blR59OUfdN3XvDmPXQb3jGeGHQN3OtVt3x+fX5J44Dj/MqBA4cniFO DIRZHYjNOUHfe3ChwrPE9ZYjebMTs9P5/80ACl8tNkcZ2cJJFaiyVSRMcIUP7vIxPj7PRjjHs txkg7HBVi+SBWh9exJr9t8tKVROtZWm3HKaAW89D33MdOj+WzGNMjb1zbAFqo56TA8kR3jNoc BmKYUAY2aS/HmqBLeBOgGA5SnwmIVl6Y1rOpvYZLJDQcDiBfgA/x7WkWr6gjBvK6yGzTEHMe7 KzgEbjCQjoBj0miL3Rh78FLYlkc/RszIRK6ODW6ISeLGclUN2zSm3h9pRsk/vdXo/zziFdIaM Bibbys0//vePQE3X56/Hjl09AHgD/+qRsfiTBniICp7zKYgsR7d4kXFtFaxJJlS81mn80vlJT YRHEysXbdAu6psTYAS216tXSYy92rV9tWyHS65SMtIOfn2FEpzYpA7QI6k8hBubAFw//m4Lfn PYlXMIkkej47vUSBaXML2LS9ht8rnp4qzvdaihx4OxDuSYjQvQHuhHKnUYncf8oR1jXDKFpcX lvSGnSoJmSgWDuo9amuYAVETs0UlVPQyPGZbFM+HaA9Jss2BlJOuWoZ0eRT+903CkOVKDGb1Q h1gP5hbRvXSJfEjB0fH104a7N3w56xrfhBDjNEewVcy3wWzQZbV5Riqujckt4LiWb9T9m02jl EoqIcdyoH+9mt6q1Vkju4ksxb+79YUSN7BeDnUi6MeQ7foZozs= 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 18:30:45 +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 --- drivers/input/serio/arc_ps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index 9860b1c1e67a..6a3c845e12ea 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -156,9 +156,8 @@ static int arc_ps2_create_port(struct platform_device *pdev, int index) { struct arc_ps2_port *port = &arc_ps2->port[index]; - struct serio *io; + struct serio *io = kzalloc(sizeof(*io), GFP_KERNEL); - io = kzalloc(sizeof(struct serio), GFP_KERNEL); if (!io) return -ENOMEM; @@ -195,8 +194,7 @@ static int arc_ps2_probe(struct platform_device *pdev) return -EINVAL; } - arc_ps2 = devm_kzalloc(&pdev->dev, sizeof(struct arc_ps2_data), - GFP_KERNEL); + arc_ps2 = devm_kzalloc(&pdev->dev, sizeof(*arc_ps2), GFP_KERNEL); if (!arc_ps2) return -ENOMEM; -- 2.16.1