Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip: Use int type to store negative error codes

Change the 'ret' variable from unsigned int to int to store negative error
codes or zero returned by other functions.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but assigning negative error codes to unsigned type may trigger
a compiler warning when the -Wsign-conversion flag is enabled.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/all/20250829132020.82077-1-rongqianfeng@vivo.com

authored by

Qianfeng Rong and committed by
Thomas Gleixner
40c26230 54a1726d

+6 -3
+2 -1
drivers/irqchip/irq-gic-v3.c
··· 1766 1766 struct irq_fwspec *fwspec, 1767 1767 enum irq_domain_bus_token bus_token) 1768 1768 { 1769 - unsigned int type, ret, ppi_idx; 1769 + unsigned int type, ppi_idx; 1770 1770 irq_hw_number_t hwirq; 1771 + int ret; 1771 1772 1772 1773 /* Not for us */ 1773 1774 if (fwspec->fwnode != d->fwnode)
+2 -1
drivers/irqchip/irq-nvic.c
··· 73 73 struct device_node *parent) 74 74 { 75 75 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 76 - unsigned int irqs, i, ret, numbanks; 76 + unsigned int irqs, i, numbanks; 77 77 void __iomem *nvic_base; 78 + int ret; 78 79 79 80 numbanks = (readl_relaxed(V7M_SCS_ICTR) & 80 81 V7M_SCS_ICTR_INTLINESNUM_MASK) + 1;
+2 -1
drivers/irqchip/irq-renesas-rza1.c
··· 142 142 static int rza1_irqc_parse_map(struct rza1_irqc_priv *priv, 143 143 struct device_node *gic_node) 144 144 { 145 - unsigned int imaplen, i, j, ret; 146 145 struct device *dev = priv->dev; 146 + unsigned int imaplen, i, j; 147 147 struct device_node *ipar; 148 148 const __be32 *imap; 149 149 u32 intsize; 150 + int ret; 150 151 151 152 imap = of_get_property(dev->of_node, "interrupt-map", &imaplen); 152 153 if (!imap)