All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-lts:5.10/yocto 18516/20368] drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_start_ns' is used uninitialized whenever 'if' condition is false
@ 2022-01-16 12:34 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-01-16 12:34 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/intel/linux-intel-lts.git 5.10/yocto
head:   1941d4b82f36cc6ecc513f3e496ad62726d00514
commit: ba88170534041ab8213508ceddf96c012d9d9e7e [18516/20368] Add support for PMC Time-Aware GPIO (TGPIO) hardware that is present on upcoming Intel platforms. The hardware logic is driven by the ART clock. The current hardware has two GPIO pins. Input interrupts are not implemented in hardware.
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220116/202201162006.UOLVb6S8-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 650fc40b6d8d9a5869b4fca525d5f237b0ee2803)
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
        # https://github.com/intel/linux-intel-lts/commit/ba88170534041ab8213508ceddf96c012d9d9e7e
        git remote add intel-lts https://github.com/intel/linux-intel-lts.git
        git fetch --no-tags intel-lts 5.10/yocto
        git checkout ba88170534041ab8213508ceddf96c012d9d9e7e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpio/ drivers/gpu/drm/i915/ drivers/ptp/

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

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

only message in thread, other threads:[~2022-01-16 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-16 12:34 [intel-lts:5.10/yocto 18516/20368] 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.