Skip to contentSkip to conversation

net: mvpp2: simplify IRQ validity check

PATCH Applied [email protected] 3 participants 3 messages Sep 3 – Sep 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index ccc24a1301f2..1c50174c9f1e 100644
@@ -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
reviewer Reviewed-by on v2 1/1
#1 lore raw
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 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().

---

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.

#2 lore raw
In reply to [email protected]
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 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().

[...]

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