lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202506270344.Sx9MtDt4-lkp@intel.com>
Date: Fri, 27 Jun 2025 03:54:20 +0800
From: kernel test robot <lkp@...el.com>
To: Christian Marangi <ansuelsmth@...il.com>,
	Uwe Kleine-König <ukleinek@...nel.org>,
	linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
	Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	Benjamin Larsson <benjamin.larsson@...exis.eu>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Lorenzo Bianconi <lorenzo@...nel.org>,
	Christian Marangi <ansuelsmth@...il.com>
Subject: Re: [PATCH v17] pwm: airoha: Add support for EN7581 SoC

Hi Christian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.16-rc3 next-20250626]
[cannot apply to thierry-reding-pwm/for-next]
[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/Christian-Marangi/pwm-airoha-Add-support-for-EN7581-SoC/20250626-035111
base:   linus/master
patch link:    https://lore.kernel.org/r/20250625194919.94214-1-ansuelsmth%40gmail.com
patch subject: [PATCH v17] pwm: airoha: Add support for EN7581 SoC
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250627/202506270344.Sx9MtDt4-lkp@intel.com/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250627/202506270344.Sx9MtDt4-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506270344.Sx9MtDt4-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pwm/pwm-airoha.c:498:6: warning: variable 'period_ns' is uninitialized when used here [-Wuninitialized]
     498 |         if (period_ns < AIROHA_PWM_PERIOD_TICK_NS)
         |             ^~~~~~~~~
   drivers/pwm/pwm-airoha.c:486:15: note: initialize the variable 'period_ns' to silence this warning
     486 |         u32 period_ns, duty_ns;
         |                      ^
         |                       = 0
   1 warning generated.


vim +/period_ns +498 drivers/pwm/pwm-airoha.c

   480	
   481	static int airoha_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
   482				    const struct pwm_state *state)
   483	{
   484		struct airoha_pwm *pc = pwmchip_get_drvdata(chip);
   485		u32 period_ticks, duty_ticks;
   486		u32 period_ns, duty_ns;
   487	
   488		if (!state->enabled) {
   489			airoha_pwm_disable(pc, pwm);
   490			return 0;
   491		}
   492	
   493		/* Only normal polarity is supported */
   494		if (state->polarity == PWM_POLARITY_INVERSED)
   495			return -EINVAL;
   496	
   497		/* Exit early if period is less than minimum supported */
 > 498		if (period_ns < AIROHA_PWM_PERIOD_TICK_NS)
   499			return -EINVAL;
   500	
   501		/* Clamp period to MAX supported value */
   502		if (state->period > AIROHA_PWM_PERIOD_MAX_NS)
   503			period_ns = AIROHA_PWM_PERIOD_MAX_NS;
   504		else
   505			period_ns = state->period;
   506	
   507		/* Validate duty to configured period */
   508		if (state->duty_cycle > period_ns)
   509			duty_ns = period_ns;
   510		else
   511			duty_ns = state->duty_cycle;
   512	
   513		/*
   514		 * Period goes at 4ns step, normalize it to check if we can
   515		 * share a generator.
   516		 */
   517		period_ns = rounddown(period_ns, AIROHA_PWM_PERIOD_TICK_NS);
   518	
   519		/*
   520		 * Duty is divided in 255 segment, normalize it to check if we
   521		 * can share a generator.
   522		 */
   523		duty_ns = DIV_U64_ROUND_UP(duty_ns * AIROHA_PWM_DUTY_FULL,
   524					   AIROHA_PWM_DUTY_FULL);
   525	
   526		/* Convert ns to ticks */
   527		period_ticks = airoha_pwm_get_period_ticks_from_ns(period_ns);
   528		duty_ticks = airoha_pwm_get_duty_ticks_from_ns(period_ns, duty_ns);
   529	
   530		return airoha_pwm_config(pc, pwm, period_ticks, duty_ticks);
   531	}
   532	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ