public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/4] counter: Internalize sysfs interface code
       [not found] ` <202004301522.tS6NKxKy%lkp@intel.com>
@ 2020-04-30 13:13   ` William Breathitt Gray
  0 siblings, 0 replies; 2+ messages in thread
From: William Breathitt Gray @ 2020-04-30 13:13 UTC (permalink / raw)
  To: kbuild test robot
  Cc: jic23, kbuild-all, kamel.bouhara, gwendal, alexandre.belloni,
	david, felipe.balbi, fabien.lahoudere, linux-iio, linux-kernel,
	linux-stm32

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

On Thu, Apr 30, 2020 at 03:41:26PM +0800, kbuild test robot wrote:
> Hi William,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on stm32/stm32-next]
> [cannot apply to linus/master linux/master v5.7-rc3 next-20200429]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/William-Breathitt-Gray/Introduce-the-Counter-character-device-interface/20200430-051734
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
> config: x86_64-allyesconfig (attached as .config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/counter/stm32-lptimer-cnt.c:387:2: error: initializer element is not constant
>      stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE],
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/counter/stm32-lptimer-cnt.c:387:2: note: (near initialization for 'stm32_lptim_cnt_synapse_actions[0]')
>    drivers/counter/stm32-lptimer-cnt.c:388:2: error: initializer element is not constant
>      stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE],
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/counter/stm32-lptimer-cnt.c:388:2: note: (near initialization for 'stm32_lptim_cnt_synapse_actions[1]')
>    drivers/counter/stm32-lptimer-cnt.c:389:2: error: initializer element is not constant
>      stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES],
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/counter/stm32-lptimer-cnt.c:389:2: note: (near initialization for 'stm32_lptim_cnt_synapse_actions[2]')
>    drivers/counter/stm32-lptimer-cnt.c:390:2: error: initializer element is not constant
>      stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_NONE],
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/counter/stm32-lptimer-cnt.c:390:2: note: (near initialization for 'stm32_lptim_cnt_synapse_actions[3]')
> 
> vim +387 drivers/counter/stm32-lptimer-cnt.c
> 
>    385	
>    386	static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
>  > 387		stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE],
>    388		stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE],
>    389		stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES],
>    390		stm32_lptim_l2c_actions_map[STM32_LPTIM_SYNAPSE_ACTION_NONE],
>    391	};
>    392	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

This array must be initialized with constants. I'll fix this up in v2.

Thanks,

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/4] counter: Internalize sysfs interface code
       [not found] <d84f0bb3258d1664e90da64d75f787829c50a9bd.1588176662.git.vilhelm.gray@gmail.com>
       [not found] ` <202004301522.tS6NKxKy%lkp@intel.com>
@ 2020-05-01  8:20 ` kbuild test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2020-05-01  8:20 UTC (permalink / raw)
  To: William Breathitt Gray, jic23
  Cc: kbuild-all, kamel.bouhara, gwendal, alexandre.belloni, david,
	felipe.balbi, fabien.lahoudere, linux-iio, linux-kernel,
	linux-stm32

Hi William,

I love your patch! Perhaps something to improve:

[auto build test WARNING on stm32/stm32-next]
[cannot apply to linus/master linux/master v5.7-rc3 next-20200430]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/William-Breathitt-Gray/Introduce-the-Counter-character-device-interface/20200430-051734
base:   https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-191-gc51a0382-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> drivers/counter/104-quad-8.c:700:56: sparse: sparse: mixing different enum types:
>> drivers/counter/104-quad-8.c:700:56: sparse:    unsigned int enum counter_count_function
>> drivers/counter/104-quad-8.c:700:56: sparse:    unsigned int enum quad8_count_function
--
>> drivers/counter/stm32-lptimer-cnt.c:573:24: sparse: sparse: mixing different enum types:
>> drivers/counter/stm32-lptimer-cnt.c:573:24: sparse:    unsigned int enum counter_count_function
>> drivers/counter/stm32-lptimer-cnt.c:573:24: sparse:    unsigned int enum stm32_lptim_cnt_function

vim +700 drivers/counter/104-quad-8.c

   693	
   694	static int quad8_function_write(struct counter_device *counter,
   695					struct counter_count *count,
   696					enum counter_count_function function)
   697	{
   698		struct quad8_iio *const priv = counter->priv;
   699		const int id = count->id;
 > 700		const enum quad8_count_function cnt_function = function;
   701		unsigned int *const quadrature_mode = priv->quadrature_mode + id;
   702		unsigned int *const scale = priv->quadrature_scale + id;
   703		unsigned int mode_cfg = priv->count_mode[id] << 1;
   704		unsigned int *const synchronous_mode = priv->synchronous_mode + id;
   705		const unsigned int idr_cfg = priv->index_polarity[id] << 1;
   706		const int base_offset = priv->base + 2 * id + 1;
   707	
   708		if (cnt_function == QUAD8_COUNT_FUNCTION_PULSE_DIRECTION) {
   709			*quadrature_mode = 0;
   710	
   711			/* Quadrature scaling only available in quadrature mode */
   712			*scale = 0;
   713	
   714			/* Synchronous function not supported in non-quadrature mode */
   715			if (*synchronous_mode) {
   716				*synchronous_mode = 0;
   717				/* Disable synchronous function mode */
   718				outb(QUAD8_CTR_IDR | idr_cfg, base_offset);
   719			}
   720		} else {
   721			*quadrature_mode = 1;
   722	
   723			switch (cnt_function) {
   724			case QUAD8_COUNT_FUNCTION_QUADRATURE_X1:
   725				*scale = 0;
   726				mode_cfg |= QUAD8_CMR_QUADRATURE_X1;
   727				break;
   728			case QUAD8_COUNT_FUNCTION_QUADRATURE_X2:
   729				*scale = 1;
   730				mode_cfg |= QUAD8_CMR_QUADRATURE_X2;
   731				break;
   732			case QUAD8_COUNT_FUNCTION_QUADRATURE_X4:
   733				*scale = 2;
   734				mode_cfg |= QUAD8_CMR_QUADRATURE_X4;
   735				break;
   736			default: return -EINVAL;
   737			}
   738		}
   739	
   740		/* Load mode configuration to Counter Mode Register */
   741		outb(QUAD8_CTR_CMR | mode_cfg, base_offset);
   742	
   743		return 0;
   744	}
   745	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-01  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <d84f0bb3258d1664e90da64d75f787829c50a9bd.1588176662.git.vilhelm.gray@gmail.com>
     [not found] ` <202004301522.tS6NKxKy%lkp@intel.com>
2020-04-30 13:13   ` [PATCH 1/4] counter: Internalize sysfs interface code William Breathitt Gray
2020-05-01  8:20 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox