[nfs:linux-next 63/74] arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
head:   86bbd7422ae6a33735df6846fd685e46686da714
commit: 571ed1fd2390f74e4c1f46994f753fb0d29285e4 [63/74] SUNRPC: Replace krb5_seq_lock with a lockless scheme
config: i386-randconfig-c0-10240738 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 571ed1fd2390f74e4c1f46994f753fb0d29285e4
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: the nfs/linux-next HEAD 86bbd7422ae6a33735df6846fd685e46686da714 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
   Cyclomatic Complexity 4 include/linux/string.h:memcpy
   Cyclomatic Complexity 3 net/sunrpc/auth_gss/gss_krb5_seal.c:setup_token_v2
   Cyclomatic Complexity 1 net/sunrpc/auth_gss/gss_krb5_seal.c:setup_token
   Cyclomatic Complexity 2 net/sunrpc/auth_gss/gss_krb5_seal.c:gss_seq_send_fetch_and_inc
   Cyclomatic Complexity 6 net/sunrpc/auth_gss/gss_krb5_seal.c:gss_get_mic_v1
   Cyclomatic Complexity 2 net/sunrpc/auth_gss/gss_krb5_seal.c:gss_seq_send64_fetch_and_inc
   In file included from arch/x86/include/asm/atomic.h:8:0,
                    from include/linux/atomic.h:7,
                    from arch/x86/include/asm/thread_info.h:54,
                    from include/linux/thread_info.h:38,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/jiffies.h:9,
                    from net/sunrpc/auth_gss/gss_krb5_seal.c:62:
   net/sunrpc/auth_gss/gss_krb5_seal.c: In function 'gss_seq_send64_fetch_and_inc':
   arch/x86/include/asm/cmpxchg.h:130:2: warning: '__ret' is used uninitialized in this function [-Wuninitialized]
     __ret;        \
     ^~~~~
   arch/x86/include/asm/cmpxchg.h:87:21: note: '__ret' was declared here
     __typeof__(*(ptr)) __ret;     \
                        ^
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc/auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~
   Cyclomatic Complexity 4 net/sunrpc/auth_gss/gss_krb5_seal.c:gss_get_mic_v2
   Cyclomatic Complexity 2 net/sunrpc/auth_gss/gss_krb5_seal.c:gss_get_mic_kerberos
>> arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg
      __cmpxchg_wrong_size();     \
      ^~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc/auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~
   In function 'gss_seq_send64_fetch_and_inc',
       inlined from 'gss_get_mic_v2' at net/sunrpc/auth_gss/gss_krb5_seal.c:207:18,
       inlined from 'gss_get_mic_kerberos' at net/sunrpc/auth_gss/gss_krb5_seal.c:244:10:
>> arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg
      __cmpxchg_wrong_size();     \
      ^~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc/auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~
--
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
   Cyclomatic Complexity 4 include/linux/string.h:memcpy
   Cyclomatic Complexity 3 net/sunrpc//auth_gss/gss_krb5_seal.c:setup_token_v2
   Cyclomatic Complexity 1 net/sunrpc//auth_gss/gss_krb5_seal.c:setup_token
   Cyclomatic Complexity 2 net/sunrpc//auth_gss/gss_krb5_seal.c:gss_seq_send_fetch_and_inc
   Cyclomatic Complexity 6 net/sunrpc//auth_gss/gss_krb5_seal.c:gss_get_mic_v1
   Cyclomatic Complexity 2 net/sunrpc//auth_gss/gss_krb5_seal.c:gss_seq_send64_fetch_and_inc
   In file included from arch/x86/include/asm/atomic.h:8:0,
                    from include/linux/atomic.h:7,
                    from arch/x86/include/asm/thread_info.h:54,
                    from include/linux/thread_info.h:38,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:81,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/jiffies.h:9,
                    from net/sunrpc//auth_gss/gss_krb5_seal.c:62:
   net/sunrpc//auth_gss/gss_krb5_seal.c: In function 'gss_seq_send64_fetch_and_inc':
   arch/x86/include/asm/cmpxchg.h:130:2: warning: '__ret' is used uninitialized in this function [-Wuninitialized]
     __ret;        \
     ^~~~~
   arch/x86/include/asm/cmpxchg.h:87:21: note: '__ret' was declared here
     __typeof__(*(ptr)) __ret;     \
                        ^
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc//auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~
   Cyclomatic Complexity 4 net/sunrpc//auth_gss/gss_krb5_seal.c:gss_get_mic_v2
   Cyclomatic Complexity 2 net/sunrpc//auth_gss/gss_krb5_seal.c:gss_get_mic_kerberos
>> arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg
      __cmpxchg_wrong_size();     \
      ^~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc//auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~
   In function 'gss_seq_send64_fetch_and_inc',
       inlined from 'gss_get_mic_v2' at net/sunrpc//auth_gss/gss_krb5_seal.c:207:18,
       inlined from 'gss_get_mic_kerberos' at net/sunrpc//auth_gss/gss_krb5_seal.c:244:10:
>> arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg
      __cmpxchg_wrong_size();     \
      ^~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:134:2: note: in expansion of macro '__raw_cmpxchg'
     __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
     ^~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:149:2: note: in expansion of macro '__cmpxchg'
     __cmpxchg(ptr, old, new, sizeof(*(ptr)))
     ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:422:2: note: in expansion of macro 'arch_cmpxchg'
     arch_cmpxchg(__ai_ptr, (old), (new));    \
     ^~~~~~~~~~~~
   net/sunrpc//auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
      seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
                 ^~~~~~~

vim +/__cmpxchg_wrong_size +128 arch/x86/include/asm/cmpxchg.h

e9826380d Jeremy Fitzhardinge 2011-08-18   79  
e9826380d Jeremy Fitzhardinge 2011-08-18   80  /*
e9826380d Jeremy Fitzhardinge 2011-08-18   81   * Atomic compare and exchange.  Compare OLD with MEM, if identical,
e9826380d Jeremy Fitzhardinge 2011-08-18   82   * store NEW in MEM.  Return the initial value in MEM.  Success is
e9826380d Jeremy Fitzhardinge 2011-08-18   83   * indicated by comparing RETURN with OLD.
e9826380d Jeremy Fitzhardinge 2011-08-18   84   */
e9826380d Jeremy Fitzhardinge 2011-08-18   85  #define __raw_cmpxchg(ptr, old, new, size, lock)			\
e9826380d Jeremy Fitzhardinge 2011-08-18   86  ({									\
e9826380d Jeremy Fitzhardinge 2011-08-18   87  	__typeof__(*(ptr)) __ret;					\
e9826380d Jeremy Fitzhardinge 2011-08-18   88  	__typeof__(*(ptr)) __old = (old);				\
e9826380d Jeremy Fitzhardinge 2011-08-18   89  	__typeof__(*(ptr)) __new = (new);				\
e9826380d Jeremy Fitzhardinge 2011-08-18   90  	switch (size) {							\
e9826380d Jeremy Fitzhardinge 2011-08-18   91  	case __X86_CASE_B:						\
e9826380d Jeremy Fitzhardinge 2011-08-18   92  	{								\
e9826380d Jeremy Fitzhardinge 2011-08-18   93  		volatile u8 *__ptr = (volatile u8 *)(ptr);		\
e9826380d Jeremy Fitzhardinge 2011-08-18   94  		asm volatile(lock "cmpxchgb %2,%1"			\
e9826380d Jeremy Fitzhardinge 2011-08-18   95  			     : "=a" (__ret), "+m" (*__ptr)		\
e9826380d Jeremy Fitzhardinge 2011-08-18   96  			     : "q" (__new), "0" (__old)			\
e9826380d Jeremy Fitzhardinge 2011-08-18   97  			     : "memory");				\
e9826380d Jeremy Fitzhardinge 2011-08-18   98  		break;							\
e9826380d Jeremy Fitzhardinge 2011-08-18   99  	}								\
e9826380d Jeremy Fitzhardinge 2011-08-18  100  	case __X86_CASE_W:						\
e9826380d Jeremy Fitzhardinge 2011-08-18  101  	{								\
e9826380d Jeremy Fitzhardinge 2011-08-18  102  		volatile u16 *__ptr = (volatile u16 *)(ptr);		\
e9826380d Jeremy Fitzhardinge 2011-08-18  103  		asm volatile(lock "cmpxchgw %2,%1"			\
e9826380d Jeremy Fitzhardinge 2011-08-18  104  			     : "=a" (__ret), "+m" (*__ptr)		\
e9826380d Jeremy Fitzhardinge 2011-08-18  105  			     : "r" (__new), "0" (__old)			\
e9826380d Jeremy Fitzhardinge 2011-08-18  106  			     : "memory");				\
e9826380d Jeremy Fitzhardinge 2011-08-18  107  		break;							\
e9826380d Jeremy Fitzhardinge 2011-08-18  108  	}								\
e9826380d Jeremy Fitzhardinge 2011-08-18  109  	case __X86_CASE_L:						\
e9826380d Jeremy Fitzhardinge 2011-08-18  110  	{								\
e9826380d Jeremy Fitzhardinge 2011-08-18  111  		volatile u32 *__ptr = (volatile u32 *)(ptr);		\
e9826380d Jeremy Fitzhardinge 2011-08-18  112  		asm volatile(lock "cmpxchgl %2,%1"			\
e9826380d Jeremy Fitzhardinge 2011-08-18  113  			     : "=a" (__ret), "+m" (*__ptr)		\
e9826380d Jeremy Fitzhardinge 2011-08-18  114  			     : "r" (__new), "0" (__old)			\
e9826380d Jeremy Fitzhardinge 2011-08-18  115  			     : "memory");				\
e9826380d Jeremy Fitzhardinge 2011-08-18  116  		break;							\
e9826380d Jeremy Fitzhardinge 2011-08-18  117  	}								\
e9826380d Jeremy Fitzhardinge 2011-08-18  118  	case __X86_CASE_Q:						\
e9826380d Jeremy Fitzhardinge 2011-08-18  119  	{								\
e9826380d Jeremy Fitzhardinge 2011-08-18  120  		volatile u64 *__ptr = (volatile u64 *)(ptr);		\
e9826380d Jeremy Fitzhardinge 2011-08-18  121  		asm volatile(lock "cmpxchgq %2,%1"			\
e9826380d Jeremy Fitzhardinge 2011-08-18  122  			     : "=a" (__ret), "+m" (*__ptr)		\
e9826380d Jeremy Fitzhardinge 2011-08-18  123  			     : "r" (__new), "0" (__old)			\
e9826380d Jeremy Fitzhardinge 2011-08-18  124  			     : "memory");				\
e9826380d Jeremy Fitzhardinge 2011-08-18  125  		break;							\
e9826380d Jeremy Fitzhardinge 2011-08-18  126  	}								\
e9826380d Jeremy Fitzhardinge 2011-08-18  127  	default:							\
e9826380d Jeremy Fitzhardinge 2011-08-18 @128  		__cmpxchg_wrong_size();					\
e9826380d Jeremy Fitzhardinge 2011-08-18  129  	}								\
e9826380d Jeremy Fitzhardinge 2011-08-18  130  	__ret;								\
e9826380d Jeremy Fitzhardinge 2011-08-18  131  })
e9826380d Jeremy Fitzhardinge 2011-08-18  132  

:::::: The code at line 128 was first introduced by commit
:::::: e9826380d83d1bda3ee5663bf3fa4667a6fbe60a x86, cmpxchg: Unify cmpxchg into cmpxchg.h

:::::: TO: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
:::::: CC: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux