[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.18] Arm64: adjust __irq_to_desc() to fix build with gcc14
commit 133b92bf78c21f40c6a316fc000422a188c01a7a Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Tue Sep 24 14:57:43 2024 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Sep 24 14:57:43 2024 +0200 Arm64: adjust __irq_to_desc() to fix build with gcc14 With the original code I observe In function â??__irq_to_descâ??, inlined from â??route_irq_to_guestâ?? at arch/arm/irq.c:465:12: arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of â??irq_desc_t[32]â?? {aka â??struct irq_desc[32]â??} [-Werror=array-bounds=] 54 | return &this_cpu(local_irq_desc)[irq]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ which looks pretty bogus: How in the world does the compiler arrive at -2 when compiling route_irq_to_guest()? Yet independent of that the function's parameter wants to be of unsigned type anyway, as shown by a vast majority of callers (others use plain int when they really mean non-negative quantities). With that adjustment the code compiles fine again. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Michal Orzel <michal.orzel@xxxxxxx> master commit: 99f942f3d410059dc223ee0a908827e928ef3592 master date: 2024-08-29 10:03:53 +0200 --- xen/arch/arm/include/asm/irq.h | 2 +- xen/arch/arm/irq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/include/asm/irq.h b/xen/arch/arm/include/asm/irq.h index c8044b0371..59348a0dd4 100644 --- a/xen/arch/arm/include/asm/irq.h +++ b/xen/arch/arm/include/asm/irq.h @@ -57,7 +57,7 @@ extern const unsigned int nr_irqs; struct irq_desc; struct irqaction; -struct irq_desc *__irq_to_desc(int irq); +struct irq_desc *__irq_to_desc(unsigned int irq); #define irq_to_desc(irq) __irq_to_desc(irq) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index ae69fb4aeb..014b2d7982 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = { static irq_desc_t irq_desc[NR_IRQS]; static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc); -struct irq_desc *__irq_to_desc(int irq) +struct irq_desc *__irq_to_desc(unsigned int irq) { if ( irq < NR_LOCAL_IRQS ) return &this_cpu(local_irq_desc)[irq]; -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.18
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |