From patchwork Tue Feb 7 19:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9560987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B586360236 for ; Tue, 7 Feb 2017 19:50:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8A2428485 for ; Tue, 7 Feb 2017 19:50:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D8A428487; Tue, 7 Feb 2017 19:50:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538E228485 for ; Tue, 7 Feb 2017 19:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932189AbdBGTtu (ORCPT ); Tue, 7 Feb 2017 14:49:50 -0500 Received: from mout.web.de ([212.227.17.12]:58795 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754297AbdBGTts (ORCPT ); Tue, 7 Feb 2017 14:49:48 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LoYb8-1bv0Sa1ejS-00gb6s; Tue, 07 Feb 2017 20:49:34 +0100 Subject: [PATCH 07/18] HID: Improve another size determination in hid_register_report() To: linux-input@vger.kernel.org, Benjamin Tissoires , =?UTF-8?Q?Bruno_Pr=c3=a9mont?= , Jiri Kosina References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Tue, 7 Feb 2017 20:49:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:DW0zEgp/hdFpSrifVzjRFE5819nEKzEWIngOKyGLpQtc1u3VHxi B1rvft/30wbjDcYovsv51Y4rx9TTmUKLI+cWt3Q3bDzWNfOtL+QcKuNTsrtYVclnmvFczji i40ycmhXUkKqaNN8S0asEKOm7ogFh9tzRmyjIWgZm1p5htwy2cBy9MyDQI7GPh9hbvOtV1C H+nnjq8vOcVZaLI09ewFQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:LFKHD8X+al4=:sDv2dS+lwEdW7kCmz5IFl2 s9UmATBVpjI47isPxrAcnqsHokoYKttjNDOt/VOx8gAaJ2YUr9vSyZRFtqMlvK2mpoF0hPmq0 zvkq8KKznPrsi1+hnkMV2YvnendlNDdofl9JJQRmlQ/0BAQsdTeKNTVp/4YwjwNe3+n3GRidG T39Mfjt7KiunlSYeyV2zSX+uNioSSepTwivSKVyBCtxchqGZda+Sp1qjJX7dJr3oCWnl5xUMg C8i4cqItEr+Wx6yf/AOz0B7gSxtvTFWiwMLmOEZUyGsM1aHB8UCCvbRxO26VBYOsri1hfm2nJ wNkIZS/pqAWpm+5r+JMXeZh+FpXvTN2ai9RDmaO01CqhRamw+2SfytnNjvRM/87VfYeTDQniP vj/oFSuw9iO7ccnWeUBcML4TCRnTFZ84hd3Sv6VrBF7WbbJ1ZsSl82rnzxw9eX3q7yeO2hBWL tNCW0+Vjl63wu63XBdiCWxjaY7IvtdJ+p328g/2BNUegSZwufECCDaicgnGNghzV0Vpf2ECFz TDtxy9zWtGLZWwoQHpT3Z6oZqCTLcuh0fmXQi32hGKPsvRXHDxwSTNGwMaMKkBOWOogbgmiuw aesH25aAX4TXFogKb6myC5E4mU9oEbKXT1cY+XtFfejaakkMfZMzW/ceRZAMjg+8sk1SZ1BE3 8IvZb2lMycoxRmnwPWlCE9tcg1EM2xd+JD37+7X5Q4XkHCNKrnemu5OO8ArObgY7smTjrfpJZ yN5cJLl7Q+eHuNddT+T4FVjNBHXBJ1mhGmKhNg7IaQYjT7LDf+sc99OTPON2mP5XZA36ualrg mBHoMjb Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 7 Feb 2017 19:12:56 +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. Signed-off-by: Markus Elfring --- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b943b2ebadc1..1f75c1c022f0 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -67,7 +67,7 @@ struct hid_report *hid_register_report(struct hid_device *device, unsigned type, if (report_enum->report_id_hash[id]) return report_enum->report_id_hash[id]; - report = kzalloc(sizeof(struct hid_report), GFP_KERNEL); + report = kzalloc(sizeof(*report), GFP_KERNEL); if (!report) return NULL;