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: 163255 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp5585788ill; Thu, 2 May 2019 04:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCsuZfh/OizodnLJBpl5F3SNKXygi4iOzdEd/Sux5AUJrgKt7sX5DuokU51v34MKZBlGkA X-Received: by 2002:a1c:1c8:: with SMTP id 191mr1918859wmb.101.1556795293934; Thu, 02 May 2019 04:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556795293; cv=none; d=google.com; s=arc-20160816; b=Xdks1oHi6AGGzHlIOKYFZQ1KwuhKE0ytRUnH/nBjdLm+trLyOXLiNy+YOUqcJ27n++ mMt6V2CFyY0OoUPJ9LeTa6s+vZN7K6UWmiufb8R7Y7PB5yLINgGSXJI8J2Ke7E4CCBmA dMksho87exPE8a5ktvPWw78BpvvSJHrRZa5y7ts1cWNAUU856LbSO1xN2rR3+ylwoUl7 sUfZsU+ytFMRyYBaGHrKFxrKK/DuRfuS8RdE7Ip7NbJwnsFvXDtMeH9FJx7sFgbJnK0r Ijh+3v7IHN5eWnHjhjHrEwD7IgtNqVYtLJuvTeZEegMK4rKlJ0PN3yLc6jbzXbrru6hH mu8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-filter:delivered-to:dkim-signature:dkim-filter; bh=XNV8Ig8+ZYaE5GjS/s7cQXZz589jcPUufg0i9MOu4Yc=; b=qS67zjD8tXRw8RKBRDGbAtiyhBCca0mbnMGbNtORHo3Omrq8SeghHb+Nq1mr8v9paB k81g4pIk9jxyDbyFyJALLkIdqPQGrU6xpg6hKZ2z3LhebFs2WcVKQB3tZTOWpdRTyWvR 2b3AFVTBiw13CnMZlpwPX+FPMtg9GugxyyunU3q4E2zNETX3p9IattxHftBpvwtXcj0O cwJwyuaEJSHPH79We6nacXtGg6UETBjnv4u99VajsGf4s9h5z7A/zEbsJmwUwHx2FJIR yz3t2QnqRZx8wzsrKyjc0BaK/Xajiflo4DIA3R7kMBs+FJ16UBmHgkOwPnTZ+lkY5bHr 83ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b="qpnYUR/k"; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=Q5pHCxpn; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTPS id g26si4694739wmh.105.2019.05.02.04.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 04:08:13 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b="qpnYUR/k"; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=default header.b=Q5pHCxpn; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS autolearn=disabled version=3.4.0 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" 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(-) -- 2.20.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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) {