linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
@ 2019-11-05 11:30 Markus Elfring
  2019-11-11  3:35 ` Lokesh Vutla
  2019-11-20 13:21 ` [tip: irq/core] " tip-bot2 for Markus Elfring
  0 siblings, 2 replies; 5+ messages in thread
From: Markus Elfring @ 2019-11-05 11:30 UTC (permalink / raw)
  To: linux-arm-kernel, Jason Cooper, Lokesh Vutla, Marc Zyngier,
	Nishanth Menon, Santosh Shilimkar, Tero Kristo, Thomas Gleixner
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Nov 2019 12:19:39 +0100

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.

Fixes: 9f1463b86c13277d0bd88d5ee359577ef40f4da7 ("irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/irqchip/irq-ti-sci-inta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
index ef4d625d2d80..8f6e6b08eadf 100644
--- a/drivers/irqchip/irq-ti-sci-inta.c
+++ b/drivers/irqchip/irq-ti-sci-inta.c
@@ -246,8 +246,8 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
 	/* No free bits available. Allocate a new vint */
 	vint_desc = ti_sci_inta_alloc_parent_irq(domain);
 	if (IS_ERR(vint_desc)) {
-		mutex_unlock(&inta->vint_mutex);
-		return ERR_PTR(PTR_ERR(vint_desc));
+		event_desc = ERR_CAST(vint_desc);
+		goto unlock;
 	}

 	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
 	if (IS_ERR(event_desc))
 		clear_bit(free_bit, vint_desc->event_map);

+unlock:
 	mutex_unlock(&inta->vint_mutex);
 	return event_desc;
 }
--
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
  2019-11-05 11:30 [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Markus Elfring
@ 2019-11-11  3:35 ` Lokesh Vutla
  2019-11-11 10:15   ` Marc Zyngier
  2019-11-20 13:21 ` [tip: irq/core] " tip-bot2 for Markus Elfring
  1 sibling, 1 reply; 5+ messages in thread
From: Lokesh Vutla @ 2019-11-11  3:35 UTC (permalink / raw)
  To: Markus Elfring, linux-arm-kernel, Jason Cooper, Marc Zyngier,
	Nishanth Menon, Santosh Shilimkar, Tero Kristo, Thomas Gleixner
  Cc: LKML, kernel-janitors



On 05/11/19 5:00 PM, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 5 Nov 2019 12:19:39 +0100
> 
> 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.
> 
> Fixes: 9f1463b86c13277d0bd88d5ee359577ef40f4da7 ("irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver")

Fixes: 9f1463b86c13 ("irqchip/ti-sci-inta: Add support for Interrupt Aggregator
driver")

With this:

Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

Thanks and regards,
Lokesh


> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/irqchip/irq-ti-sci-inta.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
> index ef4d625d2d80..8f6e6b08eadf 100644
> --- a/drivers/irqchip/irq-ti-sci-inta.c
> +++ b/drivers/irqchip/irq-ti-sci-inta.c
> @@ -246,8 +246,8 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
>  	/* No free bits available. Allocate a new vint */
>  	vint_desc = ti_sci_inta_alloc_parent_irq(domain);
>  	if (IS_ERR(vint_desc)) {
> -		mutex_unlock(&inta->vint_mutex);
> -		return ERR_PTR(PTR_ERR(vint_desc));
> +		event_desc = ERR_CAST(vint_desc);
> +		goto unlock;
>  	}
> 
>  	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
>  	if (IS_ERR(event_desc))
>  		clear_bit(free_bit, vint_desc->event_map);
> 
> +unlock:
>  	mutex_unlock(&inta->vint_mutex);
>  	return event_desc;
>  }
> --
> 2.23.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
  2019-11-11  3:35 ` Lokesh Vutla
@ 2019-11-11 10:15   ` Marc Zyngier
  2019-11-13 11:05     ` Lokesh Vutla
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2019-11-11 10:15 UTC (permalink / raw)
  To: Lokesh Vutla
  Cc: Markus Elfring, linux-arm-kernel, Jason Cooper, Nishanth Menon,
	Santosh Shilimkar, Tero Kristo, Thomas Gleixner, LKML,
	kernel-janitors

On 2019-11-11 04:45, Lokesh Vutla wrote:
> On 05/11/19 5:00 PM, Markus Elfring wrote:
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Tue, 5 Nov 2019 12:19:39 +0100
>>
>> 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.
>>
>> Fixes: 9f1463b86c13277d0bd88d5ee359577ef40f4da7 
>> ("irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver")
>
> Fixes: 9f1463b86c13 ("irqchip/ti-sci-inta: Add support for Interrupt 
> Aggregator driver")

I fundamentally disagree with the "Fixes:" tag. This isn't a fix,
just a minor readability improvement. Flagging things as "Fixes:"
ends up triggering all kind of unnecessary backports to -stable.

> With this:
>
> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

I'll otherwise take this patch in -next.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
  2019-11-11 10:15   ` Marc Zyngier
@ 2019-11-13 11:05     ` Lokesh Vutla
  0 siblings, 0 replies; 5+ messages in thread
From: Lokesh Vutla @ 2019-11-13 11:05 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Markus Elfring, linux-arm-kernel, Jason Cooper, Nishanth Menon,
	Santosh Shilimkar, Tero Kristo, Thomas Gleixner, LKML,
	kernel-janitors



On 11/11/19 3:45 PM, Marc Zyngier wrote:
> On 2019-11-11 04:45, Lokesh Vutla wrote:
>> On 05/11/19 5:00 PM, Markus Elfring wrote:
>>> From: Markus Elfring <elfring@users.sourceforge.net>
>>> Date: Tue, 5 Nov 2019 12:19:39 +0100
>>>
>>> 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.
>>>
>>> Fixes: 9f1463b86c13277d0bd88d5ee359577ef40f4da7 ("irqchip/ti-sci-inta: Add
>>> support for Interrupt Aggregator driver")
>>
>> Fixes: 9f1463b86c13 ("irqchip/ti-sci-inta: Add support for Interrupt
>> Aggregator driver")
> 
> I fundamentally disagree with the "Fixes:" tag. This isn't a fix,
> just a minor readability improvement. Flagging things as "Fixes:"
> ends up triggering all kind of unnecessary backports to -stable.
> 
>> With this:

Fine with me. Please drop the fixes tag.

Thanks and regards.
Lokesh

>>
>> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
> 
> I'll otherwise take this patch in -next.
> 
> Thanks,
> 
>         M.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: irq/core] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
  2019-11-05 11:30 [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Markus Elfring
  2019-11-11  3:35 ` Lokesh Vutla
@ 2019-11-20 13:21 ` tip-bot2 for Markus Elfring
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Markus Elfring @ 2019-11-20 13:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Markus Elfring, Marc Zyngier, Lokesh Vutla, Ingo Molnar,
	Borislav Petkov, linux-kernel

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     761becb29183c4e2ad9ff5f63933170c8fffd544
Gitweb:        https://git.kernel.org/tip/761becb29183c4e2ad9ff5f63933170c8fffd544
Author:        Markus Elfring <elfring@users.sourceforge.net>
AuthorDate:    Tue, 05 Nov 2019 12:19:39 +01:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Mon, 11 Nov 2019 10:19:06 

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 <elfring@users.sourceforge.net>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/776b7135-26af-df7d-c3a9-4339f7bf1f15@web.de
---
 drivers/irqchip/irq-ti-sci-inta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
index ef4d625..8f6e6b0 100644
--- a/drivers/irqchip/irq-ti-sci-inta.c
+++ b/drivers/irqchip/irq-ti-sci-inta.c
@@ -246,8 +246,8 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
 	/* No free bits available. Allocate a new vint */
 	vint_desc = ti_sci_inta_alloc_parent_irq(domain);
 	if (IS_ERR(vint_desc)) {
-		mutex_unlock(&inta->vint_mutex);
-		return ERR_PTR(PTR_ERR(vint_desc));
+		event_desc = ERR_CAST(vint_desc);
+		goto unlock;
 	}
 
 	free_bit = find_first_zero_bit(vint_desc->event_map,
@@ -259,6 +259,7 @@ alloc_event:
 	if (IS_ERR(event_desc))
 		clear_bit(free_bit, vint_desc->event_map);
 
+unlock:
 	mutex_unlock(&inta->vint_mutex);
 	return event_desc;
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-20 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 11:30 [PATCH] irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Markus Elfring
2019-11-11  3:35 ` Lokesh Vutla
2019-11-11 10:15   ` Marc Zyngier
2019-11-13 11:05     ` Lokesh Vutla
2019-11-20 13:21 ` [tip: irq/core] " tip-bot2 for Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).