mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cxl: Fix error handling
@ 2016-10-30 21:34 Christophe JAILLET
  2016-10-31  6:27 ` Andrew Donnellan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christophe JAILLET @ 2016-10-30 21:34 UTC (permalink / raw)
  To: imunsie, fbarrat
  Cc: linuxppc-dev, linux-kernel, kernel-janitors, Christophe JAILLET

'cxl_dev_context_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
un-compiled because I don't have the required  cross build environment.
---
 drivers/misc/cxl/api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 2b88ad8a2a89..e2efc6489c6e 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -538,7 +538,7 @@ int _cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 
 		if (remaining > 0) {
 			new_ctx = cxl_dev_context_init(pdev);
-			if (!new_ctx) {
+			if (IS_ERR(new_ctx)) {
 				pr_warn("%s: Failed to allocate enough contexts for MSIs\n", pci_name(pdev));
 				return -ENOSPC;
 			}
-- 
2.9.3

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

* Re: [PATCH] cxl: Fix error handling
  2016-10-30 21:34 [PATCH] cxl: Fix error handling Christophe JAILLET
@ 2016-10-31  6:27 ` Andrew Donnellan
  2016-10-31  9:50   ` Michael Ellerman
  2016-11-16  1:54 ` Ian Munsie
  2016-11-22  0:34 ` Michael Ellerman
  2 siblings, 1 reply; 6+ messages in thread
From: Andrew Donnellan @ 2016-10-31  6:27 UTC (permalink / raw)
  To: Christophe JAILLET, imunsie, fbarrat
  Cc: kernel-janitors, linuxppc-dev, linux-kernel

On 31/10/16 08:34, Christophe JAILLET wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
> un-compiled because I don't have the required  cross build environment.

Builds fine here.

In future, you might want to bundle all 3 of your patches either into 1 
patch (while they are changes which can be done separately, it's all 
fixes to one type of problem in relation to one function, so personally 
I'm okay with that) or send it as a series, so that it's clear to 
everyone that they're all related fixes.

Additionally, having the same patch subject line for two patches sent in 
short succession is a bit confusing - in future, try and avoid that.


Andrew

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

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

* Re: [PATCH] cxl: Fix error handling
  2016-10-31  6:27 ` Andrew Donnellan
@ 2016-10-31  9:50   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-10-31  9:50 UTC (permalink / raw)
  To: Andrew Donnellan, Christophe JAILLET, imunsie, fbarrat
  Cc: linuxppc-dev, kernel-janitors, linux-kernel

Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:

> On 31/10/16 08:34, Christophe JAILLET wrote:
>> 'cxl_dev_context_init()' returns an error pointer in case of error, not
>> NULL. So test it with IS_ERR.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
>
>> ---
>> un-compiled because I don't have the required  cross build environment.
>
> Builds fine here.
>
> In future, you might want to bundle all 3 of your patches either into 1 
> patch (while they are changes which can be done separately, it's all 
> fixes to one type of problem in relation to one function, so personally 
> I'm okay with that) or send it as a series, so that it's clear to 
> everyone that they're all related fixes.

> Additionally, having the same patch subject line for two patches sent in 
> short succession is a bit confusing - in future, try and avoid that.

Yeah. I actually assumed it was two versions of the same patch.

cheers

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

* Re: [PATCH] cxl: Fix error handling
  2016-10-30 21:34 [PATCH] cxl: Fix error handling Christophe JAILLET
  2016-10-31  6:27 ` Andrew Donnellan
@ 2016-11-16  1:54 ` Ian Munsie
  2016-11-22  0:34 ` Michael Ellerman
  2 siblings, 0 replies; 6+ messages in thread
From: Ian Munsie @ 2016-11-16  1:54 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: fbarrat, linuxppc-dev, linux-kernel, kernel-janitors

Acked-by: Ian Munsie <imunsie@au1.ibm.com>

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

* Re: cxl: Fix error handling
  2016-10-30 21:34 [PATCH] cxl: Fix error handling Christophe JAILLET
  2016-10-31  6:27 ` Andrew Donnellan
  2016-11-16  1:54 ` Ian Munsie
@ 2016-11-22  0:34 ` Michael Ellerman
  2 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-11-22  0:34 UTC (permalink / raw)
  To: Christophe Jaillet, imunsie, fbarrat
  Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel

On Sun, 2016-10-30 at 21:34:51 UTC, Christophe Jaillet wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/28e323e5a0b21b3665eb6e136ca8bb

cheers

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

* Re: cxl: Fix error handling
  2016-10-30 21:40 [PATCH] " Christophe JAILLET
@ 2016-11-22  0:34 ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-11-22  0:34 UTC (permalink / raw)
  To: Christophe Jaillet, imunsie, fbarrat
  Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel

On Sun, 2016-10-30 at 21:40:47 UTC, Christophe Jaillet wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/bb81733de28c99e10b61dcaff15921

cheers

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

end of thread, other threads:[~2016-11-22  0:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-30 21:34 [PATCH] cxl: Fix error handling Christophe JAILLET
2016-10-31  6:27 ` Andrew Donnellan
2016-10-31  9:50   ` Michael Ellerman
2016-11-16  1:54 ` Ian Munsie
2016-11-22  0:34 ` Michael Ellerman
2016-10-30 21:40 [PATCH] " Christophe JAILLET
2016-11-22  0:34 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®