Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7554729rdb; Wed, 3 Jan 2024 23:12:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBVH6KFfAyDX3teAqq5a7vti6FiKuFkdQ7ey4azcN5Svtrm8Cp3M5ayP8zzxEY3/atsHLd X-Received: by 2002:a25:ae0a:0:b0:dbe:26ac:bbff with SMTP id a10-20020a25ae0a000000b00dbe26acbbffmr146870ybj.102.1704352372545; Wed, 03 Jan 2024 23:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704352372; cv=none; d=google.com; s=arc-20160816; b=zwGGCGNfT/4ZmohEkokJBNPFWPPTB1fUAtqYNkw4OHZgVm5fDgo8ybcXs3jlqTqHJl F0Ke6bO0QM0DqgrFjaFKXUd+otNoMnaiHXJkKJu0DI5l5LWUSpcn66czOiZSszk5BMQ7 DW9qnVqVYttmY/hFnfSUTy5PUOHY6gbdhAoOC3/AvDt/1YkXw6OsyWkLuBmXjY5+VAhr 0cVXOqg7b7sBHM50W0vGVCEaYbIvKVsPmrOSD3cL7IeUPZ1BKhbDyGsNbGMDYIMFINAS oEJV5gwZHnT3ky10HicpKVxNUr0xSHO/D6xpG9aYGSPAxodsSJm4M6r5ct509+ZG5EFW jC2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Ix+BuLeM/5h3mPrP9Vq1gpE84LOVbL/S8gxvnoGRgK0=; fh=ItA9fglmYIRnAuTNVq78F6SlYP1l8X2LBIWXPbpyIR8=; b=CaDcq1WKAlFxS7csdrkcHi76hkOGpRW7D5bhtmfAPp7Bv3/Gk5/SMVQxpoxSoR8+Da 20Md3DUW+d0ekEapAiYPF0SZOw+biL3QihrtM6AaMruzCImG9WkOHbAF9D3iReFjehvR Q7iNTXXKZqM7yi0OBWQ118OhQegBMpA70uIzFAo01Prx9bfKTjqfxUXUkKsCSXeSqSd2 8rm6bsptrnwJbGP4MQjpAXo+JUWYxiXjKntxNidTwOcdsLM/iF84hYi+Zu7Z5MmVSiqt yYqv3Y+osD2wJSFlNb31jiwd4uv5xnXQq6R3FhLaAQ3fyrvz4ApsRdEf6CDWwwX2gadA uh6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fEph5X2O; spf=pass (google.com: domain of linux-kernel+bounces-16304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ga14-20020a05622a590e00b00428301e8785si5842268qtb.239.2024.01.03.23.12.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 23:12:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fEph5X2O; spf=pass (google.com: domain of linux-kernel+bounces-16304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D6691C21723 for ; Thu, 4 Jan 2024 07:12:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11CE71EA87; Thu, 4 Jan 2024 07:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fEph5X2O" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 441D51DFE2; Thu, 4 Jan 2024 07:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704352363; x=1735888363; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=BuiT+rA2z6Mm0sjMPQLK1Ojp5SJ1U85xvH6hRCukWEg=; b=fEph5X2ODMIMzxPE6GqtlmNy++ZrU1qk8pCIi4P4rOkzLjwkVfkKerYI f9TFvgf9NZwvofiDXRGT6sTbTDBLuFPBviSTO5ln8T5x3JgsHVC29dAfC w4rwb3Vu1kaXCm46BCeGUSvoVFv167BlFhzl/jmwdKa6hfdAsTsO23G2k aEYYIPF/HgOoFAHi8oFkdT4fTyZKnUVekiZ7aJm8nP1CHaXjGcaXJa1Vb kY3QoufHgL1V7RNKe5uCQuirevAvs5i03lT+jtUSIBfwoe5p9hiGo/fYR nOtF2/KFheDP8LORA/WXh/cHji3gLNZoVrYSgXL/i3bwTudTFGLvHtUfJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="461454224" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="461454224" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 23:12:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="809105147" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="809105147" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.35.85]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 23:12:39 -0800 Message-ID: <6d0edbac-9b9c-4a90-a3c9-193198e8a088@intel.com> Date: Thu, 4 Jan 2024 09:12:35 +0200 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] mmc: sdhci-esdhc-imx: Fix smatch errors Content-Language: en-US To: Stefan Wahren , Hardevsinh Palaniya , haibo.chen@nxp.com, ulf.hansson@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231229130207.3539334-1-hardevsinh.palaniya@siliconsignals.io> <838abf56-e2b1-474b-977a-8671a31053ed@gmx.net> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <838abf56-e2b1-474b-977a-8671a31053ed@gmx.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 29/12/23 16:34, Stefan Wahren wrote: > Hi Hardevsinh, > > the patch subject is a too generic. Maybe something like "fix > initialization of target_min/max" > > Am 29.12.23 um 14:02 schrieb Hardevsinh Palaniya: >> Resolve smatch errors in esdhc_executing_tuning() >> >> esdhc_executing_tuning() error: uninitialized symbol 'target_min' >> esdhc_executing_tuning() error: uninitialized symbol 'target_max' > I think this deserve > > Fixes: 541a95e64d76 ("mmc: sdhci-esdhc-imx: optimize the manual tuing > logic to get the best timing") Is smatch right though? while (max < ESDHC_TUNE_CTRL_MAX) { // always true first iteration max = min + ESDHC_TUNE_CTRL_STEP; // max > min max -= ESDHC_TUNE_CTRL_STEP; break; // max >= min win_length = max - min + 1; // always > 0 since max >= min if (win_length > target_win_length) { // always true first iteration target_min = min; // always initialized target_max = max; // always initialized > > Thanks >> Signed-off-by: Hardevsinh Palaniya >> >> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c >> index 40a6e2f8145a..839b60138f04 100644 >> --- a/drivers/mmc/host/sdhci-esdhc-imx.c >> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c >> @@ -1166,6 +1166,8 @@ static int esdhc_executing_tuning(struct sdhci_host *host, u32 opcode) >>       min = ESDHC_TUNE_CTRL_MIN; >>       max = ESDHC_TUNE_CTRL_MIN; >>       target_win_length = 0; >> +    target_min = 0; >> +    target_max = 0; >>       while (max < ESDHC_TUNE_CTRL_MAX) { >>           /* find the mininum delay first which can pass tuning */ >>           while (min < ESDHC_TUNE_CTRL_MAX) { >