From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (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 681712BE03D for ; Thu, 18 Dec 2025 11:35:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766057729; cv=none; b=ZzPGXnVS8iW5N36CIMAhfiwR3UyRW9EzjeaQLGC5xdlnHdCj8KsbYcfUXKexqwqBq98glHp9F9xK/l78zc1SGS+nyb6eVWT/A69kytr7TbZkXaQjliDnyKuhE8Yb8W9CsBMrZU2hKV94EZuB+BAoaKTkhDqu5+sxqbJp0bWEMgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766057729; c=relaxed/simple; bh=N3xDpbO5rliEVOocyu7lMdK7KMiPu46+y5p548F9O1Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=C67StzjrAPKEM/jtIxDH7Ky4iK1MNw98XxGmiogHEDvPI/gvsA5KOA05c2ZnQvWDllfBTB5cKfZJeH8fG8RwXI54Zwsx2Uf+jrzYOrhEBlo9PnqGi+ZmbMZKOtO/A3o10bMXk4chvLhUotX0rsD0X/cmk/OFKThO1ZKwLwxWBsA= 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=z0dc0XKu; arc=none smtp.client-ip=209.85.221.65 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="z0dc0XKu" Received: by mail-wr1-f65.google.com with SMTP id ffacd0b85a97d-42fbc305914so386742f8f.0 for ; Thu, 18 Dec 2025 03:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766057725; x=1766662525; 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=ly5czQnu87jVW3KEKgN3v0ML2r0CXJkFp4Xb8jCtbV0=; b=z0dc0XKuaIqHmv858sATBkiB6xIOb2vA01mXfM0rHxbugeHdVOJGSxxtuXCcHXlMX6 hxTTgGl9Tdu8Hte+gxLQHO3+Db/hlHoskPE3G2B0QYPjniUXQ4QaNjYt6ax8LUuF611V l7LMbd+UrQQg6bXZZ+SauEmhC9DTG5wfZWjfCn6Re7nrOrMwGdq3YUReXa1TMoSmYq3H 7WGkXq/HX6fXFyeX5swouzFhnF1eWYTxCNzgTIz4m4RgNqkrI3xWIFfMpJtwr9W/Rwsj SEfsluoY9tnODI/ksg4dDclv5Za5IfSaGh3RNyyAoW5k4+rusCHpNApsh75de0VoDg53 +pBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766057725; x=1766662525; 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=ly5czQnu87jVW3KEKgN3v0ML2r0CXJkFp4Xb8jCtbV0=; b=bpgHYG8vLrT1gJhf1du0vN2f2cbEzDk9C54WIsnR8Ny25IDTgY91mw6noIUQYxHEac 6pdb7EnhfsFcvS4CDq7VKj0qBqI0+VjXhZPeWhtGRFiZirHJ1J6wt9zicyyj89QzB5gG HPKe/STShWaEg9wf6c958oLI7t5NwFUhCZFfD5mW/VxEe/aPoAZgevUxnY6DQk75ngxm 2sM4jWksRkfFacGFBaSGS6Vudnt459Whm9NghOtIkJMeS9a1i/TqqEOdhYjXvp2rZBOV kfOs7uCjP7GnE/C+DIggaSfLkylauxdgJu19iFbFWT1FmjZV5XSUU2Y9gDC7HHzMygHh xSrA== X-Forwarded-Encrypted: i=1; AJvYcCUi6nQjPbOUpefZQGfhPx0oCTNfQGLTpPChcvM6z5vJ4LzDcT/nbQVfQ6nH1fHAohCbhELE4XiEYf/wWA8=@vger.kernel.org X-Gm-Message-State: AOJu0YyRd1pQiQ/FR/ABOaAFhM27H8Xid+ToODwe2rOUmUeen9M81TIr hKWeDVhPoY69B6sem1CICZzVksfhvK2d42NfpXmZEKT0v91DvBBpvv33MxVqWYDEJbI= X-Gm-Gg: AY/fxX4D1othDVz+eJPZdhhjAWvVo33ct7Atl9oTGQYoBN37jKNo836J2+IFeMcdqIk H/Enq4svsVMHLS6bzje56hxFwaJ8d0uaRPJcKWI4jXFGlnt4XDwEWRafRyz29YdiftVHx4C7E8Z 0U5/gcU5cVSM5vlj7ZgM5EvKGZcXWa7AMOp53RqK662StugrEHgk+I6Zz4CGkIBpgRsMik1eKiy KOGck2JESPnpdKOQx3TST+jRvU90XpmonnSIY+U6CektZerhBUeGDW+3aAFSfCXP3AchlkfgV7L J/fip6OVLCm952nPT23PlGiYwPoD7IJFuWcxqMoQESWsWBspTYTF2T06Mpse0R5TxD7If7cLDOl CBiDjfOTCfdvN9WisxXIaVyzw6T7A0ukmuuweI+zwFImSQ0wbOw5C2PLJY9R1QKIotmd1B7d8uc kdrOjzkz9KcDNoZVsV X-Google-Smtp-Source: AGHT+IFoxjuw7zjM8GlEp5w3sgwfyqXUuOtvPuufdc3hsaRAPiGhbsckWtEsRZzpaBgfkcgaFP6whA== X-Received: by 2002:a05:6000:2909:b0:42f:9f4d:a4b2 with SMTP id ffacd0b85a97d-42fb44ba720mr22630833f8f.19.1766057724408; Thu, 18 Dec 2025 03:35:24 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43244940148sm4677812f8f.15.2025.12.18.03.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Dec 2025 03:35:23 -0800 (PST) Date: Thu, 18 Dec 2025 14:35:20 +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: On Thu, Dec 18, 2025 at 02:23:03PM +0300, Dan Carpenter wrote: > 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. Well... I guess the bug is real, but the warning was bogus. It was a broken clock warning which works by chance twice a day. regards, dan carpenter