From: kernel test robot <lkp@intel.com>
To: Srinivas Neeli <srinivas.neeli@xilinx.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH V8 3/3] rtc: zynqmp: Add calibration set and get support
Date: Tue, 14 Jun 2022 12:04:41 +0800 [thread overview]
Message-ID: <202206141140.xDnN0yu1-lkp@intel.com> (raw)
In-Reply-To: <20220613125836.523449-3-srinivas.neeli@xilinx.com>
Hi Srinivas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on abelloni/rtc-next]
[also build test WARNING on v5.19-rc2 next-20220610]
[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]
url: https://github.com/intel-lab-lkp/linux/commits/Srinivas-Neeli/dt-bindings-rtc-zynqmp-Add-clock-information/20220614-013701
base: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: i386-randconfig-a006-20220613 (https://download.01.org/0day-ci/archive/20220614/202206141140.xDnN0yu1-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c97436f8b6e2718286e8496faf53a2c800e281cf)
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-lab-lkp/linux/commit/2781fd75583878d86f256113b19bb005dc83fb70
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Srinivas-Neeli/dt-bindings-rtc-zynqmp-Add-clock-information/20220614-013701
git checkout 2781fd75583878d86f256113b19bb005dc83fb70
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/rtc/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/rtc/rtc-zynqmp.c:223:7: warning: variable 'fract_tick' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (fract_offset > (tick_mult / RTC_FR_MAX_TICKS)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:238:6: note: uninitialized use occurs here
if (fract_tick)
^~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:223:3: note: remove the 'if' if its condition is always true
if (fract_offset > (tick_mult / RTC_FR_MAX_TICKS)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:218:6: warning: variable 'fract_tick' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (fract_offset) {
^~~~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:238:6: note: uninitialized use occurs here
if (fract_tick)
^~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:218:2: note: remove the 'if' if its condition is always true
if (fract_offset) {
^~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-zynqmp.c:206:26: note: initialize the variable 'fract_tick' to silence this warning
unsigned char fract_tick;
^
= '\0'
2 warnings generated.
vim +223 drivers/rtc/rtc-zynqmp.c
200
201 static int xlnx_rtc_set_offset(struct device *dev, long offset)
202 {
203 struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
204 unsigned long long rtc_ppb = RTC_PPB;
205 unsigned int tick_mult = do_div(rtc_ppb, xrtcdev->freq);
206 unsigned char fract_tick;
207 unsigned int calibval;
208 short int max_tick;
209 int fract_offset;
210
211 if (offset < RTC_MIN_OFFSET || offset > RTC_MAX_OFFSET)
212 return -ERANGE;
213
214 /* Number ticks for given offset */
215 max_tick = div_s64_rem(offset, tick_mult, &fract_offset);
216
217 /* Number fractional ticks for given offset */
218 if (fract_offset) {
219 if (fract_offset < 0) {
220 fract_offset = fract_offset + tick_mult;
221 max_tick--;
222 }
> 223 if (fract_offset > (tick_mult / RTC_FR_MAX_TICKS)) {
224 for (fract_tick = 1; fract_tick < 16; fract_tick++) {
225 if (fract_offset <=
226 (fract_tick *
227 (tick_mult / RTC_FR_MAX_TICKS)))
228 break;
229 }
230 }
231 }
232
233 /* Zynqmp RTC uses second and fractional tick
234 * counters for compensation
235 */
236 calibval = max_tick + RTC_CALIB_DEF;
237
238 if (fract_tick)
239 calibval |= RTC_FR_EN;
240
241 calibval |= (fract_tick << RTC_FR_DATSHIFT);
242
243 writel(calibval, (xrtcdev->reg_base + RTC_CALIB_WR));
244
245 return 0;
246 }
247
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next parent reply other threads:[~2022-06-14 4:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220613125836.523449-3-srinivas.neeli@xilinx.com>
2022-06-14 4:04 ` kernel test robot [this message]
2022-06-14 4:24 ` [PATCH V8 3/3] rtc: zynqmp: Add calibration set and get support kernel test robot
[not found] <202207012151.nYCjgJqj-lkp@intel.com>
2022-07-07 8:04 ` kernel test robot
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=202206141140.xDnN0yu1-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=llvm@lists.linux.dev \
--cc=srinivas.neeli@xilinx.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox