From patchwork Tue Sep 26 11:33:39 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: 9971769 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 769C760393 for ; Tue, 26 Sep 2017 11:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 748B128E94 for ; Tue, 26 Sep 2017 11:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6991C28E98; Tue, 26 Sep 2017 11:33:56 +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 250A728EA0 for ; Tue, 26 Sep 2017 11:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935835AbdIZLdq (ORCPT ); Tue, 26 Sep 2017 07:33:46 -0400 Received: from mout.web.de ([217.72.192.78]:54318 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934463AbdIZLdp (ORCPT ); Tue, 26 Sep 2017 07:33:45 -0400 Received: from [192.168.1.2] ([78.54.205.15]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MgwZQ-1djeyp3p2W-00M6kf; Tue, 26 Sep 2017 13:33:40 +0200 Subject: [PATCH 5/6] [media] tda8261: Adjust three function calls together with a variable assignment 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: <8e60d1bf-ebdb-a9f8-8cf2-3dee7a1c4c96@users.sourceforge.net> Date: Tue, 26 Sep 2017 13:33:39 +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:ewmrOVwbOlxfJHw2VFsef9RIV3MeRuuf3hHCQf0YXGFSSSRfl/m YjYHHQMrxH6Qd+LOta/QCQy8ep5l0d9mZFLw7l6xqij9OemqTRCQ4IjKnrs6P5ANWo7zy3t Dh4KQDoPct2eWWxsCODcsNeMlJobhzac8RFLfkTxzjpC6sIu195fptd2aT+C8hgoOoqpNTA /LKxiFvB1WGP8Tgx1AVTQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:GSQh2Xj7TkM=:fZaCbDHDIQxAQGWqlCiax7 sP8XzlhwXjsDwQIL4eLqOt5W6tECEXmVYQrNc18Rs2zloN3EgMVym+YoUIZUBFVukdOMeyhDo 8u1K+D5BaLb2Uh/Ba98ORSw0o24DZ7EWZwsVtJPXPs7tq1boQWrs130URjmlN5CC6hnO6SP8A YLlNeV87Mw0roWYul85yhLGSvbG6hHgHjkD6ens+LG23TVjw42kb7s6gFdca5RuZCYn7jPOGU pieWjaAdMD989xiLAzB+AVP1mWe2ObLjJ1TGEUHdpZDzeUqD7oI6XFeud3I+U3Qm0sph0wi/9 z/95SOHzy47YnzXwPFDyUAfnhDcxMH3RPjvLjREGYG2YI8+j6MdShw/VItK0XG2nVnfjC+49S WtT0MVbsXCxhhc02WRyNvozpRKeRtyH7vN6gC0sDXcfuEkBq+UjP0krkY96xJFPyTFToUYQCH D0c2UV8ZkKwK5NteAR+22Eu6Z1p3vnNSFMYTiCcVpDACW0eppdi/TROY2v5NFIauq52HqzNRh uvuPFkubBDjCQZXhxpiLdndtM/0A66c6b1t7LN2WBvzjn95ywEufY/Lw/XQCPby3NHHdu1yCy 8QPsUb5eBReoDJxmgXa0KmIa4b15llGzd5ZgVgdZftC7uHEDKikK0oVcSLh+bF2tWds52m1wU H5LjuoMWL0mp3tg/D+3d6npYNEum5Rbd627o6q47rZkUBxjY/H07Hd68hyKZn5J8dT5xz6n56 fy/gXOP08QcEIX/6FPYEl/GLzo3iAKsqCDzMBks7i7Z1DcYKrr60yBtzu7ElFnbxdcP6Ma0pr bw3qlwkeS3Yk0EswMocPLL+SY4p8Hz0VLzfRRdz1PduNd0V2uY= 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:52:24 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/tda8261.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c index 492d8c03a5fa..20185ee8f253 100644 --- a/drivers/media/dvb-frontends/tda8261.c +++ b/drivers/media/dvb-frontends/tda8261.c @@ -42,7 +42,8 @@ static int tda8261_read(struct tda8261_state *state, u8 *buf) int err = 0; struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 1 }; - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) + err = i2c_transfer(state->i2c, &msg, 1); + if (err != 1) pr_err("%s: read error, err=%d\n", __func__, err); return err; @@ -54,7 +55,8 @@ static int tda8261_write(struct tda8261_state *state, u8 *buf) int err = 0; struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 }; - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) + err = i2c_transfer(state->i2c, &msg, 1); + if (err != 1) pr_err("%s: write error, err=%d\n", __func__, err); return err; @@ -67,8 +69,8 @@ static int tda8261_get_status(struct dvb_frontend *fe, u32 *status) int err = 0; *status = 0; - - if ((err = tda8261_read(state, &result)) < 0) { + err = tda8261_read(state, &result); + if (err < 0) { pr_err("%s: I/O Error\n", __func__); return err; }