From patchwork Tue Sep 19 18:46:30 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: 9959957 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 8BF7F60568 for ; Tue, 19 Sep 2017 18:47:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C5C4200F5 for ; Tue, 19 Sep 2017 18:47:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71339205AB; Tue, 19 Sep 2017 18:47:32 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 297E7200F5 for ; Tue, 19 Sep 2017 18:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751780AbdISSqw (ORCPT ); Tue, 19 Sep 2017 14:46:52 -0400 Received: from mout.web.de ([217.72.192.78]:56045 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbdISSqu (ORCPT ); Tue, 19 Sep 2017 14:46:50 -0400 Received: from [192.168.1.2] ([92.228.164.239]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MWRzK-1dseLd2udu-00Xd2P; Tue, 19 Sep 2017 20:46:31 +0200 Subject: [PATCH 2/3] [media] hdpvr: Improve a size determination in hdpvr_alloc_buffers() From: SF Markus Elfring To: linux-media@vger.kernel.org, Andrew Morton , Arvind Yadav , Hans Verkuil , Jonathan Sims , Laurent Pinchart , Masahiro Yamada , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Message-ID: Date: Tue, 19 Sep 2017 20:46:30 +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: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:VcOfzQkn06MoD+usFGE/cj6QLR3PMjkM8HxmlAuX3Bp6xsosq+V iLGux1e9O/yUfyJbp309mBT+DXoiFpivz00RG2NnbNuM5tSndR8Wflhr9cusc66JFeX2Ys4 9OTKbYuBPeMGfrg02A1r/j/fCqmIs5ddt/lssmCe9GyjToySbKnxA6WhNPIYUR6gF7Dtm6c 9Q+wrdrXkAPiolKeF3amw== X-UI-Out-Filterresults: notjunk:1; V01:K0:vx3n8GoR3IA=:HQaa+Uti619B56tTl5xSXE u0QAa8Yp1FVdvMGtgwennblLD2aun5Re9ogTjh+gGrvn2RrwqRvACHYl7mPZzbzK/W78cJBj9 eccIwqq7+H8smBhTN0VA2QQKZp2wVJHk+l/QEE8H7bpxyJVfxsucdx6dS9r3fK/mBYmD3r/so OC22VFsdxxRCruL5dWtHIePHTJVBbjuF83MOLCpGWLuvTDg8oZhuq5cC4xajC5evFuvwSybdT qOuORhJmlS5Xyf+ccgMP/zX1TE3ZwQTm6ARsRd1HXrDwLlgSbWaZimT6jLeT/FT36Oc/DR/FE M5qgsXF40GccUepuKAyOn7NOMQ4jS7medROB9BMiU+n3y+SCCRv9G+a0T2sy/c/atLY3lVdy/ 14DxKQuEE6ovsVvFE6jzffyqIKMi4gGV1dCmo/4bsw5O0ZrhWVDkHUBrg+coPOkJaqnovGRRx tXLbjVwIVXEDrA6oN7dkwGpw/oW5zU/VZv63mPU+QlG1MFaCkOjflL7gdKnGa0KCAE8vZHc22 b89BLN9EIJ378Pn2BSXcunJOIxAxUkrAjOR/cjACZrpivpg2j5IGhU1oe1n7x7gXCZrGYs4dI yN18bIYVswzk2OYMsA+cpQO3BF3pKK5vXExRUrpEEaMeQxEKSq2GvaItlbPCrnl6l+YFq/O/1 0IS6xoCEXPQXFSW/Ua1qG4gylRfqzw/hQ1rZsbkX1Qm74xpiHkZKoiw+0yk5jJtS2m22apPH4 FopTM+qSAtmvB/a8T3leu+jRT+0jlMiZBDSUhhrlpCbCUdWoM2keOU/yM4PkbCoC/SGY4CjUT 3ujbpT87sDtPUthSoeQETY3Jhg/yHSvUIV1fxsW2RxF6dTEC9E= 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: Tue, 19 Sep 2017 19:27:53 +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/usb/hdpvr/hdpvr-video.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 657d910dfa1d..f06efcd70c14 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -145,6 +145,5 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) "allocating %u buffers\n", count); for (i = 0; i < count; i++) { - - buf = kzalloc(sizeof(struct hdpvr_buffer), GFP_KERNEL); + buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf)