From patchwork Sat Sep 2 20:42:07 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: 9935813 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 F068E60390 for ; Sat, 2 Sep 2017 20:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E35A428680 for ; Sat, 2 Sep 2017 20:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6E332868C; Sat, 2 Sep 2017 20:43:21 +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 8320928680 for ; Sat, 2 Sep 2017 20:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827AbdIBUmN (ORCPT ); Sat, 2 Sep 2017 16:42:13 -0400 Received: from mout.web.de ([212.227.17.11]:54980 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdIBUmM (ORCPT ); Sat, 2 Sep 2017 16:42:12 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M2dg1-1dXfh43EVZ-00sQgc; Sat, 02 Sep 2017 22:42:07 +0200 Subject: [PATCH 2/7] [media] Hopper: Improve a size determination in hopper_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:42:07 +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:uYt2+rMTxltiZTntLj4pcukitfJlulB4LBV5X1iqJe8Af16zEyK fIUCbZj8r/AmcBzx9FaFbw7MlfLs7Y83Bj/YFqyZqVPEseajyp8HYMHLSPA/OiWdoYdYsCx jSdOOEi9/vnudwLBS1+/a6cArXyQI+RNDiONRkjn1KE8Cw59hil4ymWKIwAs57SV+AFb2h/ pVR6dV1Q2Wssh3MQpCWYg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7aaT9oEFr+s=:mdXU99jNUOGAIcn3S+ov4p bUcniy8J81ZSwWtCH812Hldx/gbgOcHEKNxKywa7PCCj/Pmyh8GpxI4HwtzLQ1/JROvXNToh9 TOIyVTHp8RxZMLBM6vy9cuDXl+9Uwb/o3ieWL2hf33Dl8NUeZeqFmoZVHQx2gXyWnyGchsd3w SGGYjN6IBrs3/qE5c8/D3sIts6HoCiLCQY1YeRIGqIOXtm+RiUnDGv55RrHTRHBLC0dPhhvfA 1u8ObkervTFDPqu6/STfitx1RgSIiwue6QmvnFTu2IqwLArGueukCCGAxuTKidi9l3EtCFYHD LOGbczQ7Ez5l88M6mO7uLDAJYfaft+f3p3eVM2hTg9N8DQmJGOeo20Avw7p85IZvFKVIaCdPO pqIzjc1K/C6XyCQdVjU7cMq/dvgCM06ar0ilgTJV3Y5owVHESoum7sGSf73v3uPFP5dz9Iae6 im+UpvNtKjZvjeY9ttaLnlFaiwd6Snc+g3jzM95g2CsoYC5U5W3qiVPaKAXfIQCnhCLWsflFz CDrr+88ZDxUF+Cj8YvJZkd6remOY8kqrHR7BRi4YmCEyP6EYl+EQwhTUkDU9jmKkeIC/DPGXN SenFXCw4Sqy/S4dGWC2+AIkwQ/WhUuLXeMMyxEPTBHsdGvtN6gt+hb8EX7cyL61luSRJrVG/n hmSlA9ttjP1B4jJiKYdU3d08kblhIernAfMGKy7CxeCdeeqU6n6qccJ0Z0hOdjpW95xw2Iq3r 8JiK8vE/11oimSlCUpaCnONtT1Wnc3+OtAYNHtjorDrjOWKpMp9uQ7El58yIuY9LOgkT9eYYu rmfB9MnuuBNqgA333GWx0am+ID/R/x9pqwghrf55XHrX9j2jjU= 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:21:22 +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/hopper_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index cc1bb04d8cb4..fe7b40c306f7 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -163,7 +163,7 @@ static int hopper_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 == NULL) { err = -ENOMEM; goto fail0;