From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (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 28CFA1C5D6A for ; Thu, 18 Dec 2025 11:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.67 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766056991; cv=none; b=XlqrLhfShbKA8ZqPywZoEcyAilGeEhHcmC3XmIGUgAkSJmbEh35ZzWKFSrScg5YI/Zl5pnr1HNjl6UN2DFfgltPTMmJkfUk7xLTEOramW+KkRysnATz54m3UdW68fx88caLciYHEINtJLuAUYgjqOSxjxPfHRgTWJ33F26Sbrgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766056991; c=relaxed/simple; bh=zwrvNfnljbFlQlUl2rhSMYhNJwBvb6ALedxraYRv2Yo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r+n1nBvz6/CL8BftCXIy1x3YEcTYoKyb3ekA6K5JnqId9qGgPyPCmyezeCM/bHrpONoqWYiIKUIzS9YbOg0ocvowlIaJb0QbyP6fe7fKmz4y3AyRWRXgQPwehLaVraxQGhe+cqcyfngA6kBEj3IDj8TfigNa8eiwkmnJwVx+Uzg= 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=YGIcIC1m; arc=none smtp.client-ip=209.85.128.67 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YGIcIC1m" Received: by mail-wm1-f67.google.com with SMTP id 5b1f17b1804b1-47a80d4a065so2758305e9.2 for ; Thu, 18 Dec 2025 03:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766056987; x=1766661787; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gUBsBSJU1+vBnkVuPQaz0XcBkdgHGtATcJsa1wAyjVs=; b=YGIcIC1mlKgIWktX0tn61L/TFSP8xBc7HnHkR049GuZaIhVst2FhhUzag/LSHiuBSl veE8DzaHHQ1Xo/Ah5niulpse1Er3gapArDjuYbTTzlGoiuHFTMdLkQFS+tPRa+zw4UMr Fd9WvjNkrbOqAoWltXxbLzLBQxXMqPd1m3Nzfnc6+1BQV9upFazOc3VH+SOLsPNrFKkc x8z78ku8z2cSreRy9jjBP8ZTzAEC93dTWRiQx6MyrzFLfOT6GseaaiUdRjAYr44Pp51K QUfZ7yXiIt/mIuwZC2jKHTR6FNd8//tcIvqG3H1BsGv/YMxWO6HEzB8pNDEeNIRHftRa f6/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766056987; x=1766661787; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gUBsBSJU1+vBnkVuPQaz0XcBkdgHGtATcJsa1wAyjVs=; b=KcYDdDdLkTEETIarV5IpQQq9Bnyh1o9HwSRmxUiorlDuG/+WXkC0n+zfpxRvhyzBw8 nPbvKq/y2EZRNOsAat3kxhc4S8rPLFImUo0lNvVMKjtt+lTaer9neyyNwgSnfXW7txYD p9mLElQldzNH7AXQnOwZ9eUAB/WO2axUki3Mu8brZ/1eFGGsIriFGx1uSvK05PgB39IH 1E6x2+KCtqiL9/cXhVjNHr2z9rZwpm/U9IGLrMi9ke/K9QqFZ/mIbZHFT/SAvn1T0Vae PHymPRf5Lm6U9nNpl29l7m8fYYlq5AHI/MVE9U8D1slBvaGVZNPz5jYRGQizS8z6XY7H IPPw== X-Forwarded-Encrypted: i=1; AJvYcCWKgdj/2li6++u2TC1zEee2g2+uukUrpCWnwIYw4wO/l92B2NEvA8suMDrvCgFtXtf/EPkpLXDTOEBfukc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5v8x2KWcnEvKKIwGCtdDOGJynFxFUHkiLfBiC3DzHPUHujMtM WtRFzXvg4P/vgMCFC6U/BiUZCEiaHsnsA+GH6UaDC7hJvgL6Z3wGWY8LC0LLoo78LvBbNiS1RqR hZRRb X-Gm-Gg: AY/fxX5DYZpR4+lksuPyVQJ3ilmCOXnrONhvzdWd7DcKcsqz/IFGHyQr+qRJHQ2qTuR S9DFt24r0+W5ZEwUA4SB+H0w0gAfpooUmVUMjMYBupYOpK8t1XA2v1UPLB6tMxv2e5TL/V+auCg nl56YmrmzBXmXNPXPk1gJfD+Hi9ZJrMjKSqfyhI+u+5gz+o/s63peOR9lgCDj9EkUE4S3Ne1m0p CmNXdh5rUmbj8sOmdqHezLQu85Oekkq1+Z7ppb1YfVodDoOLL272C3+cqD5zO0XzypF7havnxOV tHj4/Vek9RIBswsKy6qjxSkVqjSlGjQkRbW3qGNVkDlGbt2GKzegjVNb9LjfKMtaFKNc1j3Axx4 QKow2EUtpAFljJJBBAd7y4JV9fqEtrmE56K7IIBx9EfHjaA222ghRwau5WZ3wfD34UwrQOiKs9r YA38Bpx3ZdTIaZNHZe X-Google-Smtp-Source: AGHT+IG2AaJ+3pfTyZ75uh7cjQ7bqqZiuQfD6Zu9ewljeLZjD4XJEtPt6DjFJZsNij2Sxmlm7dPv3g== X-Received: by 2002:a05:6000:40e1:b0:431:808:2d60 with SMTP id ffacd0b85a97d-431081775femr10353027f8f.12.1766056987227; Thu, 18 Dec 2025 03:23:07 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324498fb0csm4563984f8f.25.2025.12.18.03.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Dec 2025 03:23:06 -0800 (PST) Date: Thu, 18 Dec 2025 14:23:03 +0300 From: Dan Carpenter To: Valentina Fernandez Cc: jassisinghbrar@gmail.com, conor.dooley@microchip.com, linux-kernel@vger.kernel.org, lkp@intel.com Subject: Re: [PATCH v1] mailbox: mchp-ipc-sbi: fix uninitialized symbol and other smatch warnings Message-ID: References: <20251218103359.7200-1-valentina.fernandezalanis@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251218103359.7200-1-valentina.fernandezalanis@microchip.com> On Thu, Dec 18, 2025 at 10:33:59AM +0000, Valentina Fernandez wrote: > Fix uninitialized symbol 'hartid' warning in mchp_ipc_cluster_aggr_isr() > by introducing a 'found' flag to track whether the IRQ matches any > online hart. If no match is found, return IRQ_NONE. > > Also fix other smatch warnings by removing dead code in > mchp_ipc_startup() and by returning -ENODEV in dev_err_probe() if the > Microchip SBI extension is not found. > > Fixes below smatch warnings: > drivers/mailbox/mailbox-mchp-ipc-sbi.c:187 mchp_ipc_cluster_aggr_isr() error: uninitialized symbol 'hartid'. > drivers/mailbox/mailbox-mchp-ipc-sbi.c:324 mchp_ipc_startup() warn: ignoring unreachable code. > drivers/mailbox/mailbox-mchp-ipc-sbi.c:422 mchp_ipc_probe() warn: passing zero to 'dev_err_probe' > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202512171533.CDLdScMY-lkp@intel.com/ > Signed-off-by: Valentina Fernandez > --- > drivers/mailbox/mailbox-mchp-ipc-sbi.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > > diff --git a/drivers/mailbox/mailbox-mchp-ipc-sbi.c b/drivers/mailbox/mailbox-mchp-ipc-sbi.c > index d444491a584e..b87bf2fb4b9b 100644 > --- a/drivers/mailbox/mailbox-mchp-ipc-sbi.c > +++ b/drivers/mailbox/mailbox-mchp-ipc-sbi.c > @@ -174,17 +174,21 @@ static irqreturn_t mchp_ipc_cluster_aggr_isr(int irq, void *data) > struct mchp_ipc_msg ipc_msg; > struct mchp_ipc_status status_msg; > int ret; > - unsigned long hartid; > u32 i, chan_index, chan_id; > + bool found = false; > > /* Find out the hart that originated the irq */ > for_each_online_cpu(i) { > - hartid = cpuid_to_hartid_map(i); > - if (irq == ipc->cluster_cfg[i].irq) > + if (irq == ipc->cluster_cfg[i].irq) { > + found = true; > break; > + } > } > > - status_msg.cluster = hartid; > + if (unlikely(!found)) > + return IRQ_NONE; This one is a false positive because obviously there is going to be at least one online cpu. I would prefer to silence this in Smatch. Generally, you should ignore static checker false positives. regards, dan carpenter >From 3a2a0587208ca2f720cf170c1c9b84d155e87316 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 18 Dec 2025 14:17:36 +0300 Subject: [PATCH] kernel: add some more once_through macros These macro loops always iterate at least once. Signed-off-by: Dan Carpenter --- check_kernel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/check_kernel.c b/check_kernel.c index 0db972637aa2..03d1982db49c 100644 --- a/check_kernel.c +++ b/check_kernel.c @@ -765,7 +765,7 @@ static bool delete_pci_error_returns(struct expression *expr) return false; } -static bool match_with_intel_runtime(struct statement *stmt) +static bool match_once_through_macros(struct statement *stmt) { char *macro; @@ -774,7 +774,10 @@ static bool match_with_intel_runtime(struct statement *stmt) return false; if (strncmp(macro, "with_intel_runtime", 18) == 0 || strncmp(macro, "with_intel_display", 18) == 0 || - strcmp(macro, "drm_exec_until_all_locked") == 0) + strcmp(macro, "drm_exec_until_all_locked") == 0 || + strcmp(macro, "xe_validation_guard") == 0 || + strcmp(macro, "for_each_gt") == 0 || + strcmp(macro, "for_each_online_cpu") ==0) return true; return false; } @@ -821,7 +824,7 @@ void check_kernel(int id) add_function_hook("closure_call", &match_closure_call, NULL); add_function_hook("put_device", &match_put_device, NULL); - add_once_through_hook(&match_with_intel_runtime); + add_once_through_hook(&match_once_through_macros); add_hook(fix_msecs_to_jiffies, ASSIGNMENT_HOOK_AFTER); add_hook(&match_kernel_param, BASE_HOOK); -- 2.51.0