From nobody Tue Apr 7 07:05:54 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 BEA4137AA87 for ; Sun, 15 Mar 2026 19:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773604190; cv=pass; b=aat9BVpqyvqNIUXiRrcjG5y4DtSn0oj2BrPgxE/JVF00Dp9kFVpaC8I9Lg9EgTqN4TW6Hbre2JLAbklq2PwDjLj5Xzdz03yewIo051/hqHNw34BfGV8gdqlyl5jFzAMpdEtiNm6nV1lncTg5lMdpYMoFlCJkYgolwSYKhk7KCvM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773604190; c=relaxed/simple; bh=ceHDJrV/Ow1FjsNv2KUJMNvx1wofLpJllq3T11dMCJc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tKtjDXiqR08Jj9J29b3b7NiN2IKA7Gtcofw7fSp+U8rW88GsVCIOhBrFkiDlh+5qUaPMi0w1CzSr9hbNglNbeAZlLaz5Bb8ub5K2NJ9rGBURQMYGHM4GCKgynjD/1siJ2o2H3cQDTSd6ptB1rvhGLTH/JDULsUhm5//nI4YBQWU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=Sl4ie/M5; arc=pass smtp.client-ip=136.143.169.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="Sl4ie/M5" ARC-Seal: i=1; a=rsa-sha256; t=1773604185; cv=none; d=zohomail.eu; s=zohoarc; b=KLobWLjEUBjtZRFa4F+IiHDM6lSMr879xaIPRjtetiOKOmVb8HP3+YLXfz2bxf425VRwd6+hI7chpYmGPkr9ZFq+0nxF9vj5IghwGgbi/9q7WN7m9WIOJK8lb+rHgyjm9DC6dj7d1bNEjhBXv9PFMssNR9vQ2TML+93BWxB4F2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773604185; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=NqxDRTNV/L3c9CWZ3ELpPehGVlNoCCM9yiNwIrCeCco=; b=Wj0bme2JCWgpo20+mDjaSzDWmkqXh27+rGX2TPJWn6zFRA5TsHO22h6QcEDHAOEQzvnPy6sxtQaiYtGMMZbJXNcFDqkyPZwgZ+nsLQrCp+yRh6s3urFUGLQsbFXZud+8eFd4fHyFI9QoJWaL+YuXOxvCtg4ybacWiHAfwSbF0NI= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773604185; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=NqxDRTNV/L3c9CWZ3ELpPehGVlNoCCM9yiNwIrCeCco=; b=Sl4ie/M5CktE6OjM6le77TSqokpb0O0IdjAxFW7sgSVahkkz1bCKKyra82JuDkE4 3o5bfGyBM/+NLUvOqcQHAJmEFAXO+mVcX8FpuGx4G3WAGMo+y6FUUMhVVWsxJajzN8h NzF+LSHsHYBVkEI/I1Y74+RLRwhMTz9hbukIxcho= Received: by mx.zoho.eu with SMTPS id 1773604182389566.6627430550266; Sun, 15 Mar 2026 20:49:42 +0100 (CET) From: Josh Law To: Andrew Morton , Josh Law Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/3] lib/bug: clean up types in bug reporting helpers Date: Sun, 15 Mar 2026 19:49:38 +0000 Message-Id: <20260315194939.328612-3-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260315194939.328612-1-objecting@objecting.org> References: <20260315194939.328612-1-objecting@objecting.org> 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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Add const to the bug_entry parameter of bug_get_file_line() and bug_get_format() since they only read from the structure. Update the declaration in include/linux/bug.h to match. While here, replace bare 'unsigned' with 'unsigned int' for the loop counter in module_find_bug() and the line number in __report_bug(). Signed-off-by: Josh Law --- include/linux/bug.h | 6 +++--- lib/bug.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index 17a4933c611b..01a996eed8d8 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -36,7 +36,7 @@ static inline int is_warning_bug(const struct bug_entry *= bug) return bug->flags & BUGFLAG_WARNING; } =20 -void bug_get_file_line(struct bug_entry *bug, const char **file, +void bug_get_file_line(const struct bug_entry *bug, const char **file, unsigned int *line); =20 struct bug_entry *find_bug(unsigned long bugaddr); @@ -70,8 +70,8 @@ report_bug_entry(struct bug_entry *bug, struct pt_regs *r= egs) return BUG_TRAP_TYPE_BUG; } =20 -static inline void bug_get_file_line(struct bug_entry *bug, const char **f= ile, - unsigned int *line) +static inline void bug_get_file_line(const struct bug_entry *bug, + const char **file, unsigned int *line) { *file =3D NULL; *line =3D 0; diff --git a/lib/bug.c b/lib/bug.c index 037c7370dadf..9d76703ff7d1 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -71,7 +71,7 @@ static struct bug_entry *module_find_bug(unsigned long bu= gaddr) =20 guard(rcu)(); list_for_each_entry_rcu(mod, &module_bug_list, bug_list) { - unsigned i; + unsigned int i; =20 bug =3D mod->bug_table; for (i =3D 0; i < mod->num_bugs; ++i, ++bug) @@ -123,7 +123,7 @@ static inline struct bug_entry *module_find_bug(unsigne= d long bugaddr) } #endif =20 -void bug_get_file_line(struct bug_entry *bug, const char **file, +void bug_get_file_line(const struct bug_entry *bug, const char **file, unsigned int *line) { #ifdef CONFIG_DEBUG_BUGVERBOSE @@ -139,7 +139,7 @@ void bug_get_file_line(struct bug_entry *bug, const cha= r **file, #endif } =20 -static const char *bug_get_format(struct bug_entry *bug) +static const char *bug_get_format(const struct bug_entry *bug) { const char *format =3D NULL; #ifdef HAVE_ARCH_BUG_FORMAT @@ -202,7 +202,7 @@ static enum bug_trap_type __report_bug(struct bug_entry= *bug, unsigned long buga bool warning, once, done, no_cut, has_args; const char *file, *fmt; unsigned short flags; - unsigned line; + unsigned int line; =20 if (!bug) { if (!is_valid_bugaddr(bugaddr)) --=20 2.34.1