From patchwork Wed Aug 30 07:22: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: 9928805 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 0790B6022E for ; Wed, 30 Aug 2017 07:22:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE64727E63 for ; Wed, 30 Aug 2017 07:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2F5D27EED; Wed, 30 Aug 2017 07:22:26 +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 9E8FB27E63 for ; Wed, 30 Aug 2017 07:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751326AbdH3HWO (ORCPT ); Wed, 30 Aug 2017 03:22:14 -0400 Received: from mout.web.de ([217.72.192.78]:57915 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbdH3HWM (ORCPT ); Wed, 30 Aug 2017 03:22:12 -0400 Received: from [192.168.1.2] ([77.182.113.36]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MddBI-1eA0Wi031I-00PPdb; Wed, 30 Aug 2017 09:22:08 +0200 Subject: [PATCH 4/6] [media] cx24116: Improve a size determination in cx24116_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Wed, 30 Aug 2017 09:22: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: Content-Language: en-GB X-Provags-ID: V03:K0:/MtNRVdGD8pj/SMmDhf628Eg1hkJhg+d4yaXjqIFqCxnTjEYDy2 HE4V0B6hIUKFuh98a0zwDYDHI1I5rqgNmyU6Kin7wBONNlvlkp9n8c+no56A5lAH7ds+QDK kKw8YkGU2cG87sfEY+NeQFyYiUVpjEI3g3qQBeVTXOCPhXitoJ2SphSUkps24Z/1LhobabN KbZocMAOs77ctaXjH+aBw== X-UI-Out-Filterresults: notjunk:1; V01:K0:3ZrFsP7jLgI=:Dxz7Wt1kTrfd4Toh/azGFy D4iMvW6aY598stc1twFdJ5MJv7LKBY4QJIfQMRDuGQcCC2IX4teEvLBeiSynD6eRCpioTqalc Q2MiD7VKWRei6Dp4t9vF8Y69rWiv7Q4OoxGYStw7uslAI7dZSmaiKTsgDTx43zFFJddYunlxx u3YdZ7sJzNsGEPhPV9tiTTO/52+5wO3Xz/GvmCKyx/AO8Z3i6S2mjsDMhz8OhwlZeFpPQwCjA KdyMqdmfc2GioP3iG+M+WWl8td71B5rRQiwkmVXr2QQoT22NsTqzC8/cmh+GGOHIVoxqJKvAP jF6kgfnmwATVfMx3kc7UdgkS7kipUuF/+Vo0Ug2f53rC0hmc46dFq/C0qgJU1OvUGfwj6tpfn 8iuYO3sqa/F34eDzTQyadxHAwmQw7F7u3KlSPRmCqDYr5fXyl8cgXf/PWJbhmej+UrT7N0zc0 MHosVLGsH4Ge7tgYZxyV79A8+FE5HzF8r82BCPiRbhC4kvGRpZy6DDNwLc6pGRkWPEhmfsc1Q 9zJW+TA9DGa7Q8nuvcuIAYAyJZUph79BemwxeB2GlEkLLmk24QxuDGpTRN2OuQ0O/F0oJtiP8 wweyo/fY8vXMXMfyc8I/RjT2XCiGzziDyfJQykelFY3Z/2nZYN7N0d6Z/A78DYvVbOznySi52 ladg9CS1VdMU7QGUwoMOeS3KXaitATef3d1nHTmWxtNtK3+gc+91U8hD7w2B3E45wtCW5tVOU nv+3jl7MWnmKnYX5u2CudSp1E0qQqjkHylNQAB0QER8Lm2Yq1mGMCqSQFu0cgLqUpoM/mteC4 vsg/iG5s+fVY0HAEFpB0DfZL0ZD1nK245/mfaygJmKDJ6UdAA8= 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: Wed, 30 Aug 2017 08:15:33 +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/dvb-frontends/cx24116.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c index 54f09a5a5075..74d610207bf2 100644 --- a/drivers/media/dvb-frontends/cx24116.c +++ b/drivers/media/dvb-frontends/cx24116.c @@ -1123,7 +1123,7 @@ struct dvb_frontend *cx24116_attach(const struct cx24116_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct cx24116_state), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) goto error1;