Linux-Hwmon Archive on lore.kernel.org
 help / Atom feed
From: kbuild test robot <lkp@intel.com>
To: "Adamski, Krzysztof (Nokia - PL/Wroclaw)"  <krzysztof.adamski@nokia.com>
Cc: kbuild-all@01.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>
Subject: [hwmon:hwmon-next 3/20] include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
Date: Wed, 12 Jun 2019 21:35:12 +0800
Message-ID: <201906122106.nCVpleND%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 20024 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   de262494be7aeadd6490141882abead884c0c06f
commit: 82f1bdf369ce46f4baf26e3f15cfb161b945604e [3/20] hwmon: (pmbus/adm1275) support PMBUS_VIRT_*_SAMPLES
config: x86_64-randconfig-a0-06121911 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 82f1bdf369ce46f4baf26e3f15cfb161b945604e
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 1 include/linux/i2c.h:i2c_get_functionality
   Cyclomatic Complexity 1 include/linux/i2c.h:i2c_check_functionality
   Cyclomatic Complexity 7 drivers/hwmon/pmbus/adm1275.c:adm1275_write_pmon_config
   Cyclomatic Complexity 144 drivers/hwmon/pmbus/adm1275.c:adm1275_write_word_data
   Cyclomatic Complexity 19 drivers/hwmon/pmbus/adm1275.c:adm1275_read_byte_data
   Cyclomatic Complexity 5 drivers/hwmon/pmbus/adm1275.c:adm1275_read_pmon_config
   Cyclomatic Complexity 32 drivers/hwmon/pmbus/adm1275.c:adm1275_read_word_data
   Cyclomatic Complexity 1 include/linux/device.h:devm_kzalloc
   Cyclomatic Complexity 2 include/linux/of.h:of_property_read_u32_array
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_u32
   Cyclomatic Complexity 57 drivers/hwmon/pmbus/adm1275.c:adm1275_probe
   Cyclomatic Complexity 1 drivers/hwmon/pmbus/adm1275.c:adm1275_driver_init
   Cyclomatic Complexity 1 drivers/hwmon/pmbus/adm1275.c:adm1275_driver_exit
   Cyclomatic Complexity 1 drivers/hwmon/pmbus/adm1275.c:_GLOBAL__sub_I_00100_0_adm1275.c
   Cyclomatic Complexity 1 drivers/hwmon/pmbus/adm1275.c:_GLOBAL__sub_D_00100_1_adm1275.c
   In file included from include/linux/export.h:45:0,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from drivers/hwmon/pmbus/adm1275.c:10:
   drivers/hwmon/pmbus/adm1275.c: In function 'adm1275_write_pmon_config':
>> include/linux/compiler.h:345:38: error: call to '__compiletime_assert_184' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),  \
      ^~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
      ^~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/adm1275.c:184:9: note: in expansion of macro 'FIELD_PREP'
     word = FIELD_PREP(mask, word) | (ret & ~mask);
            ^~~~~~~~~~
>> include/linux/compiler.h:345:38: error: call to '__compiletime_assert_184' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
>> include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
     ^~~~~~~~~~~~
>> include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
      __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +   \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
      ^~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/adm1275.c:184:9: note: in expansion of macro 'FIELD_PREP'
     word = FIELD_PREP(mask, word) | (ret & ~mask);
            ^~~~~~~~~~
   drivers/hwmon/pmbus/adm1275.c: In function 'adm1275_read_pmon_config':
   include/linux/compiler.h:345:38: error: call to '__compiletime_assert_172' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),  \
      ^~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
      ^~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/adm1275.c:172:9: note: in expansion of macro 'FIELD_GET'
     return FIELD_GET(mask, (u16)ret);
            ^~~~~~~~~
   include/linux/compiler.h:345:38: error: call to '__compiletime_assert_172' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
>> include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
     ^~~~~~~~~~~~
>> include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
      __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +   \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
      ^~~~~~~~~~~~~~~~
>> drivers/hwmon/pmbus/adm1275.c:172:9: note: in expansion of macro 'FIELD_GET'
     return FIELD_GET(mask, (u16)ret);
            ^~~~~~~~~
--
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 1 include/linux/i2c.h:i2c_get_functionality
   Cyclomatic Complexity 1 include/linux/i2c.h:i2c_check_functionality
   Cyclomatic Complexity 7 drivers/hwmon//pmbus/adm1275.c:adm1275_write_pmon_config
   Cyclomatic Complexity 144 drivers/hwmon//pmbus/adm1275.c:adm1275_write_word_data
   Cyclomatic Complexity 19 drivers/hwmon//pmbus/adm1275.c:adm1275_read_byte_data
   Cyclomatic Complexity 5 drivers/hwmon//pmbus/adm1275.c:adm1275_read_pmon_config
   Cyclomatic Complexity 32 drivers/hwmon//pmbus/adm1275.c:adm1275_read_word_data
   Cyclomatic Complexity 1 include/linux/device.h:devm_kzalloc
   Cyclomatic Complexity 2 include/linux/of.h:of_property_read_u32_array
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_u32
   Cyclomatic Complexity 57 drivers/hwmon//pmbus/adm1275.c:adm1275_probe
   Cyclomatic Complexity 1 drivers/hwmon//pmbus/adm1275.c:adm1275_driver_init
   Cyclomatic Complexity 1 drivers/hwmon//pmbus/adm1275.c:adm1275_driver_exit
   Cyclomatic Complexity 1 drivers/hwmon//pmbus/adm1275.c:_GLOBAL__sub_I_00100_0_adm1275.c
   Cyclomatic Complexity 1 drivers/hwmon//pmbus/adm1275.c:_GLOBAL__sub_D_00100_1_adm1275.c
   In file included from include/linux/export.h:45:0,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from drivers/hwmon//pmbus/adm1275.c:10:
   drivers/hwmon//pmbus/adm1275.c: In function 'adm1275_write_pmon_config':
>> include/linux/compiler.h:345:38: error: call to '__compiletime_assert_184' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),  \
      ^~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
      ^~~~~~~~~~~~~~~~
   drivers/hwmon//pmbus/adm1275.c:184:9: note: in expansion of macro 'FIELD_PREP'
     word = FIELD_PREP(mask, word) | (ret & ~mask);
            ^~~~~~~~~~
>> include/linux/compiler.h:345:38: error: call to '__compiletime_assert_184' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
>> include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
     ^~~~~~~~~~~~
>> include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
      __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +   \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
      ^~~~~~~~~~~~~~~~
   drivers/hwmon//pmbus/adm1275.c:184:9: note: in expansion of macro 'FIELD_PREP'
     word = FIELD_PREP(mask, word) | (ret & ~mask);
            ^~~~~~~~~~
   drivers/hwmon//pmbus/adm1275.c: In function 'adm1275_read_pmon_config':
   include/linux/compiler.h:345:38: error: call to '__compiletime_assert_172' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
>> include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),  \
      ^~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
      ^~~~~~~~~~~~~~~~
   drivers/hwmon//pmbus/adm1275.c:172:9: note: in expansion of macro 'FIELD_GET'
     return FIELD_GET(mask, (u16)ret);
            ^~~~~~~~~
   include/linux/compiler.h:345:38: error: call to '__compiletime_assert_172' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:326:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:345:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^~~~~~~~~~~~~~~~
>> include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
     ^~~~~~~~~~~~
>> include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
      __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +   \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:3: note: in expansion of macro '__BF_FIELD_CHECK'
      __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
      ^~~~~~~~~~~~~~~~
   drivers/hwmon//pmbus/adm1275.c:172:9: note: in expansion of macro 'FIELD_GET'
     return FIELD_GET(mask, (u16)ret);
            ^~~~~~~~~

vim +/BUILD_BUG_ON_MSG +46 include/linux/bitfield.h

3e9b3112 Jakub Kicinski 2016-08-31  43  
3e9b3112 Jakub Kicinski 2016-08-31  44  #define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx)			\
3e9b3112 Jakub Kicinski 2016-08-31  45  	({								\
3e9b3112 Jakub Kicinski 2016-08-31 @46  		BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),		\
3e9b3112 Jakub Kicinski 2016-08-31  47  				 _pfx "mask is not constant");		\
e36488c8 Arnd Bergmann  2018-08-17  48  		BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero");	\
3e9b3112 Jakub Kicinski 2016-08-31  49  		BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?		\
3e9b3112 Jakub Kicinski 2016-08-31  50  				 ~((_mask) >> __bf_shf(_mask)) & (_val) : 0, \
3e9b3112 Jakub Kicinski 2016-08-31  51  				 _pfx "value too large for the field"); \
3e9b3112 Jakub Kicinski 2016-08-31  52  		BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull,		\
3e9b3112 Jakub Kicinski 2016-08-31  53  				 _pfx "type of reg too small for mask"); \
3e9b3112 Jakub Kicinski 2016-08-31 @54  		__BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +			\
3e9b3112 Jakub Kicinski 2016-08-31  55  					      (1ULL << __bf_shf(_mask))); \
3e9b3112 Jakub Kicinski 2016-08-31  56  	})
3e9b3112 Jakub Kicinski 2016-08-31  57  
3e9b3112 Jakub Kicinski 2016-08-31  58  /**
1697599e Jakub Kicinski 2017-02-09  59   * FIELD_FIT() - check if value fits in the field
1697599e Jakub Kicinski 2017-02-09  60   * @_mask: shifted mask defining the field's length and position
1697599e Jakub Kicinski 2017-02-09  61   * @_val:  value to test against the field
1697599e Jakub Kicinski 2017-02-09  62   *
1697599e Jakub Kicinski 2017-02-09  63   * Return: true if @_val can fit inside @_mask, false if @_val is too big.
1697599e Jakub Kicinski 2017-02-09  64   */
1697599e Jakub Kicinski 2017-02-09  65  #define FIELD_FIT(_mask, _val)						\
1697599e Jakub Kicinski 2017-02-09  66  	({								\
1697599e Jakub Kicinski 2017-02-09  67  		__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_FIT: ");	\
1697599e Jakub Kicinski 2017-02-09  68  		!((((typeof(_mask))_val) << __bf_shf(_mask)) & ~(_mask)); \
1697599e Jakub Kicinski 2017-02-09  69  	})
1697599e Jakub Kicinski 2017-02-09  70  
1697599e Jakub Kicinski 2017-02-09  71  /**
3e9b3112 Jakub Kicinski 2016-08-31  72   * FIELD_PREP() - prepare a bitfield element
3e9b3112 Jakub Kicinski 2016-08-31  73   * @_mask: shifted mask defining the field's length and position
3e9b3112 Jakub Kicinski 2016-08-31  74   * @_val:  value to put in the field
3e9b3112 Jakub Kicinski 2016-08-31  75   *
3e9b3112 Jakub Kicinski 2016-08-31  76   * FIELD_PREP() masks and shifts up the value.  The result should
3e9b3112 Jakub Kicinski 2016-08-31  77   * be combined with other fields of the bitfield using logical OR.
3e9b3112 Jakub Kicinski 2016-08-31  78   */
3e9b3112 Jakub Kicinski 2016-08-31  79  #define FIELD_PREP(_mask, _val)						\
3e9b3112 Jakub Kicinski 2016-08-31  80  	({								\
3e9b3112 Jakub Kicinski 2016-08-31 @81  		__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");	\
3e9b3112 Jakub Kicinski 2016-08-31  82  		((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask);	\
3e9b3112 Jakub Kicinski 2016-08-31  83  	})
3e9b3112 Jakub Kicinski 2016-08-31  84  

:::::: The code at line 46 was first introduced by commit
:::::: 3e9b3112ec74f192eaab976c3889e34255cae940 add basic register-field manipulation macros

:::::: TO: Jakub Kicinski <jakub.kicinski@netronome.com>
:::::: CC: Kalle Valo <kvalo@codeaurora.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29602 bytes --]

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically 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=201906122106.nCVpleND%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=kbuild-all@01.org \
    --cc=krzysztof.adamski@nokia.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org linux-hwmon@archiver.kernel.org
	public-inbox-index linux-hwmon


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/ public-inbox