From patchwork Tue Sep 26 11:28:51 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: 9971743 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 4BD8F602BD for ; Tue, 26 Sep 2017 11:29:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B29728A6E for ; Tue, 26 Sep 2017 11:29:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF4828AD0; Tue, 26 Sep 2017 11:29:08 +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 E153628A6E for ; Tue, 26 Sep 2017 11:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968191AbdIZL26 (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 Received: from [192.168.1.2] ([78.54.205.15]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M73WL-1dByY23pXZ-00woLJ; Tue, 26 Sep 2017 13:28:52 +0200 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-Language: en-GB 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-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, 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;