Received: by 10.223.176.46 with SMTP id f43csp1213654wra; Wed, 24 Jan 2018 12:32:52 -0800 (PST) X-Google-Smtp-Source: AH8x224M60xhO/faEikqfv3CHWELoGau6TN2eyzutGBVLhY2HkGKVFEf0LqkpnynpBOXUGKjdftR X-Received: by 10.101.82.134 with SMTP id y6mr12042091pgp.101.1516825972289; Wed, 24 Jan 2018 12:32:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516825972; cv=none; d=google.com; s=arc-20160816; b=kNUJwuaO/IbOkjhs2CtS4XBbQYUkL/NAsg4koQ/8x8299VoWBZ1sHHWKXnjY7cFKsd fFwCeaoG0lff1lkCtZnHT1cGTLUe6c0YtqyxEYcNZU2k+ekh6Cx3Y91YOCVesrRzOQG+ IoYhKdI3ALqieJQKwkVUA4lJprtPt+mAD9rr3EBdDvnljv7AGFCi2unniwZrUl3vzi4W TAa6Dm+U9Wbs/eJjp6q5jamW7aGrGS3v46HVV3F7WTngSsuKQjsIyi5s9ex6VG0GzK2F UnFV6txtN6EsaKXn+bI5w6CGarW1PD/VhOgAF3Ky+hweLGEdU4MLQhnAsV461OLhzyhd HQ+Q== 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=s7h9yxdlJouFCix2pmhZfVzA7cjzxUpaJsN1m8rqyP8=; b=SRLICzKD6rCMLwaxr8eHJ+2o8eqRO/e4L8qWepBtTr28Pnog5pSDLIzNHiybU0cDOM o7PbIPZjvyIFq6mk3xnMfYZ36MAX80TFBxKLUFbBfGSMQRSQoLzNXSvKeTQTH6ZPZ8EV /awkTTZjtcUCtS0jQxhn90AN/48Xm9kMtm404UlK9GcpFV2qt8W20eOXTFNJgSFUGJOF 82QHNp1yY45laJHJZa9oPJ5FUDRnzxWkxuFTwturonZOramvx0wu9DBAEAkFOOoaKORs 2hHvOK31PtQFjvHj8zYL+Sk3NaLQVby0kFEa1j3eCIzn/MQ9rkSQ8XZ9yBdfakeeLWUN fu6Q== 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 x63si3383700pfk.335.2018.01.24.12.32.37; Wed, 24 Jan 2018 12:32:52 -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 S932497AbeAXUcO (ORCPT + 99 others); Wed, 24 Jan 2018 15:32:14 -0500 Received: from mout.web.de ([212.227.15.4]:49405 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbeAXUcM (ORCPT ); Wed, 24 Jan 2018 15:32:12 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MBTXi-1eXGBj3ddm-00ASSY; Wed, 24 Jan 2018 21:32:10 +0100 Subject: [PATCH 3/3] Input: bcm5974: Improve a size determination in bcm5974_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , Henrik Rydberg Cc: LKML , kernel-janitors@vger.kernel.org References: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Message-ID: <02af8e7d-b6f9-10f9-4f56-de657477bfd5@users.sourceforge.net> Date: Wed, 24 Jan 2018 21:32:08 +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: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:hRRaD0y1SbIvUdLHqwZZkMnd7FEttx5JE9w083YnVc2942WT0Su B5ia+d2lqTt26y6Mc7DQzlx3Yg/aC6bgUO2qnjSk+jGFiWB+C5AQ47mdFvtnsmuvrxePMNI trwfHzxQE5CZNiwX351zjV1cb/53X5738zMj9b2pFiYGjjj8r90ZCSudLglYV7bYmCQMnhk Zx4JsZ6NPOOfvVn6NykxA== X-UI-Out-Filterresults: notjunk:1;V01:K0:GVUzDTFYOAI=:d6vcqVGgJtcuitUf0XbNu1 kw+lYJ99aUBQHhZHeWib7bdJHuQFqYCeV6LaMgkV7b1i9JGZDs5HRTwF/JXpoBNHfU3aFwp31 PYYXFdB2RaxCdeM+NgiVK5TvkD5TzsfdNb6CWa4GYr6Q5R5Hvs6xnK9q6679Ze15LEyR9/D4r Btr4hJFTdpeAAHXmth143IyrZA1LNmZ8eQrKoZpAYi3GQYwU5E0NT/TmVHBeQggSnWMhqR0i4 ktAqwN2lf9Pa1chTgLX4pXSC2zGRc+kVb2XWg4A1y+nFio06jbhxgddRWvrFCIzLrYJ2klJeP FkVqin5OY7zGzHmMwfPqIQz7RxSKBZseTQb003I0HxpsZ8fJZrqFd3hv96RmxYIpXS2j+xlNl rhB/EisDYraZ0/JUHT+aHyO+LpvCYBBAZGoEskCZhX+HR+rP1qD8s+aexEPzOFQH6thLB9Rei f2BuHapBQE8Exp5/6gNF7buu3sal3/9crZ26T2befPHKxPKk+tFkgerGW5VD39tR+0bvOgfLJ KG3QHufqJ1eqkP/aSJJiL7KXQPyO3z+BqFabF1OawGeDT9ynIHIWv8WOLxKex1L6aW8bFhOPk i/aVD9hte71J6nqtbGvdTcKtKrKFnMrdbmaorp1axxYt2g5CXrkV5XhzdDKqqJDH+W2oNnyIH +2+bLH/QIOfAETn4Yqaq74Ozjnr+4ANp/g9ErhXBK2aEM5fsqzDOjdBsD4o0lcWt0c9tGx/qf vnKJ0srIDV324nlr2Zo1QY7Pbz7lKp2/CVHKnI0QSjOHZhdDIZjJYnpzmCfuA6Wq3aPO9h9a4 CEOctCa3H8QZiM53KAn4qmMyxptnOqltfoYkQNZvwyVFcN8kCE= 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:21:11 +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/mouse/bcm5974.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 685f56c08931..c827b31c8530 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -915,7 +915,7 @@ static int bcm5974_probe(struct usb_interface *iface, cfg = bcm5974_get_config(udev); /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); + dev = kzalloc(sizeof(*dev), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "out of memory\n"); -- 2.16.1