lkml.org 
[lkml]   [2016]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] err.h: allow IS_ERR_VALUE to handle properly more types
Hi Andrzej,

[auto build test WARNING on v4.4-rc8]
[also build test WARNING on next-20160107]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url: https://github.com/0day-ci/linux/commits/Andrzej-Hajda/err-h-allow-IS_ERR_VALUE-to-handle-properly-more-types/20160107-230216
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from arch/x86/include/asm/processor.h:31:0,
from arch/x86/include/asm/thread_info.h:52,
from include/linux/thread_info.h:54,
from arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from drivers/staging/rtl8723au/include/osdep_service.h:22,
from drivers/staging/rtl8723au/include/rtl8723a_sreset.h:18,
from drivers/staging/rtl8723au/hal/rtl8723a_sreset.c:17:
include/linux/err.h: In function 'IS_ERR':
>> include/linux/err.h:21:42: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
#define IS_ERR_VALUE(x) ((typeof(x))(-1) < 0 \
^
>> include/linux/err.h:37:9: note: in expansion of macro 'IS_ERR_VALUE'
return IS_ERR_VALUE((unsigned long)ptr);
^
In file included from include/linux/linkage.h:4:0,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from drivers/staging/rtl8723au/include/osdep_service.h:22,
from drivers/staging/rtl8723au/include/rtl8723a_sreset.h:18,
from drivers/staging/rtl8723au/hal/rtl8723a_sreset.c:17:
include/linux/err.h:22:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
? unlikely((x) < 0) \
^
include/linux/compiler.h:166:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
>> include/linux/err.h:37:9: note: in expansion of macro 'IS_ERR_VALUE'
return IS_ERR_VALUE((unsigned long)ptr);
^
In file included from arch/x86/include/asm/processor.h:31:0,
from arch/x86/include/asm/thread_info.h:52,
from include/linux/thread_info.h:54,
from arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from drivers/staging/rtl8723au/include/osdep_service.h:22,
from drivers/staging/rtl8723au/include/rtl8723a_sreset.h:18,
from drivers/staging/rtl8723au/hal/rtl8723a_sreset.c:17:
include/linux/err.h: In function 'IS_ERR_OR_NULL':
>> include/linux/err.h:21:42: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
#define IS_ERR_VALUE(x) ((typeof(x))(-1) < 0 \
^
include/linux/err.h:42:17: note: in expansion of macro 'IS_ERR_VALUE'
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
^
In file included from include/linux/linkage.h:4:0,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from drivers/staging/rtl8723au/include/osdep_service.h:22,
from drivers/staging/rtl8723au/include/rtl8723a_sreset.h:18,
from drivers/staging/rtl8723au/hal/rtl8723a_sreset.c:17:
include/linux/err.h:22:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
? unlikely((x) < 0) \
^
include/linux/compiler.h:166:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/err.h:42:17: note: in expansion of macro 'IS_ERR_VALUE'
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
^

vim +21 include/linux/err.h

15 * error and pointer decisions.
16 */
17 #define MAX_ERRNO 4095
18
19 #ifndef __ASSEMBLY__
20
> 21 #define IS_ERR_VALUE(x) ((typeof(x))(-1) < 0 \
22 ? unlikely((x) < 0) \
23 : unlikely((x) >= (typeof(x))-MAX_ERRNO))
24
25 static inline void * __must_check ERR_PTR(long error)
26 {
27 return (void *) error;
28 }
29
30 static inline long __must_check PTR_ERR(__force const void *ptr)
31 {
32 return (long) ptr;
33 }
34
35 static inline bool __must_check IS_ERR(__force const void *ptr)
36 {
> 37 return IS_ERR_VALUE((unsigned long)ptr);
38 }
39
40 static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2016-01-07 17:21    [W:0.146 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site