From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751422AbdH3HWO (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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.14.1