Linux SNPS ARC Archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-snps-arc@lists.infradead.org
Subject: Re: [linux-next:master 4535/6266] arch/arc/include/asm/cmpxchg.h:73:27: error: implicit declaration of function 'cmpxchg_emu_u8'
Date: Tue, 30 Apr 2024 10:54:59 -0700	[thread overview]
Message-ID: <15ae9a2f-a7dc-4b39-b7f7-9268d7163031@paulmck-laptop> (raw)
In-Reply-To: <202404160503.zFIp77TO-lkp@intel.com>

On Tue, Apr 16, 2024 at 05:07:03AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   6bd343537461b57f3efe5dfc5fc193a232dfef1e
> commit: d4f26ed66a53be57567bf71d60e80a116cec34e1 [4535/6266] ARC: Emulate one-byte cmpxchg
> config: arc-randconfig-r016-20230816 (https://download.01.org/0day-ci/archive/20240416/202404160503.zFIp77TO-lkp@intel.com/config)
> compiler: arceb-elf-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240416/202404160503.zFIp77TO-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202404160503.zFIp77TO-lkp@intel.com/

I might be suffering a failure of imagination, but I am not seeing how
my change could result in these diagnostics.  Please let me know what
I am missing!

							Thanx, Paul

> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/bitops.h:68,
>                     from include/linux/log2.h:12,
>                     from kernel/bounds.c:13:
>    arch/arc/include/asm/bitops.h: In function '__fls':
>    arch/arc/include/asm/bitops.h:137:17: error: implicit declaration of function '__builtin_arc_fls'; did you mean '__builtin_arc_flag'? [-Werror=implicit-function-declaration]
>      137 |         return  __builtin_arc_fls(x);
>          |                 ^~~~~~~~~~~~~~~~~
>          |                 __builtin_arc_flag
>    In file included from arch/arc/include/asm/atomic.h:31,
>                     from include/linux/atomic.h:7,
>                     from include/asm-generic/bitops/lock.h:5,
>                     from arch/arc/include/asm/bitops.h:188:
>    arch/arc/include/asm/atomic64-arcv2.h: At top level:
>    arch/arc/include/asm/atomic64-arcv2.h:13:3: error: conflicting types for 'atomic64_t'; have 'struct <anonymous>'
>       13 | } atomic64_t;
>          |   ^~~~~~~~~~
>    In file included from include/linux/page-flags.h:9,
>                     from kernel/bounds.c:10:
>    include/linux/types.h:184:3: note: previous declaration of 'atomic64_t' with type 'atomic64_t'
>      184 | } atomic64_t;
>          |   ^~~~~~~~~~
>    In file included from arch/arc/include/asm/atomic.h:13:
>    include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic_cmpxchg':
> >> arch/arc/include/asm/cmpxchg.h:73:27: error: implicit declaration of function 'cmpxchg_emu_u8' [-Werror=implicit-function-declaration]
>       73 |                 __flags = cmpxchg_emu_u8((volatile u8 *)_p_, _o_, _n_); \
>          |                           ^~~~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
>       55 | #define raw_cmpxchg arch_cmpxchg
>          |                     ^~~~~~~~~~~~
>    include/linux/atomic/atomic-arch-fallback.h:2026:16: note: in expansion of macro 'raw_cmpxchg'
>     2026 |         return raw_cmpxchg(&v->counter, old, new);
>          |                ^~~~~~~~~~~
>    In file included from arch/arc/include/uapi/asm/byteorder.h:14,
>                     from include/asm-generic/bitops/le.h:6,
>                     from arch/arc/include/asm/bitops.h:192:
>    include/linux/byteorder/big_endian.h: At top level:
>    include/linux/byteorder/big_endian.h:8:2: warning: #warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN [-Wcpp]
>        8 | #warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN
>          |  ^~~~~~~
>    cc1: some warnings being treated as errors
>    make[3]: *** [scripts/Makefile.build:117: kernel/bounds.s] Error 1
>    make[3]: Target 'prepare' not remade because of errors.
>    make[2]: *** [Makefile:1197: prepare0] Error 2
>    make[2]: Target 'prepare' not remade because of errors.
>    make[1]: *** [Makefile:240: __sub-make] Error 2
>    make[1]: Target 'prepare' not remade because of errors.
>    make: *** [Makefile:240: __sub-make] Error 2
>    make: Target 'prepare' not remade because of errors.
> 
> 
> vim +/cmpxchg_emu_u8 +73 arch/arc/include/asm/cmpxchg.h
> 
>     62	
>     63	#define arch_cmpxchg(ptr, old, new)				        \
>     64	({									\
>     65		volatile __typeof__(ptr) _p_ = (ptr);				\
>     66		__typeof__(*(ptr)) _o_ = (old);					\
>     67		__typeof__(*(ptr)) _n_ = (new);					\
>     68		__typeof__(*(ptr)) _prev_;					\
>     69		unsigned long __flags;						\
>     70										\
>     71		switch(sizeof((_p_))) {						\
>     72		case 1:								\
>   > 73			__flags = cmpxchg_emu_u8((volatile u8 *)_p_, _o_, _n_);	\
>     74			_prev_ = (__typeof__(*(ptr)))__flags;			\
>     75			break;							\
>     76			break;							\
>     77		case 4:								\
>     78			/*							\
>     79			 * spin lock/unlock provide the needed smp_mb()		\
>     80			 * before/after						\
>     81			 */							\
>     82			atomic_ops_lock(__flags);				\
>     83			_prev_ = *_p_;						\
>     84			if (_prev_ == _o_)					\
>     85				*_p_ = _n_;					\
>     86			atomic_ops_unlock(__flags);				\
>     87			break;							\
>     88		default:							\
>     89			BUILD_BUG();						\
>     90		}								\
>     91										\
>     92		_prev_;								\
>     93	})
>     94	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

      reply	other threads:[~2024-04-30 17:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 21:07 [linux-next:master 4535/6266] arch/arc/include/asm/cmpxchg.h:73:27: error: implicit declaration of function 'cmpxchg_emu_u8' kernel test robot
2024-04-30 17:54 ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15ae9a2f-a7dc-4b39-b7f7-9268d7163031@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).