From patchwork Sun Sep 3 20:34: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: 9936573 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 E6A63603D7 for ; Sun, 3 Sep 2017 20:34:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB68286B4 for ; Sun, 3 Sep 2017 20:34:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA91B2863D; Sun, 3 Sep 2017 20:34:53 +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 8888D286AD for ; Sun, 3 Sep 2017 20:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752497AbdICUeW (ORCPT ); Sun, 3 Sep 2017 16:34:22 -0400 Received: from mout.web.de ([212.227.15.3]:50869 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbdICUeV (ORCPT ); Sun, 3 Sep 2017 16:34:21 -0400 Received: from [192.168.1.2] ([78.48.243.242]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MDPYb-1dhAQD1aNZ-00Gqmi; Sun, 03 Sep 2017 22:34:12 +0200 Subject: [PATCH 4/7] [media] Hexium Gemini: Improve a size determination in hexium_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <170abf7f-3b62-a37c-966a-8b574acae230@users.sourceforge.net> Message-ID: Date: Sun, 3 Sep 2017 22:34:06 +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: <170abf7f-3b62-a37c-966a-8b574acae230@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:rUJHQerakrslETdISTZRpTYXLqnjhXbspyu0FdLxryucxiYUFhp U88Am6/Jw2Br6jBOoFwAliTlTUcmfbAiQ7swwuurmqhVKeDHqELHKKXRREMIBNi3zQ+J7qJ idMHcyKd8boWsy9yTa8uocmfBPxD21VIXp7eWpnqzV9TVH6DaU1Y62Oj4YlhiUZwkyIYQnr hsmraF2AcVgmlO8iHvYGA== X-UI-Out-Filterresults: notjunk:1; V01:K0:cTpJNZUk19I=:c50I8a3RDFzNF7HiRv0hlp jnOvM/0u7obOQTMqkjB2pkgGFXQrRh/qNNCeirzCUe6b7OgtMBm70DaVf5yOzDx3E7NtEzhuk JJCw2C3lEokj+3mqkcVrAhxgIZXVUA47FyN2IdwRGvRC0y1e86DenlLX19PrsFwCkKVL/0sIm SaYnZlRwfCvjLVfkr65f47limhxdkn8OfmvvrmVm4rNj1xSS/L1wSQJxfvy4zjp5qlOunGrlh YNFTQV63YTowQOJ4Ywf5IG8zwXKiGbg1ilgEzFhsCtDm6ZNSNS/yWp2i8HvVOieFGq4l4BICj BSHDOosE7s3kjPXew+DKiC4BXRg+sANT0OLNVy1YMjXTrUf9Nq5tl9SCW6Y2y69OVE/NiNi8w 1O741cjybTznLDXk7zZOH8gmEsCy4MhtWJdn7TarIc1onJRoGeQV4saPRc3FW/aNzWgMuP4am yDCohRUOwv6EaOE3fcljY6Ux7AJuFKmTzF9517KU8bqQj6GV1P/djgLQGjGnWjlzu4DjTjb0+ HrKxt4dVADBsTVzCVTDyQdKsRaJqycY2VbzOQjM2WidBZwQ2Zy7B9mIpc9nPg6MX5BnL0yYSW GRM2HFGn5MXh2nEDDQm/uuMVmhS1Kb35fqbEpdNAR0nGXRQDZy46HvdkOTPxSGTA+Bd+G17/I XjfYEUlGuUnI4BO1maUcgoeYt8QnzUDC7GTZp4cvzg2hnem+HZNji/VxGvvrenvqmjDsd9VWB /cq8UtC45NIT9fw2w23VyUryw2aIaKXM2pNigANwnInEPysvU3BHHeLCwx0vhrGFRqg7LRlM3 NG478giW+zPYsJn+M+FeWhMxhOZRcc0qhBmgwy6nQfaS3Q0FL4= 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: Sun, 3 Sep 2017 19:51:46 +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/saa7146/hexium_gemini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index 694b70fa3baf..a0fcf8150291 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c @@ -260,5 +260,5 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d DEB_EE("\n"); - hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); + hexium = kzalloc(sizeof(*hexium), GFP_KERNEL); if (!hexium)