From patchwork Sat Sep 2 20:46:11 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: 9935829 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 6A51A601A1 for ; Sat, 2 Sep 2017 20:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55C7A28695 for ; Sat, 2 Sep 2017 20:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A88A28697; Sat, 2 Sep 2017 20:47:28 +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=unavailable 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 E836E28692 for ; Sat, 2 Sep 2017 20:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790AbdIBUqR (ORCPT ); Sat, 2 Sep 2017 16:46:17 -0400 Received: from mout.web.de ([212.227.17.12]:57287 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdIBUqQ (ORCPT ); Sat, 2 Sep 2017 16:46:16 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Ldn2d-1d5bA83rWd-00iyxi; Sat, 02 Sep 2017 22:46:12 +0200 Subject: [PATCH 6/7] [media] Mantis: Improve a size determination in mantis_pci_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net> Message-ID: Date: Sat, 2 Sep 2017 22:46:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:3phugO+3MnlDNGMpMmTPA1RaQQFdy0My6fSF8af0YXdY5BhBsa4 fzcqoPBW44l3s149Rs6ZSAH2v8fUcQLTI1xEp+JyFQ/0fykAPhKVUFT6x6tYsO6h+y2CLet aDRj9zYao3YdfEx0G8ISRdbk9U/DW+1ARIgltjsoNCnHSzO8vqNeapuMzlUlDG1Iv/BS/yb qDF/WX8KF0jPdIs5s/UWA== X-UI-Out-Filterresults: notjunk:1; V01:K0:dGyOCT1h/XQ=:jelDZKy5vb1ILTy61DQ6mi tigmmxGFYHUrGnLcAXUt7ULfvI7IbbSYpU1Z1BBaEg2IrMyTN3MWYvEPU7dYmxbwQEHmqtpjQ lSmZqFMRazs20PYCoU/cFOH2h8+xeejmctqsDyx4xfPwD6jNsohWv+Nvug+I98bqEX1xXF7dP 00pZUfDtuF+2RYBp7djVjTcz71zuSHYS5OU2BJtUwAQ2mHWc3PZXwczujl7MgC6dFCJaOqglN VyJE37wXKls174ecTboZdWYox6VuE0n83AH4nyOQN7+ibnIQpdPhG9Ojq/Yf5umOt1DQI+BIp sLim5p/G7E7LM1MMOq5cSNQvyq1Q/t/YI7FN5J1KuF7JVFAfkNu+MRcO4XS6dlO7lEmEmwkK7 aHobmrZtpvJwK2v7XB1MdIbK8rdcH8HZwRkjj+gSLomxaBYTdmnv3lxiDcTKLkN3Fux3KEjn7 9Rzl4aEKcvx651WD1szfv3kDSHEUuzX9rP9NZH8ilprmCEuHthBqzVPU87BHEz35u3UhC0JZH xJMXwrrOxaASyfHplJE1TOJ/cNPdQyldmXrYVAcYQ9X2y885j3SMs8qUK67jrvQvCmsOiIKWx UahErJKHwqcKt/hP6W+nK0C60h4pDpY0fR1qpqLflngrF8IDDctjrPVBMPv0WEfyHwxuGxvK1 YkVGx94nXK283odTS6VzfHll1u8rA5EQT0E0u2U8t6W+Zr/C8dnUDkDaRugJ8iQIiXI4kfTSo zTU1pfdWkoLM004GKOrBbE00I+SYqRs4Ll17ykj8OVsKqyEKqnSpSujQ8sQEg8rWKMeWGUSdc ZzhGLyxpnRzNs/MGbFz5wUM5BRe+iucrkyUtIZGopGB5jUbP70= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 2 Sep 2017 21:56:07 +0200 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/media/pci/mantis/mantis_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index 56a01f6f84c7..6182ae44dd23 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c @@ -173,5 +173,5 @@ static int mantis_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err = 0; - mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); + mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); if (!mantis)