From nobody Sun Feb 8 11:06:46 2026 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 9DE861DFF0 for ; Thu, 18 Dec 2025 10:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766054111; cv=none; b=W9lL/i6YL5+4ejqFHe4kl2KfzTV7BYR3z5jcEZ7vDd9cXpqJmwyxcJeh5Uo5QQjSl8vnh0B49a/axo37oDVHlK7GTyzPpYReaO4a88ptRQL/IYdhjv4DZyeG3cFThEZkfMtdO0n1MpPhTQCwpr0u5kH6xzhwlmkky5bhMV/lAGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766054111; c=relaxed/simple; bh=cdTdeSKssf25KWQ3ZSjB6S9wWq1SG22vhfIjy3TuO1c=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DAwz4qVgEOIytFqOd+dDJkU06TLpkpxNZaxnfI/fxwhOqd3tvO+vewfTn9YnOrWdBz/ny9wQKBSqh0JbAVk1vGYbzZcnSvlPmfFUzDl5S5ZfKTtCp07Nl8yi1eY0qrOnSJUuF3RSWo8VnZB9+pR0c+jGFUu9LX8nBXP0z2Dua6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=ToWiE+GV; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ToWiE+GV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1766054109; x=1797590109; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cdTdeSKssf25KWQ3ZSjB6S9wWq1SG22vhfIjy3TuO1c=; b=ToWiE+GV5gfJ2DluooNamzGWpJHIsWFSPX+/AvoxiHx0a9aTJo3XsEF4 ITTL4KMAxSEjml6L1ceBkXOeACyBY+qkBfUjvbdfe07d6zQOSR5b8qJA+ VcGTLEw1y/xwTG0V0VPKewDDWgrKYa8q5hPD4t+lPk2lXUU1gVuUkoNAW qrgam6NuUKt3kmuCq/J72FVcwho90WVZalawb1g+LoNGPlipREZ5rbhMj oNlBFJxqAQbhPrXthr859xwsM9V/gdjlHPKL36ABrOp9xNVlT0RnE7Cbi 3Q3NAWF6ey0ykq4urDOrVCQVgzxTSIgpIesAGUA/TWcExPt4BYyyUQdua Q==; X-CSE-ConnectionGUID: /TOFy6MsQvCBeTJhXNcXpw== X-CSE-MsgGUID: 0KZoVyeNTla9oa9tn0HIbA== X-IronPort-AV: E=Sophos;i="6.21,158,1763449200"; d="scan'208";a="50041756" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Dec 2025 03:35:05 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Thu, 18 Dec 2025 03:34:21 -0700 Received: from valentina.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Thu, 18 Dec 2025 03:34:20 -0700 From: Valentina Fernandez To: CC: , , , , Subject: [PATCH v1] mailbox: mchp-ipc-sbi: fix uninitialized symbol and other smatch warnings Date: Thu, 18 Dec 2025 10:33:59 +0000 Message-ID: <20251218103359.7200-1-valentina.fernandezalanis@microchip.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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() erro= r: uninitialized symbol 'hartid'. drivers/mailbox/mailbox-mchp-ipc-sbi.c:324 mchp_ipc_startup() warn: ignorin= g unreachable code. drivers/mailbox/mailbox-mchp-ipc-sbi.c:422 mchp_ipc_probe() warn: passing z= ero 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/mailb= ox-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 =3D false; =20 /* Find out the hart that originated the irq */ for_each_online_cpu(i) { - hartid =3D cpuid_to_hartid_map(i); - if (irq =3D=3D ipc->cluster_cfg[i].irq) + if (irq =3D=3D ipc->cluster_cfg[i].irq) { + found =3D true; break; + } } =20 - status_msg.cluster =3D hartid; + if (unlikely(!found)) + return IRQ_NONE; + + status_msg.cluster =3D cpuid_to_hartid_map(i); memcpy(ipc->cluster_cfg[i].buf_base, &status_msg, sizeof(struct mchp_ipc_= status)); =20 ret =3D mchp_ipc_sbi_send(SBI_EXT_IPC_STATUS, ipc->cluster_cfg[i].buf_bas= e_addr); @@ -321,13 +325,6 @@ static int mchp_ipc_startup(struct mbox_chan *chan) goto fail_free_buf_msg_rx; } =20 - if (ret) { - dev_err(ipc->dev, "failed to register interrupt(s)\n"); - goto fail_free_buf_msg_rx; - } - - return ret; - fail_free_buf_msg_rx: kfree(chan_info->msg_buf_rx); fail_free_buf_msg_tx: @@ -419,7 +416,7 @@ static int mchp_ipc_probe(struct platform_device *pdev) =20 ret =3D sbi_probe_extension(SBI_EXT_MICROCHIP_TECHNOLOGY); if (ret <=3D 0) - return dev_err_probe(dev, ret, "Microchip SBI extension not detected\n"); + return dev_err_probe(dev, -ENODEV, "Microchip SBI extension not detected= \n"); =20 ipc =3D devm_kzalloc(dev, sizeof(*ipc), GFP_KERNEL); if (!ipc) --=20 2.34.1