mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mailbox: PCC: Fix return value of pcc_mbox_request_channel()
@ 2016-10-14 23:20 Hoan Tran
  2016-10-21 21:31 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Hoan Tran @ 2016-10-14 23:20 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Robert Moore, Prakash Prashanth
  Cc: linux-acpi, linux-kernel, lho, Duc Dang, devel, Hoan Tran

When CONFIG_PCC is disabled, pcc_mbox_request_channel() needs to
return ERR_PTR(-ENODEV), not a NULL pointer, as the callers of
this function use IS_ERR() to check for error code.

Signed-off-by: Duc Dang <dhdang@apm.com>
Signed-off-by: Hoan Tran <hotran@apm.com>
---
 include/acpi/pcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h
index 17a940a..8caa79c 100644
--- a/include/acpi/pcc.h
+++ b/include/acpi/pcc.h
@@ -21,7 +21,7 @@ extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 							 int subspace_id)
 {
-	return NULL;
+	return ERR_PTR(-ENODEV);
 }
 static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
 #endif
-- 
1.9.1

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

* Re: [PATCH] mailbox: PCC: Fix return value of pcc_mbox_request_channel()
  2016-10-14 23:20 [PATCH] mailbox: PCC: Fix return value of pcc_mbox_request_channel() Hoan Tran
@ 2016-10-21 21:31 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2016-10-21 21:31 UTC (permalink / raw)
  To: Hoan Tran
  Cc: Rafael J. Wysocki, Len Brown, Robert Moore, Prakash Prashanth,
	linux-acpi, linux-kernel, lho, Duc Dang, devel

On Friday, October 14, 2016 04:20:21 PM Hoan Tran wrote:
> When CONFIG_PCC is disabled, pcc_mbox_request_channel() needs to
> return ERR_PTR(-ENODEV), not a NULL pointer, as the callers of
> this function use IS_ERR() to check for error code.
> 
> Signed-off-by: Duc Dang <dhdang@apm.com>
> Signed-off-by: Hoan Tran <hotran@apm.com>
> ---
>  include/acpi/pcc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h
> index 17a940a..8caa79c 100644
> --- a/include/acpi/pcc.h
> +++ b/include/acpi/pcc.h
> @@ -21,7 +21,7 @@ extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
>  static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
>  							 int subspace_id)
>  {
> -	return NULL;
> +	return ERR_PTR(-ENODEV);
>  }
>  static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
>  #endif
> 

Applied.

Thanks,
Rafael

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

end of thread, other threads:[~2016-10-21 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 23:20 [PATCH] mailbox: PCC: Fix return value of pcc_mbox_request_channel() Hoan Tran
2016-10-21 21:31 ` Rafael J. Wysocki

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®