Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp651362rdb; Thu, 15 Feb 2024 10:55:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXAjiV+z3YC/3haRxF2phtHfIXyW715IIme80VdNuGHJkq7JEl10NanUV6faDuAEjp2Yq4yYpYd2HHYKiocaQ4Wx/DNSinQBrHx9Z2XXg== X-Google-Smtp-Source: AGHT+IH3ilGlbHWue+rYh20zPQKXADSfJlOgWdA6tRXKq+WA9kY6X0vTiwnvWWDhUUApGTxaOF+L X-Received: by 2002:a05:6a00:2daa:b0:6e0:4030:ef77 with SMTP id fb42-20020a056a002daa00b006e04030ef77mr8028153pfb.16.1708023338822; Thu, 15 Feb 2024 10:55:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708023338; cv=pass; d=google.com; s=arc-20160816; b=0f+9sIPAt9nl3TSQ3pN/uLsu+IQ4Uz64KqKxqnZ0wCEK56eJjbpAC2oJomogsOu/t2 szdK5WHsmxJWEjsK584N3qUYN8Uu8ROeCQDXCUmaE9VyH+uIy90oIdCRfch3bFhG4mKn 58l+1YpNgxk4UKkhr/+FuDqbMVW1Ak2khLLH39DrrSyiLLDb/4UcVPcAjG3SvkXXDaFl BySNkHjGEjsJjW9jTmsq8sRUmr6Bfi0Q7i3DrlPtBKrFcKJX6/UIRGnI/OVKWHMfTnE2 hNoEHElKrQcVhy+W/1vQlaYtUh3y/qDZCkp4e+7iKHQ5DkPQzSdxeMC2eeH+dlBVwoYp sjow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=kK7QrrhmrKioAg7I1hm8NPjmxj5IhQb3603fza0D3V0=; fh=hKuU2eVuLh89glH40o8c8/1vRNfpsrmCFUIGWFfp+5Q=; b=Gg6FAmuDS02SR6wEtVAg55NCBrTegpEfHKpbLGYEyByAgBpZFQCPgst7WGQ6nHv+EJ kESXJ+iGdBgEYNJOFUIPgfJNPsCB9+zwoIaC5D0T9XbVMgx8BD/U5LvuMvoyyDs/nfZ1 2OZ+m8WDmv6lLz3c9HnRHIxL6dxbBfiCH54tETs9E46/t5FbQ2JuojsrmGpUMhcXzGDg dKCoyYcw+6nuJ1mW6s4AxNOQ4WXXBWT8aJxRHgorfVokIOojff1yXcitaHxooCylVzwM sHQ5MDBFGCDNoH7wNWu5G2UzKkXeNa6HAhJ/DClzNVRiW/DSyp1QOtquQccR2iQX1Vvm EdvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lp8-20020a056a003d4800b006e0533e7d64si1557069pfb.199.2024.02.15.10.55.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:55:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5A309B223FF for ; Thu, 15 Feb 2024 18:23:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD8981386BB; Thu, 15 Feb 2024 18:22:52 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 DC6B612FB27; Thu, 15 Feb 2024 18:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021372; cv=none; b=jMLyH5xNMSTQpWV2nxqyVOC7r/hPO17tDWzyx6eyBklla/9hg8so/rY0ITCfHdWAh78PZEC8h9jSsnKahzkTfwdQDQ+5EpdAKCPom8SdvhEUcG/GClUWE9dsijjWEJaC8z2Tw9j4jzughvANg/cfNIksWtGzCwKgdi5WXXJiPec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021372; c=relaxed/simple; bh=sVLqjHMpdorak55XCRBQy/M4CiqC68hiCEFUZxYrYao=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Dm1T0rcA7BQd3QdicPU9FbYbvKSORajGPhUaKaOcjjFqZmeI2oiZqVc8YAXTwyvZV320X4TCQd8o0LxNF5210mRh7pq7VZH2KyBAhqZs7iXZkVfedH3r9l1B880wUpnqitouqKM8spOwkCEVUbrbCVV/4HHzukMXrjKMiZESfGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-298ae92a7bbso1639778a91.1; Thu, 15 Feb 2024 10:22:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708021370; x=1708626170; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kK7QrrhmrKioAg7I1hm8NPjmxj5IhQb3603fza0D3V0=; b=a7Gqq4b9mkSNKzWwFAmrWwKPdAx9R0JyVbJxMN6evmZZ1/4P91FPGYWdlr68wA+zh7 wBbgT9r5ee6ZROcIkvfg2DQtgWFxWjzmandNajasWRHTEaLY1SpDYaNO/Huz/7P6RMzc VCvoTf1pWXglNqX3kEQ2GR7Uw0FBIDa8DWUNgrT6fDAG6dEb51Sqdx+srG2McFS6Y0an IohvQbTCALlEjmJklRIOShhzO9Tt3uFm02OongshKcSiCUJcybpgeSsKa10Kp/dfPrie eNPSEj5AYVdlgfjXCdrWcmmFYK+eiUVRPRkMY66iPR8wgFao3enb7nQ2ye45pPEOySra gkAw== X-Forwarded-Encrypted: i=1; AJvYcCWJ8Wn1NItS8ZpQ+M6nlGiPYV0IqYlUFDBHvYEij/aw6bLZ7jxQqgG6r/4otcrYVK2xbMF8v/yuyJ4upN9TFKSCaLpSx1bGCyg2Hw3ptWJPtAHtHzolIYwE2MGzeYWHDJHVz7PCW6ZVtSumEo+3wBnOyCk9gjQ9R81NoaiiWmkfbjvlc/r3+qrtHA== X-Gm-Message-State: AOJu0YzgRrNwqKSPodLgZublPQPIsB8vK7Ti+ob+u0CbNRkdPPp6BgLY VABqMVX1El2MJEv4d6oL7BLM8X8AOjr/zmhMS6oc/QSRjU0E2w5B X-Received: by 2002:a17:90b:400a:b0:299:275d:b677 with SMTP id ie10-20020a17090b400a00b00299275db677mr1331363pjb.5.1708021369961; Thu, 15 Feb 2024 10:22:49 -0800 (PST) Received: from ?IPV6:2620:0:1000:8411:cc45:481:45f0:7434? ([2620:0:1000:8411:cc45:481:45f0:7434]) by smtp.gmail.com with ESMTPSA id y4-20020a17090a1f4400b00298f86ab9b3sm1916900pjy.2.2024.02.15.10.22.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 10:22:49 -0800 (PST) Message-ID: <2a27e9a0-04fb-40b6-b725-c53fca21062a@acm.org> Date: Thu, 15 Feb 2024 10:22:46 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] scsi: ufs: uninitialized variable in ufshcd_devfreq_target() Content-Language: en-US To: Dan Carpenter , Peter Wang Cc: Alim Akhtar , Avri Altman , "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 References: From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/13/24 10:08, Dan Carpenter wrote: > 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 > --- > 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; Reviewed-by: Bart Van Assche