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: 10863509 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 89F7713B5 for ; Thu, 21 Mar 2019 13:19:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ED2728DB5 for ; Thu, 21 Mar 2019 13:19:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62DC328DC3; Thu, 21 Mar 2019 13:19:45 +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=unavailable 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 010B72881E for ; Thu, 21 Mar 2019 13:19:44 +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=oVKPcoqUiPmUEkmSAQASMQhSJ0KveuGcqMl77zXPpaA=; b=J3q0HncpUzW+51 kbcTF4bX1S93j1m5P40Y18/MQUjbq7Sxgv/SZUZlEUqWJxAQgOWwT07sH8oyfC8D0oZgk+arZRnNY RXhoWeI5uJJ8b6Zvaq1SJB+JZVMFfU1ZfUd4QQ4Nvw/h6IAIHJ/rmR1QA+cG8B30JkfbwUkLNkfJQ XYgtR/FX2lxrsXhPit4QMRLhVuPaw97uqaVhTz4/7mFNX96u9bTEsHTBdTan/1ZJeI1T9KTzTGx9g 1aQwuHNWXzQJ8nCZXglnJXRqCagyFaXm8mPQESKSNUs8yI9lL0lS7mC/4jPoKTgRupTAsdpyaTZUp aOzUfSlKJFx77konKKww==; 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 1h6xba-0007gv-Fb; Thu, 21 Mar 2019 13:19:34 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6xbX-0007gI-Sm for linux-mediatek@lists.infradead.org; Thu, 21 Mar 2019 13:19:33 +0000 Received: by mail-lj1-x242.google.com with SMTP id j89so5300771ljb.1 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=cCSna5TeouCmhhkcP2axKKvvNZmxOJoCY3cB6Izix9YQXXdAVpC1E7mAtn9Z3FXQuF YuVfoAz/RkGZHBjj0P/qB37278Uk3ft6v5g774g/vXarK0D97Wqapk7q59XISplQGDDw AQrNSQUpTewTIfcBOBAnn9fzezgQNIG6Qrym6HTeeSn/j7XKq37nUFSVECX7gKw0Pq+E Fek0+qwtSO/GO62yNp4D095GZFFdW3VZsgtmJPxbRS6DZNXp1pDpXipMY0dG0gmwC8yz yVewhoAiCpOlMVkXrZZ9TrRTnncDNMge9jqrdetJcPU/ruf4s+a1nrO/uRNjL3C7mz+Z TOWA== X-Gm-Message-State: APjAAAV01zniyvPFxJiBmhcMEY5PVjGz1wKeBL1T/CZj/8KowN0YZFUt Ukam40KfKvUNz8v/Twn2+4gITsUPNhE= 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_061931_926955_E31938A5 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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; } /**