From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [intel-linux-intel-lts:5.4/yocto 5/10] drivers/ptp/ptp-intel-tgpio-plat.c:234:6: warning: variable 'isgn' is used uninitialized whenever 'if' condition is false
Date: Sat, 15 May 2021 00:05:55 +0800 [thread overview]
Message-ID: <202105150053.FPTZGcpe-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3244 bytes --]
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 5342fd3d769c58688aad5088b77b3c9f44438ef7
commit: e3b73159b8cfd2c940dd6e55702754c16f1f3923 [5/10] mfd: intel-ehl-gpio: Introduce MFD framework to PSE GPIO/TGPIO
config: x86_64-randconfig-r026-20210514 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 425781bce01f2f1d5f553d3b2bf9ebbd6e15068c)
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
# https://github.com/intel/linux-intel-lts/commit/e3b73159b8cfd2c940dd6e55702754c16f1f3923
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout e3b73159b8cfd2c940dd6e55702754c16f1f3923
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 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-tgpio-plat.c:234:6: warning: variable 'isgn' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (scaled_ppm < 0) {
^~~~~~~~~~~~~~
drivers/ptp/ptp-intel-tgpio-plat.c:247:9: note: uninitialized use occurs here
reg |= isgn << 31;
^~~~
drivers/ptp/ptp-intel-tgpio-plat.c:234:2: note: remove the 'if' if its condition is always true
if (scaled_ppm < 0) {
^~~~~~~~~~~~~~~~~~~~
drivers/ptp/ptp-intel-tgpio-plat.c:229:13: note: initialize the variable 'isgn' to silence this warning
bool isgn;
^
= 0
1 warning generated.
vim +234 drivers/ptp/ptp-intel-tgpio-plat.c
223
224 static int intel_tgpio_adjfine(struct ptp_clock_info *info, long scaled_ppm)
225 {
226 struct intel_tgpio *tgpio = to_intel_tgpio(info);
227 unsigned long flags;
228 u32 reg;
229 bool isgn;
230
231 pm_runtime_get_sync(tgpio->dev->parent);
232
233 spin_lock_irqsave(&tgpio->lock, flags);
> 234 if (scaled_ppm < 0) {
235 isgn = true;
236 scaled_ppm = -scaled_ppm;
237 }
238
239 /*
240 * HW uses a 200MHz clock, meaning it has a 5ns period. Just
241 * multiply scaled_ppm by 5 to get our increment.
242 */
243 reg = 5 * scaled_ppm;
244
245 /* bit 31 is sign bit */
246 reg &= ~BIT(31);
247 reg |= isgn << 31;
248
249 intel_tgpio_writel(tgpio->base, TIMINCA_GLOBAL, reg);
250 spin_unlock_irqrestore(&tgpio->lock, flags);
251
252 pm_runtime_put(tgpio->dev->parent);
253
254 return 0;
255 }
256
---
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: 30573 bytes --]
reply other threads:[~2021-05-14 16:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202105150053.FPTZGcpe-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.