From patchwork Mon Aug 28 10:12:08 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: 9925143 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 A375060375 for ; Mon, 28 Aug 2017 10:12:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F2C2851D for ; Mon, 28 Aug 2017 10:12:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89CE32852D; Mon, 28 Aug 2017 10:12:35 +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 2DFE22851D for ; Mon, 28 Aug 2017 10:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbdH1KMW (ORCPT ); Mon, 28 Aug 2017 06:12:22 -0400 Received: from mout.web.de ([212.227.17.11]:50093 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbdH1KMV (ORCPT ); Mon, 28 Aug 2017 06:12:21 -0400 Received: from [192.168.1.2] ([78.48.87.233]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lba7D-1d5TTl0FMR-00lBzo; Mon, 28 Aug 2017 12:12:10 +0200 Subject: [PATCH 2/2] [media] Cypress: Improve a size determination in cypress_load_firmware() From: SF Markus Elfring To: linux-media@vger.kernel.org, Antti Palosaari , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Mon, 28 Aug 2017 12:12:08 +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: Content-Language: en-GB X-Provags-ID: V03:K0:cvCjGV0KJadeLMpT1iWnhYVaCGH1pQ5LrB2gQB5zOLWJZBvmxxf eLx3XntCHMRtAH0zK3yp0R1lu589QwIDmCpWXZ10Xun1ZUCA9vnTnf1M2P8Vma4XahILoRO lv5kZCuEzDsB8V3RYU7IH3H4U8wcJeWvmnk9uxG3tXch92mx7vtKCwOAF6vgsvYW/qNraW7 24BvMrdFx9ttbl5u946uw== X-UI-Out-Filterresults: notjunk:1; V01:K0:m3WioovJ+As=:9xx36gZ2Pynp/Y+acZpzfu bfSRE2wPUO/p1hAa1xnOi+u9Zcuj8aTm8sx0Z4Sl0aXWGuWA3tqF0Ch9dhqrUA+v4rQR88QCa FYbmuosrhh49cTchmzopD+eYlMluq2xah5Rgnx9iwKq367wB4ew8q0ZeXa7XQ4gaNPfn47SZ+ ZJmrb4YvlQxuHwK2Gp7Fvjaj6XVi6yaxYmMr/YMj2VNYsvUAh49bNtmdqZVjnNnvnh5gw/7Hi ArIMSg640lAQznV8o/V2C/Yn9g5SkayXfyl8ozt1HYTCKJpLjmxGajOk/2KSVNGT1vdtnJIo7 U7SICLvUM/VIVLPfWNmiC4VRcjh2a95A2xK4IqgmisK2PB9Pu35jL8iNo4tgyVwwvI5Xuimcf /ebASTp7UqtamAGOvz8aBfgzFWkvsBN/LG0Xs2gJ8RmCjGSgYRj3QHL3JB7XoePIERQOd9n50 jYW0PLR7srM63zStyn+hQf8elNtG6SIfa65KqM0X3gso8Et/305g+zrxKm/SYwbCGaUQrS2Xj i97lJG7drqYQZtvsxfo8nq7h5orUYVRrbyb4s9Qqlvnu6ImayOu7mWLxEdHS67bF/bNe69F/y 8I97ZhtlAWwVzmh5dcSFHmMn3BIRDDQAczrKkxwZpIBzSqMVCW4urKfRdSkhk9cBQ6l08KzKq EZgtGMVd2DFp9uvJpD0PAPfJZLR+m8hUB8Lm4L1gqV+igfwgR3K/IfzikvyDOBkuP4wTX+iPl uyvBVMB+5eoidvtnjZzGG5D/LUlkAs1hE8v+uQF490VIKYS1RGrqpIL853v05lNGeDQuQSf2V d+TDKDMjiC+7xixdvp/nA+NiRtb9xEVkcnSBF2O2QhYdnuRooQ= 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: Mon, 28 Aug 2017 11:55:16 +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/common/cypress_firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/cypress_firmware.c b/drivers/media/common/cypress_firmware.c index bfe47bc5f716..8895158c1962 100644 --- a/drivers/media/common/cypress_firmware.c +++ b/drivers/media/common/cypress_firmware.c @@ -74,7 +74,7 @@ int cypress_load_firmware(struct usb_device *udev, struct hexline *hx; int ret, pos = 0; - hx = kmalloc(sizeof(struct hexline), GFP_KERNEL); + hx = kmalloc(sizeof(*hx), GFP_KERNEL); if (!hx) return -ENOMEM;