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 v3 00/22] Reduce the scope of 'nr_irqs'
Date: Tue, 15 Oct 2024 12:09:31 -0700 [thread overview]
Message-ID: <20241015190953.1266194-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.
Accesses of the global variable 'nr_irqs' have been identified with
Coccinelle.
Please consider this patch series for the next merge window.
Thanks,
Bart.
Changes compared to v2:
- Changed "This patch prepares" into "Prepare" in the several patch
descriptions.
- Changed the type of 'nr_irqs' from 'int' into 'unsigned int'.
Changes compared to v1:
- Renamed the accessor functions: number_of_interrupts() has been renamed into
irq_get_nr_irqs() and set_number_of_interrupts() has been renamed into
set_number_of_interrupts().
- Made the description of patch 01 more detailed. It is now explained in
detail why it is useful to introduce accessor functions for 'nr_irqs'.
- Cache the irq_get_nr_irqs() return value if it is used as a loop upper bound
or inside a loop body instead of relying on CSE (common subexpression
elimination) by the compiler.
- Changed the return type of the accessor functions from 'int' into
'unsigned int'.
- Split the hamradio patch into two patches - one patch per driver.
Bart Van Assche (22):
genirq: Introduce irq_get_nr_irqs() and irq_set_nr_irqs()
ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs()
LoongArch: Switch to irq_set_nr_irqs()
powerpc/cell: Switch to irq_get_nr_irqs()
s390/irq: Switch to irq_get_nr_irqs()
x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs()
hpet: Switch to irq_get_nr_irqs()
net: 3com: 3c59x: Switch to irq_get_nr_irqs()
net: hamradio: baycom_ser_fdx: Switch to irq_get_nr_irqs()
net: hamradio: scc: Switch to irq_get_nr_irqs()
scsi: aha152x: Switch to irq_get_nr_irqs()
serial: core: Switch to irq_get_nr_irqs()
serial: 8250: Switch to irq_get_nr_irqs()
serial: amba-pl010: Switch to irq_get_nr_irqs()
serial: amba-pl011: Switch to irq_get_nr_irqs()
serial: cpm_uart: Switch to irq_get_nr_irqs()
serial: ucc_uart: Switch to irq_get_nr_irqs()
sh: intc: Switch to irq_get_nr_irqs()
xen/events: Switch to irq_get_nr_irqs()
fs/procfs: Switch to irq_get_nr_irqs()
genirq: Switch to irq_get_nr_irqs()
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 | 1 +
drivers/net/ethernet/3com/3c59x.c | 2 +-
drivers/net/hamradio/baycom_ser_fdx.c | 1 +
drivers/net/hamradio/scc.c | 4 ++-
drivers/scsi/aha152x.c | 2 +-
drivers/sh/intc/virq-debugfs.c | 1 +
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 | 36 +++++++++++++++-----------
kernel/irq/irqdesc.c | 26 +++++++++++++++++--
kernel/irq/irqdomain.c | 2 +-
kernel/irq/proc.c | 3 ++-
25 files changed, 81 insertions(+), 46 deletions(-)
next reply other threads:[~2024-10-15 19:10 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 19:09 Bart Van Assche [this message]
2024-10-15 19:09 ` [PATCH v3 01/22] genirq: Introduce irq_get_nr_irqs() and irq_set_nr_irqs() Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 02/22] ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs() Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 03/22] LoongArch: Switch to irq_set_nr_irqs() Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 04/22] powerpc/cell: Switch to irq_get_nr_irqs() Bart Van Assche
2024-10-15 23:36 ` Michael Ellerman
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 05/22] s390/irq: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 06/22] x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs() Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 07/22] hpet: Switch to irq_get_nr_irqs() Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 08/22] net: 3com: 3c59x: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 09/22] net: hamradio: baycom_ser_fdx: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 10/22] net: hamradio: scc: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 11/22] scsi: aha152x: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 12/22] serial: core: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 13/22] serial: 8250: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 14/22] serial: amba-pl010: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 15/22] serial: amba-pl011: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 16/22] serial: cpm_uart: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 17/22] serial: ucc_uart: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 18/22] sh: intc: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 19/22] xen/events: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 20/22] fs/procfs: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 21/22] genirq: " Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for Bart Van Assche
2024-10-15 19:09 ` [PATCH v3 22/22] genirq: Unexport nr_irqs Bart Van Assche
2024-10-16 20:04 ` [tip: irq/core] " tip-bot2 for 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=20241015190953.1266194-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®