From patchwork Tue Feb 13 18:08:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 200542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp715958dyb; Tue, 13 Feb 2024 10:09:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWPeRfgQcwYVUmtIJAis8FeJxvukpUnhJEpyGnI75t0aCt9xtD74JAcOksFv5S5SWh9hLRC/dQlPxxZsBPxBiQRChhltg== X-Google-Smtp-Source: AGHT+IHq82+6DOEO0mzvT9S4ML22ZSAgv8yMfzJtJvtJMFq16j4pAopNq3fi3xldq0EmnwUUMblP X-Received: by 2002:a05:6512:142:b0:511:2e7c:768f with SMTP id m2-20020a056512014200b005112e7c768fmr174342lfo.46.1707847758738; Tue, 13 Feb 2024 10:09:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707847758; cv=pass; d=google.com; s=arc-20160816; b=hN06V+QRG1F6XD4foyYJZCh10tXsbNKliVCRu/1O7gi6exEkTzkn4mpvEGHLSEGSlZ LMkHVqcuh851pzAK17YvdSZLSM+Cp7+yQoMJlYs75vt7Lx59HNjejY8ieguCSS8vEwAf C70kxb7zgAQlTUrmW6EOE/wA3BuWYX96AeJ5AgBXpuy5TtiGnNkJSk9OPihrvwzKK66h sbvn4OGTtno9fsZ2tc+0c5Fwv403IoLBTBJL+4hSA6u/smc50Wo7JQg2LjdKB+Q9qHNz NzMSkX8sPv2eq5wdAU0zafY6v51Rkvcbbu5s6xJiN8fx7lJkV0sLmx2BNLRD7Ob8+3ZZ Jx2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=y+WHbON2JSYzrGtsBd+Bvl8eFVRHPgb/kBoMusZieaI=; fh=cmbz0TFdSANYCzp3KSb/w401VsdL84cohI7nmgb5On0=; b=lkosMkNd5u5x7Cu9/5I8gak6ISBktJF6jqgWKpo4+zclbhy4Sq7cdmiY5qwOgLDi/y nSje61sRB938sSZCvYKYdf5Lx2XJCHmSl2WTg6bZJ3u7YolDHR6xsrvBtVhE9EXthvT5 1KDEUbkZeHtkBo3Jke8l2iTBCmWlErlsZBcUOGtrzIy9XOhNHpp+Gon1rBbYk+UnEto2 iqpPqH0YCT8ZLQvsMRwhrM/tNqfJsFzI7u7t+GIUFsyg11HcAoZmiAgeSI1oE06NFHxL k0p/gDNZTYfZrjaRNJ6w96lR+pwbVpTXSajVZsu0X/g5LCT7ETXcLRPUlZ14tRbL7agE BQew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SuF2eLG3; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-64056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64056-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCVeKs9kY0ffZ6LwW4K4/vlfIcKWMGJykFkjjHFu+bVcTVHMWYytXGOEDCq6sDX83JCabxTEgUL5HLGiEUVQKnWL5fg0vQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r6-20020a05640251c600b00561d07b6c4csi1601398edd.657.2024.02.13.10.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SuF2eLG3; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-64056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64056-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 56BEC1F23F84 for ; Tue, 13 Feb 2024 18:09:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD9AD6089F; Tue, 13 Feb 2024 18:08:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SuF2eLG3" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A6F1605A3 for ; Tue, 13 Feb 2024 18:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707847696; cv=none; b=ly515qx1TJAWkpv0FYCpbcpegbTQC73gLN2PiQGmERkHkIJ488DOT0HNMMxNGax8pAapnN2JsaRXjHAS2Eux70TQWuiRMRtmJU3/iI72omn/3nNaoNoi+ffZQWGGSpYbhLBSDF7UEGFoG+WR6/pz5+wxTyx8vIH/N8nSAQJHgv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707847696; c=relaxed/simple; bh=qUDpWufqOP0+PWEnGi4jvXwLx/nEOG4F3D3IgB3iO4U=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=lMFzzZAYidB4zSj6iFCgAyebv0RqeUCzHxt8KgZHoykBlnl/LLYcx2wQpCAg249LlWg+2bj7KXwA2CV5uWGFb5pwVQ6MkzKzeGJmewjeXiEZ+aA5sJH96QSrXwVRkdt5tiy4VnESbZ1M35CrFA6fWZZ2N42jBdiZ37xNuPVfqp0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SuF2eLG3; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-562131bb958so437224a12.2 for ; Tue, 13 Feb 2024 10:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707847692; x=1708452492; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=y+WHbON2JSYzrGtsBd+Bvl8eFVRHPgb/kBoMusZieaI=; b=SuF2eLG38/F+r9Tr/LjUNQ0auUlOkYvSKGcinnZEtpVXPM4u0m7tnxl8xefYfNA0UQ jErGcJF8Vc97lCjJKlOSBVO74eb5MMe/oKdZQFPPGzY8jJcOo/EzIQN23Ucg+TftvgE/ SB7bea/c0FtiK7sS9WHLUdCui1ZCcivGaC/JhD7IDRbpuZd6ZfmL56YsXI7fH1YaUjGU KCzd8/aGwS4siTNYGdVghfqUg2PaMkpGPBIhCJk6gMuQOMMsNmPspzRco61sqRjdOUPY 6PyZTiWtGVDcCGgDtbWMTWYXrTXndPefn2OX3N8gi1/kva1z8aVgNDI3iRIFKnnWc3BU gZYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707847692; x=1708452492; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y+WHbON2JSYzrGtsBd+Bvl8eFVRHPgb/kBoMusZieaI=; b=UsWy9BpUq6N0UMvkXwRxruqjoZxVU2GYS9TvWYRvKryONm3NyAMEMps0YmbJQRa8HW /9GRN3DQeIEGnPB81GL4DUR1tCQalggtkby8F5OF23jXkuT+O4jXYGEV3TBUuLRwmiRt 7uB2dhEr5QvoV2j5rTSC5rNlqcGp2cEHlKoUIqo+NHb1EIK183bgRZ9+0qWNVU7m1OJK mZ6Nov4d3HKxDnx0cUDPmC1o794Aao00itvcP4g0iLWmcSneyKd2XQ7prt63YNyFpY/3 rJvZPqxem3Pao1wYEB2YyPvBH3ukgos2xZAX3Wznay/rPBPdQVcv3TbEJzR4pLxajnfe J2uw== X-Forwarded-Encrypted: i=1; AJvYcCXvq/NpDhY/TR6fWsYSYYAw4pyqm/jNC1e9blD0q5e2//94gLqetpZWHkfUJE/w1kKFWeAeP0FdTboqVDXfcQVyOQxxiEoCba0ARe+C X-Gm-Message-State: AOJu0Yzm5c9WdvCHoqrjFYd3yLs5PKusWRGRnRin88Oj9RyRgwlAJESr PV+2Y2FmcVYS2qc2Fdl8sMMD/IuDkeGneySS3QVuu2v6O+LvSi9MK1G/lFXzGFk= X-Received: by 2002:aa7:cd72:0:b0:561:f8f0:33ee with SMTP id ca18-20020aa7cd72000000b00561f8f033eemr287257edb.34.1707847692644; Tue, 13 Feb 2024 10:08:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXvPiSHWgg1v4Pv6U8ngSel5c0LfVZ7RbHdILANjpT0ZIk4xIXGDYxJdONi57F+KKg+mmosjuCfV6tehu+0gkUTjwgJUY7ljO1NX6eOouw5DOlPBaAl2KciPQSgkFQEp7tqsQvy+JPcwTU9oku+uajansVZmswJl3Z8Rsfk3eaEBB7vC+e79t4To+/iT8dE8l1iSxiSFpuSHzfL2xwGlI6BbfB54zJJ1N9uPpwMH69u7EWjKiyY2TmqZD01GsyNcOlhb1az7M8XHgRR82yhQR273Eri3BdHniZu0LKZe+Pm30ZI+Z1eL3N4GnxAHwB+z3S+PTWnwODlLsfsSlmYw4VwDMyPE+je5+V0dD5/qA6RV72IMvs0r3tC2XktCckEU5JMQ98BqkL/E5Omo2QteAABqnjLpHL3PdZNDzyJeBim2D1GlENtlAECL5bTflyzBZsKAx0I1r8I5I+82ezt9TMza+Xnek3IJo7ocrId/Q/QIWuOsmrjKWnmfXh8YBQ+Hg4N9s4dTeZWmJiqtVvXnaQjpsTCA/MFeoTJHWPDueBANtl2yejC1TvoTF7xWqs= Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id t22-20020a50d716000000b0055fe55441cbsm4133469edi.40.2024.02.13.10.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:08:12 -0800 (PST) Date: Tue, 13 Feb 2024 21:08:09 +0300 From: Dan Carpenter To: Peter Wang Cc: Alim Akhtar , Avri Altman , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Can Guo , "Bao D. Nguyen" , Manivannan Sadhasivam , Bean Huo , Ziqi Chen , Adrien Thierry , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] scsi: ufs: uninitialized variable in ufshcd_devfreq_target() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790808171068883225 X-GMAIL-MSGID: 1790808171068883225 There is one goto where "sched_clk_scaling_suspend_work" is true but "scale_up" is uninitialized. It leads to a Smatch uninitialized variable warning: drivers/ufs/core/ufshcd.c:1589 ufshcd_devfreq_target() error: uninitialized symbol 'scale_up'. Fixes: 1d969731b87f ("scsi: ufs: core: Only suspend clock scaling if scaling down") Signed-off-by: Dan Carpenter Reviewed-by: Peter Wang Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index d10a77d05d2f..a8a9edb7ba24 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1514,7 +1514,7 @@ static int ufshcd_devfreq_target(struct device *dev, int ret = 0; struct ufs_hba *hba = dev_get_drvdata(dev); ktime_t start; - bool scale_up, sched_clk_scaling_suspend_work = false; + bool scale_up = false, sched_clk_scaling_suspend_work = false; struct list_head *clk_list = &hba->clk_list_head; struct ufs_clk_info *clki; unsigned long irq_flags;