mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL
@ 2015-03-09 14:45 Marc Kleine-Budde
  2015-03-09 14:45 ` Marc Kleine-Budde
  2015-03-10 10:09 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-03-09 14:45 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 include/param.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/param.h b/include/param.h
index 53bee541100e..bd2c0789968a 100644
--- a/include/param.h
+++ b/include/param.h
@@ -97,7 +97,7 @@ static inline struct param_d *dev_add_param(struct device_d *dev, char *name,
 		const char *(*get)(struct device_d *, struct param_d *p),
 		unsigned long flags)
 {
-	return 0;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_string(struct device_d *dev, const char *name,
@@ -105,7 +105,7 @@ static inline struct param_d *dev_add_param_string(struct device_d *dev, const c
 		int (*get)(struct param_d *p, void *priv),
 		char **value, void *priv)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_int(struct device_d *dev, const char *name,
@@ -113,7 +113,7 @@ static inline struct param_d *dev_add_param_int(struct device_d *dev, const char
 		int (*get)(struct param_d *p, void *priv),
 		int *value, const char *format, void *priv)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_enum(struct device_d *dev, const char *name,
@@ -122,7 +122,7 @@ static inline struct param_d *dev_add_param_enum(struct device_d *dev, const cha
 		int *value, const char **names, int max, void *priv)
 
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_bool(struct device_d *dev, const char *name,
@@ -130,19 +130,19 @@ static inline struct param_d *dev_add_param_bool(struct device_d *dev, const cha
 		int (*get)(struct param_d *p, void *priv),
 		int *value, void *priv)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_int_ro(struct device_d *dev, const char *name,
 		int value, const char *format)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_llint_ro(struct device_d *dev, const char *name,
 		long long value, const char *format)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char *name,
@@ -150,7 +150,7 @@ static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char
 		int (*get)(struct param_d *p, void *priv),
 		IPaddr_t *ip, void *priv)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
@@ -158,7 +158,7 @@ static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char
 		int (*get)(struct param_d *p, void *priv),
 		u8 *mac, void *priv)
 {
-	return NULL;
+	return ERR_PTR(-ENOSYS);
 }
 
 static inline int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value)
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL
  2015-03-09 14:45 [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL Marc Kleine-Budde
@ 2015-03-09 14:45 ` Marc Kleine-Budde
  2015-03-09 14:49   ` Marc Kleine-Budde
  2015-03-10 10:09 ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-03-09 14:45 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 910 bytes --]

On 03/09/2015 03:45 PM, Marc Kleine-Budde wrote:
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  include/param.h | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/include/param.h b/include/param.h
> index 53bee541100e..bd2c0789968a 100644
> --- a/include/param.h
> +++ b/include/param.h
> @@ -97,7 +97,7 @@ static inline struct param_d *dev_add_param(struct device_d *dev, char *name,
>  		const char *(*get)(struct device_d *, struct param_d *p),
>  		unsigned long flags)
>  {
> -	return 0;
> +	return ERR_PTR(-ENOSYS);

Doh!

I'll send a v2.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL
  2015-03-09 14:45 ` Marc Kleine-Budde
@ 2015-03-09 14:49   ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-03-09 14:49 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1046 bytes --]

On 03/09/2015 03:45 PM, Marc Kleine-Budde wrote:
> On 03/09/2015 03:45 PM, Marc Kleine-Budde wrote:
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>>  include/param.h | 18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/include/param.h b/include/param.h
>> index 53bee541100e..bd2c0789968a 100644
>> --- a/include/param.h
>> +++ b/include/param.h
>> @@ -97,7 +97,7 @@ static inline struct param_d *dev_add_param(struct device_d *dev, char *name,
>>  		const char *(*get)(struct device_d *, struct param_d *p),
>>  		unsigned long flags)
>>  {
>> -	return 0;
>> +	return ERR_PTR(-ENOSYS);

The function returned a plain integer 0 instead of a NULL pointer, so
this patch is correct.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL
  2015-03-09 14:45 [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL Marc Kleine-Budde
  2015-03-09 14:45 ` Marc Kleine-Budde
@ 2015-03-10 10:09 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-03-10 10:09 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: barebox

On Mon, Mar 09, 2015 at 03:45:04PM +0100, Marc Kleine-Budde wrote:
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  include/param.h | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-03-10 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 14:45 [PATCH] paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL Marc Kleine-Budde
2015-03-09 14:45 ` Marc Kleine-Budde
2015-03-09 14:49   ` Marc Kleine-Budde
2015-03-10 10:09 ` Sascha Hauer

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