From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7579159982070675216==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [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 Date: Sun, 16 Jan 2022 20:34:43 +0800 Message-ID: <202201162006.UOLVb6S8-lkp@intel.com> List-Id: --===============7579159982070675216== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 hardw= are 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 650fc4= 0b6d8d9a5869b4fca525d5f237b0ee2803) reproduce (this is a W=3D1 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/ba88170534041ab82= 13508ceddf96c012d9d9e7e git remote add intel-lts https://github.com/intel/linux-intel-lts.g= it 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=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/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 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-unini= tialized] 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 co= ndition 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' i= s declared here struct timespec64 new_start_ns; ^ >> drivers/ptp/ptp-intel-pmc-tgpio.c:388:6: warning: variable 'new_period_n= s' is used uninitialized whenever 'if' condition is false [-Wsometimes-unin= itialized] 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 co= ndition 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 'inte= l_pmc_acpi_match' [-Wunused-const-variable] static const struct acpi_device_id intel_pmc_acpi_match[] =3D { ^ 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 =3D ptp_clock_time_to_ts64(perout->start); 390 new_period_ns =3D ptp_clock_time_to_ts64(perout->period); 391 new_period_ns =3D 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 --===============7579159982070675216==--