From patchwork Thu May 2 10:59:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10926585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CDDD92A for ; Thu, 2 May 2019 11:08:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87EAD2853A for ; Thu, 2 May 2019 11:08:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A9C828C22; Thu, 2 May 2019 11:08:15 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CED702853A for ; Thu, 2 May 2019 11:08:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2BE9E1796; Thu, 2 May 2019 13:07:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2BE9E1796 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1556795293; bh=3muwujY3Rb0ir0gt2mT2icGeL4kg1JanP8FaCsvzCo8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qpnYUR/kKXi44NmkNVaeMjL+RUag6NF1jMj+pi1WRhTfF56vR1LrtX8SwDwg1+EUY RZJGiTz6/VX35ixh8q2mPCNHoHFLFMAbGiqxYubR6Dp35dWV4E5e+2MesSNyT/xA/o FFJyzwTF26ZuaV6gZuLPhS/Q3LICY7vItIpQKqbw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4FC81F89750; Thu, 2 May 2019 13:00:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6C748F89749; Thu, 2 May 2019 13:00:41 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7E497F89744 for ; Thu, 2 May 2019 13:00:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7E497F89744 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q5pHCxpn" Received: from localhost.localdomain (unknown [171.76.113.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AEAF2089E; Thu, 2 May 2019 11:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556794837; bh=1A74646puAjURq5Qq3C1h6TqzTfKtfb7ZZr985nSD08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q5pHCxpnr4+QePhDKlCY725qQVvLWDD8N7JBRLv+Vs00qlBURZZaAi8caqjYIbF/l MDt8UTUfHe1AqarESepP5xmtmJ+wPJE4EYbmjHWEIJvTFl3BjHTwqxe/GfyakASDNg jnYcglJ6wthgsSWCQy205dw2wTZqoj3ydvVRDAkQ= From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 2 May 2019 16:29:26 +0530 Message-Id: <20190502105930.9889-11-vkoul@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502105930.9889-1-vkoul@kernel.org> References: <20190502105930.9889-1-vkoul@kernel.org> MIME-Version: 1.0 Cc: Greg KH , Sanyog Kale , Vinod Koul , Pierre-Louis Bossart , Shreyas NC Subject: [alsa-devel] [PATCH 10/14] soundwire: avoid multiple assignments X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modify the code to avoid multiple assignments by assigning to variable after error checks in soundwire bus. CHECK: multiple assignments should be avoided Signed-off-by: Vinod Koul --- drivers/soundwire/bus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 16b2a3b2662d..aac35fc3cf22 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -812,12 +812,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) sdw_modify_slave_status(slave, SDW_SLAVE_ALERT); /* Read Instat 1, Instat 2 and Instat 3 registers */ - buf = ret = sdw_read(slave, SDW_SCP_INT1); + ret = sdw_read(slave, SDW_SCP_INT1); if (ret < 0) { dev_err(slave->bus->dev, "SDW_SCP_INT1 read failed:%d\n", ret); return ret; } + buf = ret; ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, buf2); if (ret < 0) { @@ -910,12 +911,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) * Read status again to ensure no new interrupts arrived * while servicing interrupts. */ - _buf = ret = sdw_read(slave, SDW_SCP_INT1); + ret = sdw_read(slave, SDW_SCP_INT1); if (ret < 0) { dev_err(slave->bus->dev, "SDW_SCP_INT1 read failed:%d\n", ret); return ret; } + _buf = ret; ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, _buf2); if (ret < 0) {