]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
irqchip: Use int type to store negative error codes
authorQianfeng Rong <rongqianfeng@vivo.com>
Fri, 29 Aug 2025 13:20:19 +0000 (21:20 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 3 Sep 2025 12:10:30 +0000 (14:10 +0200)
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
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-nvic.c
drivers/irqchip/irq-renesas-rza1.c

index dbeb85677b08cbe4313087a18efa47443fa3556d..3de351e66ee844f8ac0f9d25be6f36cbd2ac2770 100644 (file)
@@ -1766,8 +1766,9 @@ static int gic_irq_domain_select(struct irq_domain *d,
                                 struct irq_fwspec *fwspec,
                                 enum irq_domain_bus_token bus_token)
 {
-       unsigned int type, ret, ppi_idx;
+       unsigned int type, ppi_idx;
        irq_hw_number_t hwirq;
+       int ret;
 
        /* Not for us */
        if (fwspec->fwnode != d->fwnode)
index 76e11cac96318c43441c6d3df8ba862be6de3ea3..2191a2b795785b858099bd2af17057c3dd819d63 100644 (file)
@@ -73,8 +73,9 @@ static int __init nvic_of_init(struct device_node *node,
                               struct device_node *parent)
 {
        unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
-       unsigned int irqs, i, ret, numbanks;
+       unsigned int irqs, i, numbanks;
        void __iomem *nvic_base;
+       int ret;
 
        numbanks = (readl_relaxed(V7M_SCS_ICTR) &
                    V7M_SCS_ICTR_INTLINESNUM_MASK) + 1;
index a697eb55ac90e4ce2bdb236cc68a97e5afa2cd0a..6047a524ac77e2ed34bf787855c4cca0874cb42d 100644 (file)
@@ -142,11 +142,12 @@ static const struct irq_domain_ops rza1_irqc_domain_ops = {
 static int rza1_irqc_parse_map(struct rza1_irqc_priv *priv,
                               struct device_node *gic_node)
 {
-       unsigned int imaplen, i, j, ret;
        struct device *dev = priv->dev;
+       unsigned int imaplen, i, j;
        struct device_node *ipar;
        const __be32 *imap;
        u32 intsize;
+       int ret;
 
        imap = of_get_property(dev->of_node, "interrupt-map", &imaplen);
        if (!imap)