NetBSD Problem Report #58361
From www@netbsd.org Sun Jun 23 18:08:56 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id DCB211A923A
for <gnats-bugs@gnats.NetBSD.org>; Sun, 23 Jun 2024 18:08:55 +0000 (UTC)
Message-Id: <20240623180854.8345E1A923C@mollari.NetBSD.org>
Date: Sun, 23 Jun 2024 18:08:54 +0000 (UTC)
From: vezhlys@gmail.com
Reply-To: vezhlys@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Remove STATIC/INLINE macros from the kernel codebase
X-Send-Pr-Version: www-1.0
>Number: 58361
>Category: kern
>Synopsis: Remove STATIC/INLINE macros from the kernel codebase
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 23 18:10:00 +0000 2024
>Originator: Andrius V
>Release: current
>Organization:
>Environment:
>Description:
While discussing the fix on DEBUG build option for one of the kernel configs (https://github.com/NetBSD/src/commit/c1fbfb0504515c3716072ef8f01b77f9769f84d4),
Matthew proposed to file a PR to remove of all STATIC/INLINE macros in the codebase.
Currently they are defined and used in the files below (unless I missed something):
sys/dev/cardbus/cardbus.c, cardbus_map.c, cardslot.c, rbus.c
sys/dev/ic/wi.c
sys/dev/isa/gus.c
sys/dev/iscsi/iscsi_globals.h, iscsi_main.c, iscsi_rcv.c, iscsi_send.c, iscsi_text.c, iscsi_utils.c
sys/dev/kloader.c
sys/dev/marvell/gtmpsc.c, if_gfe.c, if_mvxpe.c, mvxpbm.c, mvxpsec.c
sys/dev/pci/pccbb.c
sys/dev/pcmcia/if_xi.c
sys/dev/spi/spiflash.c
As I understand the reasoning, while it still can be sometimes useful for debugging (as the intention was), incorrect static usage can be more "damaging".
>How-To-Repeat:
N/A
>Fix:
Replace STATIC/INLINE macro with static/inline keywords in files above and cleanup macro definition code.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.