I am also agree with Arnd Bergmann. We should use 'static inline function'
instead of macro to deal with error check.
On Tuesday 26 July 2016 05:09 PM, Arnd Bergmann wrote:
On Saturday, July 23, 2016 11:35:51 PM CEST Arvind Yadav wrote:
diff --git a/include/linux/err.h b/include/linux/err.h
ind
On Saturday, July 23, 2016 11:35:51 PM CEST Arvind Yadav wrote:
> diff --git a/include/linux/err.h b/include/linux/err.h
> index 1e35588..a42f942 100644
> --- a/include/linux/err.h
> +++ b/include/linux/err.h
> @@ -19,6 +19,7 @@
> #ifndef __ASSEMBLY__
>
> #define IS_ERR_VALUE(x) unlikely((unsig
From: Arvind Yadav
> Sent: 23 July 2016 19:06
> IS_ERR_VALUE() assumes that its parameter is an unsigned long.
> It can not be used to check if an 'unsigned int' reflects an error.
> As they pass an 'unsigned int' into a function that takes an
> 'unsigned long' argument. This happens to work becaus
From: Arvind Yadav
Date: Sat, 23 Jul 2016 23:35:51 +0530
> However, anything that passes an 'unsigned short' or 'unsigned int'
> argument into IS_ERR_VALUE() is guaranteed to be broken, as are
> 8-bit integers and types that are wider than 'unsigned long'.
...
> Passing value in IS_ERR_VALUE() i
IS_ERR_VALUE() assumes that its parameter is an unsigned long.
It can not be used to check if an 'unsigned int' reflects an error.
As they pass an 'unsigned int' into a function that takes an
'unsigned long' argument. This happens to work because the type
is sign-extended on 64-bit architectures be