All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:5.4/yocto 63/66] drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_start_ns' is used uninitialized whenever 'if' condition is false
@ 2020-08-11  9:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-11  9:43 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/intel/linux-intel-lts.git 5.4/yocto
head:   7e5be1eaf9b5088cda67df5351c2c12572db341b
commit: 357fc48f29d865a0760168fd13f28f512487eb00 [63/66] drivers/ptp: Add PMC Time-Aware GPIO Driver
config: x86_64-randconfig-r023-20200811 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4f2ad15db535873dda9bfe248a2771023b64a43c)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 357fc48f29d865a0760168fd13f28f512487eb00
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_start_ns' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (on || perout->flags & PTP_PEROUT_ONE_SHOT) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:396:26: note: uninitialized use occurs here
                   (tgpio, perout->index, new_start_ns, new_period_ns,
                                          ^~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:388:2: note: remove the 'if' if its condition is always true
           if (on || perout->flags & PTP_PEROUT_ONE_SHOT) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:385:2: note: variable 'new_start_ns' is declared here
           struct timespec64       new_start_ns;
           ^
>> drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_period_ns' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (on || perout->flags & PTP_PEROUT_ONE_SHOT) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:396:40: note: uninitialized use occurs here
                   (tgpio, perout->index, new_start_ns, new_period_ns,
                                                        ^~~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:388:2: note: remove the 'if' if its condition is always true
           if (on || perout->flags & PTP_PEROUT_ONE_SHOT) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ptp/ptp-intel-pmc-tgpio.c:386:2: note: variable 'new_period_ns' is declared here
           struct timespec64       new_period_ns;
           ^
>> drivers/ptp/ptp-intel-pmc-tgpio.c:738:36: warning: unused variable 'intel_pmc_acpi_match' [-Wunused-const-variable]
   static const struct acpi_device_id intel_pmc_acpi_match[] = {
                                      ^
   3 warnings generated.

vim +388 drivers/ptp/ptp-intel-pmc-tgpio.c

   381	
   382	static int intel_pmc_tgpio_config_output
   383	(struct intel_pmc_tgpio_t *tgpio, struct ptp_perout_request *perout, int on)
   384	{
   385		struct timespec64	new_start_ns;
   386		struct timespec64	new_period_ns;
   387	
 > 388		if (on || perout->flags & PTP_PEROUT_ONE_SHOT) {
   389			new_start_ns = ptp_clock_time_to_ts64(perout->start);
   390			new_period_ns = ptp_clock_time_to_ts64(perout->period);
   391			new_period_ns = ktime_to_timespec64
   392			  (ktime_divns(timespec64_to_ktime(new_period_ns), 2));
   393		}
   394	
   395		return _intel_pmc_tgpio_config_output
   396			(tgpio, perout->index, new_start_ns, new_period_ns,
   397			 perout->flags, on);
   398	}
   399	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30563 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-11  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  9:43 [intel-linux-intel-lts:5.4/yocto 63/66] drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_start_ns' is used uninitialized whenever 'if' condition is false kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.