From patchwork Thu Mar 21 13:19:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 10863507 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 69DD813B5 for ; Thu, 21 Mar 2019 13:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D8A22A1D6 for ; Thu, 21 Mar 2019 13:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41D5829C3E; Thu, 21 Mar 2019 13:19:42 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0ED12A1CD for ; Thu, 21 Mar 2019 13:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BZKOhDUaBJO23ZHH45qb6Lm2+DUfKl13l0jl426qs6g=; b=bLDAWGTwl81T6c ieKt09/eMDWNklJuSev/nXyl6kzcaaDm5Q0lb8QNsQ9rST/sIrekxKYLamxuFlIbPC6V1CVq5AfgF TQKxx4z6SD4yvPcrdXFK1XTvXgB8HhlU+fo79DGJvDjHFJSnzglM0+G4+nWlqTVSXHMatuPlAakXl XWqY+rMLQUK55LUMxfHT0Wiwemuzlx6RADYQo0nDx17PFXJm6tITAvBmOAIFtxSUBHdbYSHWOfAUE eJovCPRMDlEQ3RT98cNHMhBgAPvZ+wrSgjvh2blJ0krBadAdweMfJgjkHjo7+Wjcikp1YYjDTy1wy feM5k3OSgi+uefdp/EqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6xbb-0007hK-7p; Thu, 21 Mar 2019 13:19:35 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6xbY-0007gH-1T for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2019 13:19:33 +0000 Received: by mail-lj1-x244.google.com with SMTP id x13so5249201ljj.5 for ; Thu, 21 Mar 2019 06:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9vEE+IWH1UQ/MYCPFbtRTwD8BWeX2JpFTXYc7Ro5vRA=; b=eqt07IO2L+GP5NlWtP6wSmasOxMFMm6uR9nrBOshubebkmUQJxXFY2AOn7j8Q5z47f WjiRwX6XPBzhPrf7NJnjmC4TLiFg1X3tz8gObiG/6xHvWu0UjA9KdvMY/CnS1/5oSyB1 cXsV4Xdgx7HMN3A2JcOhNwfBhQTAn2SY6n9TJrMi0g1swSoxjwIUwZo3OWyb1VN9Qza4 zTNt/ByTGPSifxMDwZNb+30+py3F3OyJZfcUQz0FPgIKe+qZymYwlqVImwKvnH0WiOun S1mLNyNxc2bNxc5YZG/s//EmqFebCuUOTn55wDxE8WJjKjaX7EMmVr1YuPPp2p3CZLvj CQZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9vEE+IWH1UQ/MYCPFbtRTwD8BWeX2JpFTXYc7Ro5vRA=; b=sKdF+tu+lgNyhaYse8n5HP5ApBFdI8fwz+rFUw7+RHj7R2Cu7447j43lyQ7S/R0Rcd bw/tjGEvtm2DZqCejgUvMjo73mbzh0O2p5tqEfgGT12f85HFn7PwO9w7KAOBLb8FDI2b crlXQv6UStl7q4NX2CA+g63vm/LFaAQW5X1kMFkFoWrRDfwI2rSR75ZhpEQ8DzIDpe23 weDOwVGJ6BZNZeHesJthQTUuS5t0/TahHOzCssEwthGmx1cNoq+Hl6DpoO5CmDAa9u4m D3TACz3GTLQNeM1/JfKVkPNs/qzJHIrhLqyk6U21MoJWYrzcYL3cqyp07VEabUiujSVj eLGA== X-Gm-Message-State: APjAAAXPU3y71v77gAufux2rb6dRlBa+KaR+HQopb1BZihmmdGEKw1co lk+yyvZF34vJCFeLzglUtZKzrA== X-Google-Smtp-Source: APXvYqxlhvHaT9akV8SGIwO9h7EwW9p75tBnryeDP9GZ3dd3qD480c5vKuE0KNx5SQBBATXMYE1/ew== X-Received: by 2002:a2e:97d3:: with SMTP id m19mr2020201ljj.63.1553174370161; Thu, 21 Mar 2019 06:19:30 -0700 (PDT) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id i66sm840726lji.43.2019.03.21.06.19.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2019 06:19:29 -0700 (PDT) From: Anders Roxell To: jejb@linux.ibm.com, martin.petersen@oracle.com, matthias.bgg@gmail.com Subject: [PATCH] scsi: ufs-mediatek: fix uninitialized variable Date: Thu, 21 Mar 2019 14:19:25 +0100 Message-Id: <20190321131925.27421-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_061932_080211_4171BE06 X-CRM114-Status: GOOD ( 11.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Anders Roxell , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When building the ufs-mediatek driver variable 'ret' may be used uninitialized. ../drivers/scsi/ufs/ufs-mediatek.c: In function ‘ufs_mtk_setup_clocks’: ../drivers/scsi/ufs/ufs-mediatek.c:96:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] int ret; ^~~ Rework to return directly instead of using a local variable 'ret'. Fixes: ddd90623ce26 ("scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips") Signed-off-by: Anders Roxell --- drivers/scsi/ufs/ufs-mediatek.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index ce4767784937..330d68871b06 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -93,7 +93,6 @@ static int ufs_mtk_setup_clocks(struct ufs_hba *hba, bool on, enum ufs_notify_change_status status) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); - int ret; /* * In case ufs_mtk_init() is not yet done, simply ignore. @@ -106,18 +105,18 @@ static int ufs_mtk_setup_clocks(struct ufs_hba *hba, bool on, switch (status) { case PRE_CHANGE: if (!on) - ret = phy_power_off(host->mphy); + return phy_power_off(host->mphy); break; case POST_CHANGE: if (on) - ret = phy_power_on(host->mphy); + return phy_power_on(host->mphy); break; default: - ret = -EINVAL; + return -EINVAL; break; } - return ret; + return 0; } /**