From patchwork Tue Feb 7 19:48:06 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: 9560977 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 823B860236 for ; Tue, 7 Feb 2017 19:49:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7377B25404 for ; Tue, 7 Feb 2017 19:49:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6505928446; Tue, 7 Feb 2017 19:49: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 19FC225404 for ; Tue, 7 Feb 2017 19:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbdBGTsS (ORCPT ); Tue, 7 Feb 2017 14:48:18 -0500 Received: from mout.web.de ([212.227.17.12]:52397 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754124AbdBGTsQ (ORCPT ); Tue, 7 Feb 2017 14:48:16 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M4ZTk-1cEJlc09BE-00ylf6; Tue, 07 Feb 2017 20:48:08 +0100 Subject: [PATCH 06/18] HID: Improve another size determination in hid_scan_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: <9e4f4fea-3608-5a11-8f7d-56f0242c46a4@users.sourceforge.net> Date: Tue, 7 Feb 2017 20:48:06 +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:7d8BLDZJ+qoWgMZUvFn1XKbqwY/ADrpiULw6htFBjAghR1hlITF ccIuh8V30azEynokTgxQxxKcyLu3fRTR1IFTwXtBF0CY1MAg4xAbj5fn/kPILahhnKGMI6M BVbuNFhDtzwDu+M+8o4nxmWBjK+hMbmxch4BI0BzLNlJwLV4sClatmH5Qe+a1/bHpUrAcEp gpfPVEWaXudslKIS/rs4w== X-UI-Out-Filterresults: notjunk:1; V01:K0:SPfGTqB7zrk=:bcDZWIwq/xMLQ9OyWMvifn oMwjhQ2E0TnqxaDHEwkvkVGiHcCjOmvsAIdNtkJ5gkdP3mEzAXJtsia2fIpG1NfN3rdFEHmM5 FNhas2odkuv3RVy6BThm/Vu7Jkhu4dxG2HrXlsBwQg6RTBXqTPSg7Am9Ok6QBRVEDdf6fWR0O LywunsrXMq4QRb1GuANr+6OuWDuSo4cq7rhUSLDH+JmVKMKhIZWq9kAd0WEs5QE59lgtvDeV8 t6YzQ2U+FNbgYxZ/VInxBLxTUu2APqdmNZb+xNCmq+W3DECQotkAdjE7rnPJRvzJb5RFjaTRa v3lS3waiKWU/oIr145Z3DEqvrvMyVEmceKPqM6EsjXTU5UbHRbNl8B0hocp1ePMHHlc6g8ec2 pg5Vb+ZuA8Oi39mf1DFgf7YEQiE0hNwoIh9tcfXNEHDtzDic2+RcZ9CxGJj2HtIvmgYkmoiWS +bfmDdv/Qh4cyHAnJLIBD+Qq9eEcViknqL4CHuYNNgzeBkmH0Ihr264SriH01N2Ty1r5GQywj ioMsgOEY2FVqyowAad87Bn6YDxUus7Rw5ZNrSna0krLnEUrSe2dmZmQuWQJzcZNWoqmjxS0yH qfLsO1LgR15aBEaD4/+bl0E2l8/capXTiJE5FFvh0ot+AKzaM96BVcBKcILaAJdf3DF7dtBAJ 6fUzWUEV6gb2p8g3mgNQykM6YvkHSUHEOpYFHAzKxCQdY1zEAGXo/kHDYzWMJrFjyvURtfsNV a7NEnt/Lgrn5lbtyE3WDFsgUrPX9bQ81zlYzXjflh5tvdw8nM/aFTkkipCX/tfSdhL0Z54tYg yOtfAo8 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:10:53 +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 16c73bf49d55..b943b2ebadc1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -787,7 +787,7 @@ static int hid_scan_report(struct hid_device *hid) hid_parser_reserved }; - parser = vzalloc(sizeof(struct hid_parser)); + parser = vzalloc(sizeof(*parser)); if (!parser) return -ENOMEM;