From patchwork Fri Jan 15 12:27:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363588 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp261247jap; Fri, 15 Jan 2021 04:47:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYPoPNtj4+XBKY405nXMOEZiixK3ZfJIUPdZMV9AWXPGc+Jhkuzyrpbv3LtbHMANvOgsvx X-Received: by 2002:a17:906:1c0c:: with SMTP id k12mr4608962ejg.354.1610714853602; Fri, 15 Jan 2021 04:47:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610714853; cv=none; d=google.com; s=arc-20160816; b=eOMIHmspbVfzA3ktkXpk2lvEza6KrUF5/d5LW9/1MZsczKK8YK7WGvQzWOicq3kmB/ ydkfxurMnWwxNXjZa+qHLcrKIIbiRm+E0s4MfA9mu2MYKWjwI9fK4caFSfilGOA3gC0N 7eli9qebJvkaSlKjl1Er9Yfadiyuaa6q2E4KNf9phdYX1HWPnB6cIaKgrjQ2T643CkR7 vC1wUAoT2pqBVqC39hVISgG3dYkmnGlgWun0k8bJOu+YaWqrxD/x0ZgLPG8lpYP5bRjT 5rp4sh+shUcSDu4JyYBwVojwCCze/P29saWO02pCo2tbYAnJOKLs6YZbc86BwMx7xHRO jugg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+XQkKSrgT1qhSVf/Sty+MX1yOHuN2A5R2Tmkep4db+c=; b=ms6bJpeAMA/1OoMU1lYKErr0ry4+6/btdVYxzsqg8CiFsY2G7JQAHOk6aFDIr93rsc pgi4NMmDl0/V9qM83RmSAZKybzF6n1kGlEw0OGIjEcoHWYkiN+iCIVMdUOdY6sgu0Msm K4fLQ0oWI0C/kGJIVKMIk2jsi6+ZHfP0ttFTL9eexGmvzauLtBERfA4joCPoMqDj3Mt4 ave1fZw1yjkiXbiFCaFQ9vHSQZRPu3FTclhfX7BGyWo+LVHfl4+MoVSoMTMILzxPhLQf ZGMqHkhNPGWv/oGPoT00uj8/wYsytOIGTUMRDHdEJ+fE3p6TAwO2T87ouJnaaMw/ngzb u1GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CgDKCYtG; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr3si1913885ejc.380.2021.01.15.04.47.33; Fri, 15 Jan 2021 04:47:33 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CgDKCYtG; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388013AbhAOMhh (ORCPT + 13 others); Fri, 15 Jan 2021 07:37:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:44844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388010AbhAOMhg (ORCPT ); Fri, 15 Jan 2021 07:37:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5874F23136; Fri, 15 Jan 2021 12:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714215; bh=ZjuFERDep951Vpl8wawyBksRr1P0VTcRCIqE6qG51oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CgDKCYtGmbqelQwf1BG7OXR0OEw4tI4TO4mkkF0GA5xDGw/zUbJ9y4L4ClEAGjeoN 508cP90EM7TtkGF46oOC64gPkPTI0dxaZMYaxIJzlyDVPzv5LRuZ4GWli5gDFj4Xe3 Yy9cH+wBxpFU0Zalw3PI5CcOPmbY4uR28t2QhORk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Avri Altman , Arnd Bergmann , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 009/103] scsi: ufs: Fix -Wsometimes-uninitialized warning Date: Fri, 15 Jan 2021 13:27:02 +0100 Message-Id: <20210115122006.497238497@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115122006.047132306@linuxfoundation.org> References: <20210115122006.047132306@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 4c60244dc37262023d24b167e245055c06bc0b77 ] clang complains about a possible code path in which a variable is used without an initialization: drivers/scsi/ufs/ufshcd.c:7690:3: error: variable 'sdp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] BUG_ON(1); ^~~~~~~~~ include/asm-generic/bug.h:63:36: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^~~~~~~~~~~~~~~~~~~ Turn the BUG_ON(1) into an unconditional BUG() that makes it clear to clang that this code path is never hit. Link: https://lore.kernel.org/r/20201203223137.1205933-1-arnd@kernel.org Fixes: 4f3e900b6282 ("scsi: ufs: Clear UAC for FFU and RPMB LUNs") Reviewed-by: Avri Altman Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.27.0 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 02f161468daf5..7558b4abebfc5 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7651,7 +7651,7 @@ static int ufshcd_clear_ua_wlun(struct ufs_hba *hba, u8 wlun) else if (wlun == UFS_UPIU_RPMB_WLUN) sdp = hba->sdev_rpmb; else - BUG_ON(1); + BUG(); if (sdp) { ret = scsi_device_get(sdp); if (!ret && !scsi_device_online(sdp)) {