Re: [PATCH v10 3/5] iio: adc: Add Xilinx AMS driver

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

 



Hi Anand,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linux/master linus/master v5.16-rc1 next-20211118]
[cannot apply to xilinx-xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211118-001150
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: arc-randconfig-r035-20211118 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/196a4a5b4232a4a12d0843a0002b664720b5d200
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211118-001150
        git checkout 196a4a5b4232a4a12d0843a0002b664720b5d200
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

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

   drivers/iio/adc/xilinx-ams.c: In function 'ams_update_intrmask':
>> drivers/iio/adc/xilinx-ams.c:323:20: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
     323 |         regval = ~(FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask));
         |                    ^~~~~~~~~
   In file included from drivers/iio/adc/xilinx-ams.c:11:
>> include/linux/bits.h:35:29: warning: left shift count >= width of type [-Wshift-count-overflow]
      35 |         (((~UL(0)) - (UL(1) << (l)) + 1) & \
         |                             ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:131:41: note: in expansion of macro 'GENMASK'
     131 | #define AMS_ISR1_INTR_MASK              GENMASK(63, 32)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:323:30: note: in expansion of macro 'AMS_ISR1_INTR_MASK'
     323 |         regval = ~(FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask));
         |                              ^~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:131:41: note: in expansion of macro 'GENMASK'
     131 | #define AMS_ISR1_INTR_MASK              GENMASK(63, 32)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:323:30: note: in expansion of macro 'AMS_ISR1_INTR_MASK'
     323 |         regval = ~(FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask));
         |                              ^~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:35:29: warning: left shift count >= width of type [-Wshift-count-overflow]
      35 |         (((~UL(0)) - (UL(1) << (l)) + 1) & \
         |                             ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:131:41: note: in expansion of macro 'GENMASK'
     131 | #define AMS_ISR1_INTR_MASK              GENMASK(63, 32)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:329:28: note: in expansion of macro 'AMS_ISR1_INTR_MASK'
     329 |         regval = FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask);
         |                            ^~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:131:41: note: in expansion of macro 'GENMASK'
     131 | #define AMS_ISR1_INTR_MASK              GENMASK(63, 32)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:329:28: note: in expansion of macro 'AMS_ISR1_INTR_MASK'
     329 |         regval = FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask);
         |                            ^~~~~~~~~~~~~~~~~~
   drivers/iio/adc/xilinx-ams.c: In function 'ams_update_ps_alarm':
>> drivers/iio/adc/xilinx-ams.c:360:17: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     360 |         cfg = ~(FIELD_PREP(AMS_CONF1_ALARM_2_TO_0_MASK, val));
         |                 ^~~~~~~~~~
   In file included from drivers/iio/adc/xilinx-ams.c:11:
   drivers/iio/adc/xilinx-ams.c: In function 'ams_enable_channel_sequence':
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:102:41: note: in expansion of macro 'GENMASK'
     102 | #define AMS_PL_SEQ_MASK                 GENMASK(59, 22)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:448:39: note: in expansion of macro 'AMS_PL_SEQ_MASK'
     448 |                 scan_mask = FIELD_GET(AMS_PL_SEQ_MASK, scan_mask);
         |                                       ^~~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:99:41: note: in expansion of macro 'GENMASK'
      99 | #define AMS_REG_SEQ1_MASK               GENMASK(37, 22)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:453:36: note: in expansion of macro 'AMS_REG_SEQ1_MASK'
     453 |                 regval = FIELD_GET(AMS_REG_SEQ1_MASK, scan_mask);
         |                                    ^~~~~~~~~~~~~~~~~
   drivers/iio/adc/xilinx-ams.c: In function 'ams_init_device':
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:501:34: note: in expansion of macro 'AMS_ALARM_MASK'
     501 |         ams_update_intrmask(ams, AMS_ALARM_MASK, AMS_ALARM_MASK);
         |                                  ^~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:501:50: note: in expansion of macro 'AMS_ALARM_MASK'
     501 |         ams_update_intrmask(ams, AMS_ALARM_MASK, AMS_ALARM_MASK);
         |                                                  ^~~~~~~~~~~~~~
   drivers/iio/adc/xilinx-ams.c: In function 'ams_unmask_worker':
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:1017:35: note: in expansion of macro 'AMS_ALARM_MASK'
    1017 |         ams_update_intrmask(ams, ~AMS_ALARM_MASK, ~AMS_ALARM_MASK);
         |                                   ^~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:1017:52: note: in expansion of macro 'AMS_ALARM_MASK'
    1017 |         ams_update_intrmask(ams, ~AMS_ALARM_MASK, ~AMS_ALARM_MASK);
         |                                                    ^~~~~~~~~~~~~~
   drivers/iio/adc/xilinx-ams.c: In function 'ams_irq':
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:1049:35: note: in expansion of macro 'AMS_ALARM_MASK'
    1049 |         ams_update_intrmask(ams, ~AMS_ALARM_MASK, ~AMS_ALARM_MASK);
         |                                   ^~~~~~~~~~~~~~
>> include/linux/bits.h:36:18: warning: right shift count is negative [-Wshift-count-negative]
      36 |          (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
         |                  ^~
   include/linux/bits.h:38:38: note: in expansion of macro '__GENMASK'
      38 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |                                      ^~~~~~~~~
   drivers/iio/adc/xilinx-ams.c:124:41: note: in expansion of macro 'GENMASK'
     124 | #define AMS_ALARM_MASK                  GENMASK(63, 0)
         |                                         ^~~~~~~
   drivers/iio/adc/xilinx-ams.c:1049:52: note: in expansion of macro 'AMS_ALARM_MASK'
    1049 |         ams_update_intrmask(ams, ~AMS_ALARM_MASK, ~AMS_ALARM_MASK);
         |                                                    ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/FIELD_GET +323 drivers/iio/adc/xilinx-ams.c

   313	
   314	static void ams_update_intrmask(struct ams *ams, u64 mask, u64 val)
   315	{
   316		u32 regval;
   317	
   318		ams->intr_mask = (ams->intr_mask & ~mask) | (val & mask);
   319	
   320		regval = ~(ams->intr_mask | ams->masked_alarm);
   321		writel(regval, ams->base + AMS_IER_0);
   322	
 > 323		regval = ~(FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask));
   324		writel(regval, ams->base + AMS_IER_1);
   325	
   326		regval = ams->intr_mask | ams->masked_alarm;
   327		writel(regval, ams->base + AMS_IDR_0);
   328	
   329		regval = FIELD_GET(AMS_ISR1_INTR_MASK, ams->intr_mask);
   330		writel(regval, ams->base + AMS_IDR_1);
   331	}
   332	
   333	static void ams_disable_all_alarms(struct ams *ams)
   334	{
   335		/* disable PS module alarm */
   336		if (ams->ps_base) {
   337			ams_ps_update_reg(ams, AMS_REG_CONFIG1, AMS_REGCFG1_ALARM_MASK,
   338					  AMS_REGCFG1_ALARM_MASK);
   339			ams_ps_update_reg(ams, AMS_REG_CONFIG3, AMS_REGCFG3_ALARM_MASK,
   340					  AMS_REGCFG3_ALARM_MASK);
   341		}
   342	
   343		/* disable PL module alarm */
   344		if (ams->pl_base) {
   345			ams_pl_update_reg(ams, AMS_REG_CONFIG1,
   346					  AMS_REGCFG1_ALARM_MASK,
   347					  AMS_REGCFG1_ALARM_MASK);
   348			ams_pl_update_reg(ams, AMS_REG_CONFIG3,
   349					  AMS_REGCFG3_ALARM_MASK,
   350					  AMS_REGCFG3_ALARM_MASK);
   351		}
   352	}
   353	
   354	static void ams_update_ps_alarm(struct ams *ams, unsigned long alarm_mask)
   355	{
   356		u32 cfg;
   357		u32 val;
   358	
   359		val = FIELD_GET(AMS_ISR0_ALARM_2_TO_0_MASK, alarm_mask);
 > 360		cfg = ~(FIELD_PREP(AMS_CONF1_ALARM_2_TO_0_MASK, val));
   361	
   362		val = FIELD_GET(AMS_ISR0_ALARM_6_TO_3_MASK, alarm_mask);
   363		cfg &= ~(FIELD_PREP(AMS_CONF1_ALARM_6_TO_3_MASK, val));
   364	
   365		ams_ps_update_reg(ams, AMS_REG_CONFIG1, AMS_REGCFG1_ALARM_MASK, cfg);
   366	
   367		val = FIELD_GET(AMS_ISR0_ALARM_12_TO_7_MASK, alarm_mask);
   368		cfg = ~(FIELD_PREP(AMS_CONF1_ALARM_12_TO_7_MASK, val));
   369		ams_ps_update_reg(ams, AMS_REG_CONFIG3, AMS_REGCFG3_ALARM_MASK, cfg);
   370	}
   371	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux