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: 160791 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp795984jan; Thu, 21 Mar 2019 06:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3CNUFVZlOzvaZMHzA/PXofXh9ahGkM+0GqqB9eFCGK8ZuHrFORBfmDAMFg7q8oGh/i8Lq X-Received: by 2002:a62:3001:: with SMTP id w1mr3256218pfw.59.1553174373137; Thu, 21 Mar 2019 06:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553174373; cv=none; d=google.com; s=arc-20160816; b=hwU+iAaL53K+KvTYUnvmF9duyDdBKKIMQ/QljmOgmKnSEiutIGLLEC9mrtD+5lmsI1 hRMD2nlzzihyM4q/oIZ14a+iIVnd04VvwUEyImI0TEwnL1oDhXS809bas0+4kC5ZgArN lFt5NugFScwcjgmZAQVTNY7WCV3Og9NpdCyPR9OR4FoHgwOf9YTotSixdzmaIl5WKSbV ZhQCWFiDKhPBSCjSEMMVKwLgdr95DV2FhJbHhl4kGPh0wxPQDoogl7kUrJEcFxhmh9+y bohZQv4E3CYGbk4/CES8DF9M0HFiGQLabqwX+7PuMVal/xtx+JIy2eB619WvrIrky/Nd w8Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9vEE+IWH1UQ/MYCPFbtRTwD8BWeX2JpFTXYc7Ro5vRA=; b=C6yx1OYWIMDI9c34qpXW1hM6t/qZpnEimO9ZmAeJFsJyssd7IegsUXYe/GTE/8N5s6 K2ys4/26DG+GfPUDf/LYHweGq3aVtmHXAJ0aQiMBsi2HfiEKM8WmV/2BNAEEWFfUf5cH 6TjChFeyG+/WEC5cBC7KohKyIMlORaJa+tRtOj9rGSywWup/JXOiQ4Fwa0FukW+MyA9T ihBuDOK7RYurnbjBHsluxIEiWurW2liWDPWYsmEsuy2FBqpMoOM4hsa5DeDIxB2NbmKH 0gvUpCUNtwTjJD+S1jq80xqbBdVL0vCHAEqgkmPT+mHZYgcd7JHOGVf5JL9obBWVVVRg IrNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqt07IO2; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si4287131pfn.220.2019.03.21.06.19.32; Thu, 21 Mar 2019 06:19:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqt07IO2; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbfCUNTc (ORCPT + 1 other); Thu, 21 Mar 2019 09:19:32 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39170 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728032AbfCUNTc (ORCPT ); Thu, 21 Mar 2019 09:19:32 -0400 Received: by mail-lj1-f195.google.com with SMTP id l7so5271022ljg.6 for ; Thu, 21 Mar 2019 06:19:30 -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=DvqkUEStBCTBRxBhXBiYlsnMbdwJ8YPYAzqKp3vFJqVh7oog7QNHIUL+1Ys7npjiAI FgmgJbp3ViVT/Z+aWt78CD/AwfVKMxbdSRCsKbK/r4p7gy+k2xNtkZZ81AeGPjH8RS67 FEreEp/U4OkAcC23hJo7ScH53TTt84IL8ad6jJhDMG9LA5q54lzHmN4ToPTPMqtCze1D P/iQmjYKEIFgNqMx8hSGMg2cXjNJWRBFGCCuBnYv/1EOvi22r9lZjUxUYJ1XqLgonJ0b 0kXJyvuS9lPikbBs+q6yG6kpa5dzqqLKIPiJgm8vyFyG6ypSV1DqyuzxC4dupW04kSS0 OILA== X-Gm-Message-State: APjAAAVhymSv4mzbyaONPfqQHHbiANRy4MH/sgxnTAKIFrVbyhJP0PIb PKuI8Gf3PtvDiZL0UDdQtA83Lg== 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 Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Anders Roxell 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 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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(-) -- 2.20.1 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; } /**