From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8879922898296732902==" MIME-Version: 1.0 From: William Breathitt Gray To: kbuild-all@lists.01.org Subject: Re: [PATCH v14 06/17] counter: Internalize sysfs interface code Date: Wed, 04 Aug 2021 10:04:32 +0900 Message-ID: In-Reply-To: <202108032313.uMQ1PVPD-lkp@intel.com> List-Id: --===============8879922898296732902== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Aug 03, 2021 at 11:11:43PM +0800, kernel test robot wrote: > Hi William, > = > I love your patch! Perhaps something to improve: > = > [auto build test WARNING on stm32/stm32-next] > [also build test WARNING on linus/master v5.14-rc4 next-20210802] > [cannot apply to linux/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/William-Breathitt-Gray/I= ntroduce-the-Counter-character-device-interface/20210803-201000 > base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git= stm32-next > config: m68k-allmodconfig (attached as .config) > compiler: m68k-linux-gcc (GCC) 10.3.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/490c9a9a44e9c680fa6658f= 0710bb81831173299 > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review William-Breathitt-Gray/Introduce= -the-Counter-character-device-interface/20210803-201000 > git checkout 490c9a9a44e9c680fa6658f0710bb81831173299 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-10.3.0 make.cro= ss ARCH=3Dm68k = > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All warnings (new ones prefixed by >>): > = > >> drivers/counter/stm32-timer-cnt.c:55:2: warning: implicit conversion f= rom 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conversi= on] > 55 | STM32_COUNT_SLAVE_MODE_DISABLED, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-timer-cnt.c:56:2: warning: implicit conversion f= rom 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conversi= on] > 56 | STM32_COUNT_ENCODER_MODE_1, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-timer-cnt.c:57:2: warning: implicit conversion f= rom 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conversi= on] > 57 | STM32_COUNT_ENCODER_MODE_2, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-timer-cnt.c:58:2: warning: implicit conversion f= rom 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conversi= on] > 58 | STM32_COUNT_ENCODER_MODE_3, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-timer-cnt.c: In function 'stm32_count_function_r= ead': > drivers/counter/stm32-timer-cnt.c:97:13: warning: implicit conversion = from 'enum stm32_count_function' to 'enum counter_function' [-Wenum-convers= ion] > 97 | *function =3D STM32_COUNT_SLAVE_MODE_DISABLED; > | ^ > drivers/counter/stm32-timer-cnt.c:100:13: warning: implicit conversion= from 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conver= sion] > 100 | *function =3D STM32_COUNT_ENCODER_MODE_1; > | ^ > drivers/counter/stm32-timer-cnt.c:103:13: warning: implicit conversion= from 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conver= sion] > 103 | *function =3D STM32_COUNT_ENCODER_MODE_2; > | ^ > drivers/counter/stm32-timer-cnt.c:106:13: warning: implicit conversion= from 'enum stm32_count_function' to 'enum counter_function' [-Wenum-conver= sion] > 106 | *function =3D STM32_COUNT_ENCODER_MODE_3; > | ^ > -- > >> drivers/counter/stm32-lptimer-cnt.c:139:2: warning: implicit conversio= n from 'enum stm32_lptim_cnt_function' to 'enum counter_function' [-Wenum-c= onversion] > 139 | STM32_LPTIM_COUNTER_INCREASE, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-lptimer-cnt.c:140:2: warning: implicit conversio= n from 'enum stm32_lptim_cnt_function' to 'enum counter_function' [-Wenum-c= onversion] > 140 | STM32_LPTIM_ENCODER_BOTH_EDGE, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/stm32-lptimer-cnt.c: In function 'stm32_lptim_cnt_func= tion_read': > drivers/counter/stm32-lptimer-cnt.c:195:13: warning: implicit conversi= on from 'enum stm32_lptim_cnt_function' to 'enum counter_function' [-Wenum-= conversion] > 195 | *function =3D STM32_LPTIM_COUNTER_INCREASE; > | ^ > drivers/counter/stm32-lptimer-cnt.c:200:13: warning: implicit conversi= on from 'enum stm32_lptim_cnt_function' to 'enum counter_function' [-Wenum-= conversion] > 200 | *function =3D STM32_LPTIM_ENCODER_BOTH_EDGE; > | ^ > -- > >> drivers/counter/ftm-quaddec.c:162:2: warning: implicit conversion from= 'enum ftm_quaddec_count_function' to 'enum counter_function' [-Wenum-conve= rsion] > 162 | FTM_QUADDEC_COUNT_ENCODER_MODE_1 > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/counter/ftm-quaddec.c: In function 'ftm_quaddec_count_function= _read': > drivers/counter/ftm-quaddec.c:199:12: warning: implicit conversion fro= m 'enum ftm_quaddec_count_function' to 'enum counter_function' [-Wenum-conv= ersion] > 199 | *function =3D FTM_QUADDEC_COUNT_ENCODER_MODE_1; > | ^ > = > = > vim +55 drivers/counter/stm32-timer-cnt.c > = > 490c9a9a44e9c6 William Breathitt Gray 2021-08-03 53 = > 490c9a9a44e9c6 William Breathitt Gray 2021-08-03 54 static const enum c= ounter_function stm32_count_functions[] =3D { > fae6f62e6a580b William Breathitt Gray 2021-02-26 @55 STM32_COUNT_SLAVE_= MODE_DISABLED, > ad29937e206f5e Benjamin Gaignard 2019-04-02 56 STM32_COUNT_ENCODE= R_MODE_1, > ad29937e206f5e Benjamin Gaignard 2019-04-02 57 STM32_COUNT_ENCODE= R_MODE_2, > ad29937e206f5e Benjamin Gaignard 2019-04-02 58 STM32_COUNT_ENCODE= R_MODE_3, > ad29937e206f5e Benjamin Gaignard 2019-04-02 59 }; > ad29937e206f5e Benjamin Gaignard 2019-04-02 60 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org These enums were meant to serve as aliases matching the device modes' namings with the hope it would make the code easier to grok. However, attempting to solve these warnings by introducing map translation functions and such is having the opposite effect: more obfuscated code is created than is avoided in the end. I think it would be best, at least for this patchset, to remove these alias enums and simplify this patch to use the enum counter_function defines directly. I'll make those simplifications for these drivers and release a v15 revision next week if no other issues arise. William Breathitt Gray --===============8879922898296732902== Content-Type: application/pgp-signature MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUVrNUk0UERKMncx Y0RmL2JnaHZwSU5kbTdWSklGQW1FSjU1WUFDZ2tRaHZwSU5kbTcKVkpLcVRCQUFqcWlhb0hHUFkv SWRCR0JVUThsZkwyejF4a293bXhWbHUxaWx4RGtEQ1RCS1kvcW9DS3FuUTdYVgpFeEZHSEEwOUJh ZWRmNWF0SEdEci9wZDEvR3QwOUROQVc0UlRMOVQrR1FBR2drc0tWSTltK2Q1KzZPUk9nb0NJCk4w UnJoNmlwSEtwOHdWSEEwdEppalhvZnI4NUZqdTVzaXl6Z3VvOXkwZFBPU3lhNnUvVXg4b3ExZWlC cm5mS3EKOEI1U0xjcStnNnE2WWNaUlhFSFpEMlFCbWVlSURzYWlEdHZrc3Y3dDJReTFpc2lJZkxW cEJZM1c2bWQzZnJBOQpRT2JRN1pzRWNRRWxjckdrcExUelBzMlNPNEJFU3BrZlQvaW1GbzZWQThy L1ZKNT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