From: Bart Van Assche <bvanassche@acm.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Russell King <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org,
Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 00/21] Reduce the scope of 'nr_irqs'
Date: Mon, 30 Sep 2024 11:15:39 -0700 [thread overview]
Message-ID: <20240930181600.1684198-1-bvanassche@acm.org> (raw)
Hi Thomas,
In addition to the global 'nr_irqs' variable, there are plenty of local
variables with the same name. This makes reviewing kernel patches and
auditing kernel source code harder than necessary. Hence this patch series
that reduces the scope of the global 'nr_irqs' variable to file scope and
that introduces functions for retrieving and setting the value of this
variable. Please consider this patch series for the next merge window.
All patches in this series except the first and the last two have been
generated by applying the following Coccinelle semantic patch on the
kernel tree:
// git grep -lw nr_irqs | grep -Ev 'kernel/irq/irqdesc.c|include/linux/irqnr.h' | while read -r f; do spatch --sp-file replace-nr_irqs.spatch --in-place "$f"; done
@@
global idexpression nr_irqs =~ "^nr_irqs$";
expression E;
@@
-nr_irqs = E;
-return nr_irqs;
+return set_number_of_interrupts(E);
@@
global idexpression nr_irqs =~ "^nr_irqs$";
expression E;
@@
-nr_irqs = (E);
+set_number_of_interrupts(E);
@@
global idexpression nr_irqs =~ "^nr_irqs$";
expression E;
@@
-nr_irqs = E;
+set_number_of_interrupts(E);
@@
global idexpression nr_irqs =~ "^nr_irqs$";
@@
-nr_irqs
+number_of_interrupts()
Thanks,
Bart.
Bart Van Assche (21):
genirq: Introduce number_of_interrupts() and
set_number_of_interrupts()
ARM: Switch to number_of_interrupts() / set_number_of_interrupts()
LoongArch: Switch to set_number_of_interrupts()
powerpc/cell: Switch to number_of_interrupts()
s390/irq: Switch to number_of_interrupts()
x86/acpi: Switch to number_of_interrupts() /
set_number_of_interrupts()
hpet: Switch to number_of_interrupts()
net: 3com: 3c59x: Switch to number_of_interrupts()
net: hamradio: baycom_ser_fdx: Switch to number_of_interrupts()
scsi: aha152x: Switch to number_of_interrupts()
serial: core: Switch to number_of_interrupts()
serial: 8250: Switch to number_of_interrupts()
serial: amba-pl010: Switch to number_of_interrupts()
serial: amba-pl011: Switch to number_of_interrupts()
serial: cpm_uart: Switch to number_of_interrupts()
serial: ucc_uart: Switch to number_of_interrupts()
sh: intc: Switch to number_of_interrupts()
xen/events: Switch to number_of_interrupts()
fs/procfs: Switch to number_of_interrupts()
genirq: Switch to number_of_interrupts()
genirq: Unexport nr_irqs
arch/arm/kernel/irq.c | 5 ++---
arch/loongarch/kernel/irq.c | 4 ++--
arch/powerpc/platforms/cell/axon_msi.c | 2 +-
arch/s390/kernel/irq.c | 2 +-
arch/x86/kernel/acpi/boot.c | 6 ++++--
arch/x86/kernel/apic/vector.c | 8 ++++----
drivers/char/hpet.c | 2 +-
drivers/net/ethernet/3com/3c59x.c | 2 +-
drivers/net/hamradio/baycom_ser_fdx.c | 4 ++--
drivers/net/hamradio/scc.c | 6 +++---
drivers/scsi/aha152x.c | 2 +-
drivers/sh/intc/virq-debugfs.c | 2 +-
drivers/tty/serial/8250/8250_port.c | 2 +-
drivers/tty/serial/amba-pl010.c | 2 +-
drivers/tty/serial/amba-pl011.c | 2 +-
drivers/tty/serial/cpm_uart.c | 2 +-
drivers/tty/serial/serial_core.c | 2 +-
drivers/tty/serial/ucc_uart.c | 2 +-
drivers/xen/events/events_base.c | 2 +-
fs/proc/interrupts.c | 4 ++--
fs/proc/stat.c | 4 ++--
include/linux/irqnr.h | 18 ++++++++++--------
kernel/irq/irqdesc.c | 17 +++++++++++++++--
kernel/irq/irqdomain.c | 2 +-
kernel/irq/proc.c | 5 +++--
25 files changed, 63 insertions(+), 46 deletions(-)
next reply other threads:[~2024-09-30 18:16 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 18:15 Bart Van Assche [this message]
2024-09-30 18:15 ` [PATCH 01/21] genirq: Introduce number_of_interrupts() and set_number_of_interrupts() Bart Van Assche
2024-10-01 12:33 ` Thomas Gleixner
2024-10-01 20:12 ` Bart Van Assche
2024-10-02 15:49 ` Thomas Gleixner
2024-10-03 21:01 ` Bart Van Assche
2024-10-06 19:58 ` Thomas Gleixner
2024-09-30 18:15 ` [PATCH 02/21] ARM: Switch to number_of_interrupts() / set_number_of_interrupts() Bart Van Assche
2024-09-30 18:15 ` [PATCH 03/21] LoongArch: Switch to set_number_of_interrupts() Bart Van Assche
2024-09-30 18:15 ` [PATCH 04/21] powerpc/cell: Switch to number_of_interrupts() Bart Van Assche
2024-09-30 18:15 ` [PATCH 05/21] s390/irq: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 06/21] x86/acpi: Switch to number_of_interrupts() / set_number_of_interrupts() Bart Van Assche
2024-09-30 18:15 ` [PATCH 07/21] hpet: Switch to number_of_interrupts() Bart Van Assche
2024-10-06 17:13 ` David Laight
2024-10-07 0:45 ` Bart Van Assche
2024-10-07 12:11 ` Thomas Gleixner
2024-10-07 13:00 ` David Laight
2024-10-07 15:27 ` Thomas Gleixner
2024-09-30 18:15 ` [PATCH 08/21] net: 3com: 3c59x: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 09/21] net: hamradio: baycom_ser_fdx: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 10/21] scsi: aha152x: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 11/21] serial: core: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 12/21] serial: 8250: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 13/21] serial: amba-pl010: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 14/21] serial: amba-pl011: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 15/21] serial: cpm_uart: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 16/21] serial: ucc_uart: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 17/21] sh: intc: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 18/21] xen/events: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 19/21] fs/procfs: " Bart Van Assche
2024-09-30 18:15 ` [PATCH 20/21] genirq: " Bart Van Assche
2024-10-07 16:26 ` Bart Van Assche
2024-09-30 18:16 ` [PATCH 21/21] genirq: Unexport nr_irqs Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240930181600.1684198-1-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®