public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: kernel test robot <lkp@intel.com>, Vinod Koul <vkoul@kernel.org>
Cc: <kbuild-all@lists.01.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 8892/10852] include/linux/compiler_types.h:354:45: error: call to '__compiletime_assert_274' declared with attribute error: FIELD_PREP: mask is not constant
Date: Wed, 28 Sep 2022 14:56:44 +0800	[thread overview]
Message-ID: <d46db49e79ea243dfc6ca81088bc9d11db6decfc.camel@mediatek.com> (raw)
In-Reply-To: <202209280945.7nshWUEK-lkp@intel.com>

Hi Vinod,

On Wed, 2022-09-28 at 09:38 +0800, kernel test robot wrote:
> tree:   
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git__;!!CTRNKA9wMg0ARbw!1QxZihNN3yCxrrmBJq8YLUep_3bHBb2rBGHOuNdinUSmSa7DEzMgOSwHIkRajBJAOc5p$
>   master
> head:   1bd8b75fe6adeaa89d02968bdd811ffe708cf839
> commit: c221baa355483548fb01456442615a838e66aec6 [8892/10852] phy:
> mediatek: xsphy: remove macros used to prepare bitfield value
> config: arc-randconfig-r043-20220926
> compiler: arc-elf-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
>         wget 
> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!1QxZihNN3yCxrrmBJq8YLUep_3bHBb2rBGHOuNdinUSmSa7DEzMgOSwHIkRajP__aj3D$
>   -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # 
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c221baa355483548fb01456442615a838e66aec6__;!!CTRNKA9wMg0ARbw!1QxZihNN3yCxrrmBJq8YLUep_3bHBb2rBGHOuNdinUSmSa7DEzMgOSwHIkRajBXTW0iT$
>  
>         git remote add linux-next 
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git__;!!CTRNKA9wMg0ARbw!1QxZihNN3yCxrrmBJq8YLUep_3bHBb2rBGHOuNdinUSmSa7DEzMgOSwHIkRajBJAOc5p$
>  
>         git fetch --no-tags linux-next master
>         git checkout c221baa355483548fb01456442615a838e66aec6
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0
> make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from <command-line>:
>    drivers/phy/mediatek/phy-mtk-io.h: In function
> 'mtk_phy_update_field':
> > > include/linux/compiler_types.h:354:45: error: call to
> > > '__compiletime_assert_274' declared with attribute error:
> > > FIELD_PREP: mask is not constant
> 
>      354 |         _compiletime_assert(condition, msg,
> __compiletime_assert_, __COUNTER__)
>          |                                             ^
>    include/linux/compiler_types.h:335:25: note: in definition of
> macro '__compiletime_assert'
>      335 |                         prefix ##
> suffix();                             \
>          |                         ^~~~~~
>    include/linux/compiler_types.h:354:9: note: in expansion of macro
> '_compiletime_assert'
>      354 |         _compiletime_assert(condition, msg,
> __compiletime_assert_, __COUNTER__)
>          |         ^~~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:39:37: note: in expansion of macro
> 'compiletime_assert'
>       39 | #define BUILD_BUG_ON_MSG(cond, msg)
> compiletime_assert(!(cond), msg)
>          |                                     ^~~~~~~~~~~~~~~~~~
>    include/linux/bitfield.h:65:17: note: in expansion of macro
> 'BUILD_BUG_ON_MSG'
>       65
> |                 BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),     
>      \
>          |                 ^~~~~~~~~~~~~~~~
>    include/linux/bitfield.h:114:17: note: in expansion of macro
> '__BF_FIELD_CHECK'
>      114 |                 __BF_FIELD_CHECK(_mask, 0ULL, _val,
> "FIELD_PREP: ");    \
>          |                 ^~~~~~~~~~~~~~~~
>    drivers/phy/mediatek/phy-mtk-io.h:42:40: note: in expansion of
> macro 'FIELD_PREP'
>       42 |         mtk_phy_update_bits(reg, mask, FIELD_PREP(mask,
> val));
>          |                                        ^~~~~~~~~~
> 
> 
> vim +/__compiletime_assert_274 +354 include/linux/compiler_types.h
> 
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  340  
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  341  #define
> _compiletime_assert(condition, msg, prefix, suffix) \
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  342  	__compiletime_assert(co
> ndition, msg, prefix, suffix)
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  343  
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  344  /**
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  345   * compiletime_assert -
> break build and emit msg if condition is false
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  346   * @condition: a compile-
> time constant condition to check
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  347   * @msg:       a message
> to emit if condition is false
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  348   *
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  349   * In tradition of POSIX
> assert, this macro will break the build if the
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  350   * supplied condition is
> *false*, emitting the supplied error message if the
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  351   * compiler has support
> to do so.
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  352   */
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  353  #define
> compiletime_assert(condition, msg) \
> eb5c2d4b45e3d2 Will Deacon 2020-07-21 @354  	_compiletime_assert(con
> dition, msg, __compiletime_assert_, __COUNTER__)
> eb5c2d4b45e3d2 Will Deacon 2020-07-21  355  
> 
> :::::: The code at line 354 was first introduced by commit
> :::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move
> compiletime_assert() macros into compiler_types.h
> 
> :::::: TO: Will Deacon <will@kernel.org>
> :::::: CC: Will Deacon <will@kernel.org>
> 
Maybe my local compiler's parameter is not right, I don't encounter
this warning when test it.

Already sent out a fixed patch:

[next] phy: mediatek: fix build warning of FIELD_PREP()

https://patchwork.kernel.org/project/linux-mediatek/patch/20220926023750.21183-1-chunfeng.yun@mediatek.com/






      reply	other threads:[~2022-09-28  7:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  1:38 [linux-next:master 8892/10852] include/linux/compiler_types.h:354:45: error: call to '__compiletime_assert_274' declared with attribute error: FIELD_PREP: mask is not constant kernel test robot
2022-09-28  6:56 ` Chunfeng Yun [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=d46db49e79ea243dfc6ca81088bc9d11db6decfc.camel@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=vkoul@kernel.org \
    /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