net: mvpp2: simplify IRQ validity check
Subsystems (3)
PATCH v2 1/1 net: mvpp2: simplify IRQ validity check
From: bui duc phuc <[email protected]>
irq_of_parse_and_map() returns 0 when parsing or mapping an IRQ fails. The current condition also checks for negative values, even though irq_of_parse_and_map() does not return negative error codes.
Check only for a zero return value to match the semantics of irq_of_parse_and_map().
---
Link v1:
https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Drop the Fixes tag and rework the commit message to describe this as a cleanup.
- Add net-next to the --subject-prefix.
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +1 -1
@@ -5874,7 +5874,7 @@ static int mvpp2_simple_queue_vectors_init(struct mvpp2_port *port, v->sw_thread_mask = *cpumask_bits (cpu_online_mask); v->port = port; v->irq =irq_of_parse_and_map (port_node,0 ); -if (v->irq <=0 ) +if (!v->irq)return -EINVAL ;netif_napi_add (port->dev, &v->napi, mvpp2_poll);
Signature · 1 line
2.43.0
Quoted 12 lines · On Thu, Sep 03, 2026 at 02:57:53PM +0700, [email protected] wrote:
From: bui duc phuc <[email protected]>
irq_of_parse_and_map()returns 0 when parsing or mapping an IRQ fails. The current condition also checks for negative values, even thoughirq_of_parse_and_map()does not return negative error codes.Check only for a zero return value to match the semantics of
irq_of_parse_and_map().Signed-off-by bui duc phuc <[email protected]>---
Quoted 7 lines
Link v1:
https://lore.kernel.org/all/[email protected]/Changes in v2:
- Drop the Fixes tag and rework the commit message to describe this as a cleanup.
- Add net-next to the --subject-prefix.
Thanks for the updates.
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 10 lines · On Thu, 3 Sep 2026 14:57:53 +0700 you wrote:
From: bui duc phuc <[email protected]>
irq_of_parse_and_map()returns 0 when parsing or mapping an IRQ fails. The current condition also checks for negative values, even thoughirq_of_parse_and_map()does not return negative error codes.Check only for a zero return value to match the semantics of
irq_of_parse_and_map().[...]
Here is the summary with links:
- [net-next,v2] net: mvpp2: simplify IRQ validity check
https://git.kernel.org/netdev/net-next/c/bf6f89ccd974
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html