Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968227AbdIZL26 (ORCPT ); Tue, 26 Sep 2017 07:28:58 -0400 Received: from mout.web.de ([212.227.17.11]:52561 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965000AbdIZL24 (ORCPT ); Tue, 26 Sep 2017 07:28:56 -0400 Subject: [PATCH 2/6] [media] tda8261: Improve a size determination in tda8261_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: <15d74bee-7467-4687-24e1-3501c22f6d75@users.sourceforge.net> Message-ID: <2225a61b-d990-e2fd-2217-5d860ed86a24@users.sourceforge.net> Date: Tue, 26 Sep 2017 13:28:51 +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: <15d74bee-7467-4687-24e1-3501c22f6d75@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:StGptTSsr5YHEzeBwDR0dCKmMQTqNaCyyAFM3jUplaiPIU/gyhN zEOhLiRXrwMzJrgtI/44TXK/PgYpYnR1L/H0im0u1j0cRoCTbG820pTDQKVqDVdJn7mx6E4 QRvEmPrPdMWsZ1/YXF+UzsZFOqyHcMnruGlHVJ8SnIoe1Ecfvo+s0e0gm35lzVyi/ZupG5v ZmVJ6+wYUBs/QrACnrdkQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:gvbwaMTV0Uc=:9i6zX9XzooBhiR/mdOVHxP +aXVI5DYnsFQVQSm2A8mg7neq15N5gKCfWSLssUQcrcykQ5jlr6tMjamvHkpN1MHTMITim1/S JwfQVMVEEk4sW3vniQGADEUXkOYJd9Lrg7o+TgOmtAqGEnAtuVO4hnMENMWRTc3/yNo6eI2Tf +vY9D6NsdxGTc/i2R4sog03KMuqBXiW5+SgXGXwjM3cPfkhqYodPw30wC2TQOm7FMm+BfNvWB R+qVE04t97MuwQYhtvCnavZhZDBMTKii5QAclq+peVovDRSXx/+fWSMMXyxudXyV4A+kpBoSr 4PSx/xnI+kR4Jct1UaASfQLOgM3ZzrxNkKmfo7WERowOygBiTSWd53srjJ6FwV0D9OpvfXLzZ pWuTZKRXCFK9euvb7dFrOed/H0J6wF/WYPEBa3xUInh58njWhw5ZeZOrlN6e6xlG+egqiqJfX gfCO04xVSU6a2Q5FARGEchJTT7/D4i00Z0c/KXTMq8MHqAWhRs9G/YzTkLmXWSaOYU+9SvNqb J5M/PW8DM4JRihnj/Q9y94xSLEGebi3gqvgSu9Yv3vnWE0Ea4ekfjfTnt/SXbCjietuDLnTwv Kao+ULQFpTJUYL1oRMmpUat0nMg1nf+mwG+V+Og53Fos97i+UgyeIrUO4xYJ1fnHU0mudKQ8q FFRD2vOHuojGsGtIQKXz0v/14O+1CxbYPfrlErzw+UxV2t54+91EUhuH4mhkBqMiuzC1rB+zi 0z7FLiijehSH+6YQ3eJlaCyFSyrWIk2HZjSFDU8mzQaf7zKPk+ly93jLrGg00mAwQQhdgU0AC JM3e3kTmzCQFdpYSg74iV/Cii72SifCT72hwhLie3NyjklXCfE= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 34 From: Markus Elfring Date: Tue, 26 Sep 2017 12:06:19 +0200 * The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix an affected source code place. * 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. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/tda8261.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index 5a8a9b6b8107..5269a170c84e 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -185,7 +185,8 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, { struct tda8261_state *state = NULL; - if ((state = kzalloc(sizeof (struct tda8261_state), GFP_KERNEL)) == NULL) + state = kzalloc(sizeof(*state), GFP_KERNEL); + if (!state) goto exit; state->config = config; -- 2.14.1