Skip to content

Commit 761becb

Browse files
elfringMarc Zyngier
authored andcommitted
irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
A coccicheck run provided information like the following. drivers/irqchip/irq-ti-sci-inta.c:250:9-16: WARNING: ERR_CAST can be used with vint_desc. Generated by: scripts/coccinelle/api/err_cast.cocci Thus adjust the exception handling in one if branch. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Lokesh Vutla <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b8b0145 commit 761becb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/irqchip/irq-ti-sci-inta.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
246246
/* No free bits available. Allocate a new vint */
247247
vint_desc = ti_sci_inta_alloc_parent_irq(domain);
248248
if (IS_ERR(vint_desc)) {
249-
mutex_unlock(&inta->vint_mutex);
250-
return ERR_PTR(PTR_ERR(vint_desc));
249+
event_desc = ERR_CAST(vint_desc);
250+
goto unlock;
251251
}
252252

253253
free_bit = find_first_zero_bit(vint_desc->event_map,
@@ -259,6 +259,7 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
259259
if (IS_ERR(event_desc))
260260
clear_bit(free_bit, vint_desc->event_map);
261261

262+
unlock:
262263
mutex_unlock(&inta->vint_mutex);
263264
return event_desc;
264265
}

0 commit comments

Comments
 (0)