Re: [PATCH 01/21] genirq: Introduce number_of_interrupts() and set_number_of_interrupts()

From: Bart Van Assche
Date: Thu Oct 03 2024 - 17:04:11 EST


On 10/2/24 8:49 AM, Thomas Gleixner wrote:
On Tue, Oct 01 2024 at 13:12, Bart Van Assche wrote:
On 10/1/24 5:33 AM, Thomas Gleixner wrote:
On Mon, Sep 30 2024 at 11:15, Bart Van Assche wrote:
into a variable with file scope.

Also what's the rationale for this?

Suppose that a patch would be submitted for review that removes a
declaration of a local variable with the name 'nr_irqs' and that does
not remove all assignments to that local variable. Such a patch converts
an assignment to a local variable into an assignment into a global
variable. If the 'nr_irqs' assignment is more than three lines away from
other changes, the assignment won't be included in the diff context
lines and hence won't be visible without inspecting the modified file.
This is why I mentioned in the cover letter that this change makes
patches easier to review. With this patch series applied, such
accidental conversions from assignments to a local variable into an
assignment to a global variable are converted into a compilation
error.

Can you please add that to the change log?

I will do that.

extern int nr_irqs;
+int number_of_interrupts(void) __pure;
+int set_number_of_interrupts(int nr);

Please use a proper name space prefix for the functions
irq_.....(). These random names are horrible.

How about irq_count() and irq_set_count()?

Sure.

I just noticed that a macro with the name irq_count() already exists.
How about the names irq_get_nr_irqs() and irq_set_nr_irqs() instead?

Thanks,

Bart.