Re: [PATCH v3 2/2] ASoC: codecs: cmx655: Add CML's CMX655D codec

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

 



Hi Nikola,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on robh/for-next tiwai-sound/for-next tiwai-sound/for-linus linus/master v6.14-rc1 next-20250207]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Nikola-Jelic/ASoC-codecs-cmx655-Add-CML-s-CMX655D-codec/20250208-001527
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/20250207161412.6281-2-nikola.jelic83%40gmail.com
patch subject: [PATCH v3 2/2] ASoC: codecs: cmx655: Add CML's CMX655D codec
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250209/202502090855.eWNvBLsV-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250209/202502090855.eWNvBLsV-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502090855.eWNvBLsV-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from sound/soc/codecs/cmx655.c:10:
   In file included from include/sound/soc.h:26:
   In file included from include/sound/ac97_codec.h:17:
   In file included from include/sound/pcm.h:15:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/cmx655.c:194:50: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
     194 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                       ^
     195 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:194:50: note: use '|' for a bitwise operation
     194 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                       ^~
         |                                                                       |
>> sound/soc/codecs/cmx655.c:194:19: warning: converting the result of '<<' to a boolean always evaluates to false [-Wtautological-constant-compare]
     194 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                        ^
>> sound/soc/codecs/cmx655.c:195:11: warning: converting the result of '<<' to a boolean; did you mean '(3 << (0)) != 0'? [-Wint-in-bool-context]
     195 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                                ^
   sound/soc/codecs/cmx655.c:199:50: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
     199 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                       ^
     200 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:199:50: note: use '|' for a bitwise operation
     199 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                       ^~
         |                                                                       |
   sound/soc/codecs/cmx655.c:199:19: warning: converting the result of '<<' to a boolean always evaluates to false [-Wtautological-constant-compare]
     199 |                         *pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                        ^
   sound/soc/codecs/cmx655.c:200:11: warning: converting the result of '<<' to a boolean; did you mean '(3 << (0)) != 0'? [-Wint-in-bool-context]
     200 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                                ^
   sound/soc/codecs/cmx655.c:204:51: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
     204 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                        ^
     205 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:204:51: note: use '|' for a bitwise operation
     204 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                        ^~
         |                                                                        |
   sound/soc/codecs/cmx655.c:204:20: warning: converting the result of '<<' to a boolean; did you mean '(12 << (4)) != 0'? [-Wint-in-bool-context]
     204 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                         ^
   sound/soc/codecs/cmx655.c:205:11: warning: converting the result of '<<' to a boolean; did you mean '(3 << (0)) != 0'? [-Wint-in-bool-context]
     205 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                                ^
   sound/soc/codecs/cmx655.c:209:51: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
     209 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                        ^
     210 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:209:51: note: use '|' for a bitwise operation
     209 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                                                        ^~
         |                                                                        |
   sound/soc/codecs/cmx655.c:209:20: warning: converting the result of '<<' to a boolean; did you mean '(12 << (4)) != 0'? [-Wint-in-bool-context]
     209 |                         *pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
         |                                         ^
   sound/soc/codecs/cmx655.c:210:11: warning: converting the result of '<<' to a boolean; did you mean '(3 << (0)) != 0'? [-Wint-in-bool-context]
     210 |                             (3 << CMX655_PLLCTRL_CPI_SHIFT);
         |                                ^
   sound/soc/codecs/cmx655.c:859:16: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
     859 |                 if ((reg_val && CMX655_VF_DCBLOCK) > 0) {
         |                              ^  ~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:859:16: note: use '&' for a bitwise operation
     859 |                 if ((reg_val && CMX655_VF_DCBLOCK) > 0) {
         |                              ^~
         |                              &
   sound/soc/codecs/cmx655.c:859:16: note: remove constant to silence this warning
     859 |                 if ((reg_val && CMX655_VF_DCBLOCK) > 0) {
         |                              ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cmx655.c:859:19: warning: converting the result of '<<' to a boolean; did you mean '(1 << (2)) != 0'? [-Wint-in-bool-context]
     859 |                 if ((reg_val && CMX655_VF_DCBLOCK) > 0) {
         |                                 ^
   sound/soc/codecs/cmx655.h:70:46: note: expanded from macro 'CMX655_VF_DCBLOCK'
      70 | #define     CMX655_VF_DCBLOCK           (0x1 << CMX655_VF_DCBLOCK_SHIFT)
         |                                              ^
   17 warnings generated.


vim +194 sound/soc/codecs/cmx655.c

   149	
   150	/**
   151	 * cmx655_get_sys_clk_config(): Get the clock configuration.
   152	 * @clk_id: Clock source setting as defined in cmx655.h
   153	 * @primary_mode: Non-zero if the CMX655 is the DAI primary
   154	 * @sr_setting: Setting for sample rate 0 to 3
   155	 * @clk_src: pointer for storing clock source (PLLREF, PLLSEL and
   156	 *           CLKSEL bits)
   157	 * @rdiv: pointer for storing PLL's RDIV value (13 bits)
   158	 * @ndiv: pointer for storing PLL's NDIV value (13 bits)
   159	 * @pll_ctrl: pointer for storing PLLCTRL register value (8 bits)
   160	 *
   161	 * Get the clock setup for the system clock based on clock Id, DAI primary mode
   162	 * and sample rate.
   163	 *
   164	 * Return: 0 for success, negative value otherwise
   165	 */
   166	static int cmx655_get_sys_clk_config(int clk_id,
   167					     int primary_mode,
   168					     int sr_setting,
   169					     int *clk_src,
   170					     int *rdiv, int *ndiv, int *pll_ctrl)
   171	{
   172		if (clk_id == CMX655_SYSCLK_AUTO) {
   173			if (primary_mode != 0)
   174				clk_id = CMX655_SYSCLK_RCLK;
   175			else
   176				clk_id = CMX655_SYSCLK_LRCLK;
   177		}
   178		*rdiv = 0;
   179		*ndiv = 0;
   180		*pll_ctrl = 0;
   181		switch (clk_id) {
   182		case CMX655_SYSCLK_RCLK:
   183			*clk_src = CMX655_CLKCTRL_CLRSRC_RCLK;
   184			break;
   185		case CMX655_SYSCLK_LPO:
   186			*clk_src = CMX655_CLKCTRL_CLRSRC_LPO;
   187			break;
   188		case CMX655_SYSCLK_LRCLK:
   189			*clk_src = CMX655_CLKCTRL_CLRSRC_LRCLK;
   190			*rdiv = 1;
   191			switch (sr_setting) {
   192			case CMX655_CLKCTRL_SR_8K:
   193				*ndiv = 3072;
 > 194				*pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
 > 195				    (3 << CMX655_PLLCTRL_CPI_SHIFT);
   196				break;
   197			case CMX655_CLKCTRL_SR_16K:
   198				*ndiv = 1536;
   199				*pll_ctrl = (0 << CMX655_PLLCTRL_LFILT_SHIFT) ||
   200				    (3 << CMX655_PLLCTRL_CPI_SHIFT);
   201				break;
   202			case CMX655_CLKCTRL_SR_32K:
   203				*ndiv = 768;
   204				*pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
   205				    (3 << CMX655_PLLCTRL_CPI_SHIFT);
   206				break;
   207			case CMX655_CLKCTRL_SR_48K:
   208				*ndiv = 512;
   209				*pll_ctrl = (12 << CMX655_PLLCTRL_LFILT_SHIFT) ||
   210				    (3 << CMX655_PLLCTRL_CPI_SHIFT);
   211				break;
   212			default:
   213				return -EINVAL;
   214			}
   215			break;
   216		default:
   217			return -EINVAL;
   218		}
   219		return 0;
   220	};
   221	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux