[hwmon:hwmon-next 3/20] include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'

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

 



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@xxxxxxxxx>

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@xxxxxxxxxxxxx>
:::::: CC: Kalle Valo <kvalo@xxxxxxxxxxxxxx>

---
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]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux