Received: by 10.223.176.5 with SMTP id f5csp749077wra; Tue, 6 Feb 2018 06:48:30 -0800 (PST) X-Google-Smtp-Source: AH8x226aCvEfHI3/t72UIagqhCmuowl/kq4/j3hhmiy3xvT71sqmtGbSN8LnGArrcFi0iJ3SgN/z X-Received: by 10.98.93.144 with SMTP id n16mr2708606pfj.195.1517928510588; Tue, 06 Feb 2018 06:48:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517928510; cv=none; d=google.com; s=arc-20160816; b=Ix5QkSU9/VdsKGwkKcxieTRAIsmPsuvS3BxL+K2YZbUz1L841W8DRzb8nCJgXAV5C7 5BRE9shMVgHt+LaIjOWgPv//3Q3hSaeoeAH4KVdtBe5UtSeQDXmdqiSyV5BxRolNIfex 2X75Fg0P9TOamCtFuCq5F5KEev0I5ZbVBpeSINxgxKOUVUVSJAHdAmWkBRcEux807GVr 871TxP7GnqdQmdP3j9JiEeoIsLvo/zob/ctMwnMTRe8HDlqxy3omVH9muwcfyPnc7d49 VyUVGHpsbeQzqmN5nIasXkOLZBiCZOYl2QF5WNiTk5akQUyZ/RLJFKFRpSL6x5Y7Nxmw SpKg== 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=tIAwXkZZLL0paFRgrjdjbf7iiYfs7zZaMlZGllGDP1c=; b=JFMfI5/pel8GEpTGsqpG3p/89CqpKD7MxA16hwMBOj586Nm7SGoNvy57svXN4pg/cv 6CBOKtAaMZnwROwoyrzWCGoClQLAvugrVzVFKzxz7w74qRQlkVdn75IHgwfEy+S/TIcd /mgDSMXNevcKlOWNbF6b4oxFmN2Xy+psKMNH2Uf40iSgLsGbLUYyNfra885PEd2TmSMT ohfYmrWUTvEy45yUZLEw7TJhg3glVLiFBraOD9KZgUC+o4JnkrbkxpD4EwlAD3oKZ2c8 rN/X8IKoWZdJd+1F3VJXU5q5qRUh7p39b4TVuoR9baUlJ3OjDow99/UwIJ51v9/xzym2 ISQg== 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 n78si1079537pfj.337.2018.02.06.06.48.16; Tue, 06 Feb 2018 06:48:30 -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 S1752369AbeBFOqZ (ORCPT + 99 others); Tue, 6 Feb 2018 09:46:25 -0500 Received: from mout.web.de ([212.227.15.4]:55976 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbeBFOqT (ORCPT ); Tue, 6 Feb 2018 09:46:19 -0500 Received: from [192.168.1.2] ([92.225.242.179]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MPGym-1eeeeq29vk-004Sxe; Tue, 06 Feb 2018 15:46:12 +0100 Subject: [PATCH 2/3] hid-lg: Improve a size determination in lg_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org References: <5c76a767-b1cb-2486-f24d-0d5a220b8985@users.sourceforge.net> Message-ID: Date: Tue, 6 Feb 2018 15:46:11 +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: <5c76a767-b1cb-2486-f24d-0d5a220b8985@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:+Zkm88LPgkPvVH/sHoQsK1VNQfYd00gM/7t/KEftP3iMUbaktwA v7ZSd1Lioug1TGvmKJrGu3HfZ/x0YqZquF7wSyH6T95uP96k8T0gKTT8Xo6h5xqRwUfCtCF 7VLW413AI1Rsy0aZ7dKXUPKQCrK15XvgdP2jLTZvcPafTAuZKf+GU8acVqczRYvoxdWqf1A DzrJuCPrsbAgIg/3VbJPA== X-UI-Out-Filterresults: notjunk:1;V01:K0:0OQUbtG2Pyk=:whGKlIbZW4fHfBlxfj3uKi PTvD6z+ZFTAD9GHt2+so4qYwtYsnoYj5oayg1kqsguM95sxw3BDIo4HH5M6+Kxkmovalfp8FC KeWIgiA0kjV0hd1AuKwPyrej+n9r9fpWb6JpDBB4rz3lp04YDm+ANbVv/9l6p7HOEk4b/Q8Ip Trgi/TonjVmt4fISsPRMh8SRc3xEJ6KvRl0clF8X3RhSdV930/Ib/bMBYHAnr1Rh9bjN3d9Gv NYlvRpKULJUYfn8kVxmx6xTSZeVcSCPLQWa2ASQnnTHydPQmoI3G/zqoP5H73oAhCtAv3DoIk gVbPW8BVkIsTH+ZqQ4SePu5lKcVxgcCET4PW8N1vGd+WXc2S+3nd36NLUx5qwkSbIfrtGT8FW AAKcSrWEgOsYAGJIZDiaga8YBA9h+6GeAJRHny2q7bs0qjRUtdyMNjt6csQUzxcrOftbOlAxg fZUmj5G1xUAyY6gMXrVdtAbSX49M9ISJW1my4Z8V1fUo40XLLfkUgF9H9l3IRR2MzyIP8WZMQ VilGje+tjlpyJM1ipRKZXUQNjNVGj67vgPzEZEVLxwA59MT1OvZY3/fVEaMpg0gLkHxmcp8ON X5L6TafQe04js9KLzzPQe1asROMjQCdKrrpmXWyyLaGZlaulNqkH1efHV4zYLldGfPZV9VvvV 1rMfsbbCuscvLRauaLbsuoLLNEOAgLz3zsX9djexm+8hwk3sWQPumiwafAAU5XQrm+iQOzuaZ fSPhIO8yogzuTyHm69KF5V6GzPuIz8bBAWG92+1zot/KUISRHwqtnwNuqpw2w6SCwwyRO+MH6 demPzCKF2alXFpEYK1nJ1UGrUH2xAwZdOQK5d4Pce+ROCKcCu8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Tue, 6 Feb 2018 14:54:14 +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/hid/hid-lg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index f4439dc64497..358b4c6f856d 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -727,7 +727,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) return -ENODEV; } - drv_data = kzalloc(sizeof(struct lg_drv_data), GFP_KERNEL); + drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL); if (!drv_data) return -ENOMEM; -- 2.16.1