llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [linux-next:master 12283/13468] drivers/rtc/rtc-rzn1.c:291:3: warning: variable 'val' is uninitialized when used here
Date: Sun, 22 May 2022 11:51:48 +0800	[thread overview]
Message-ID: <202205221120.Tt6UxePI-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   18ecd30af1a8402c162cca1bd58771c0e5be7815
commit: be4a11cf98aff5d456eae947a49b6163393d9420 [12283/13468] rtc: rzn1: Add oscillator offset support
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220522/202205221120.Tt6UxePI-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1443dbaba6f0e57be066995db9164f89fb57b413)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=be4a11cf98aff5d456eae947a49b6163393d9420
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout be4a11cf98aff5d456eae947a49b6163393d9420
        # 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=arm64 SHELL=/bin/bash drivers/rtc/ net/sched/

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-rzn1.c:291:3: warning: variable 'val' is uninitialized when used here [-Wuninitialized]
                   val |= RZN1_RTC_SUBU_DEV;
                   ^~~
   drivers/rtc/rtc-rzn1.c:275:9: note: initialize the variable 'val' to silence this warning
           u32 val;
                  ^
                   = 0
   1 warning generated.


vim +/val +291 drivers/rtc/rtc-rzn1.c

   269	
   270	static int rzn1_rtc_set_offset(struct device *dev, long offset)
   271	{
   272		struct rzn1_rtc *rtc = dev_get_drvdata(dev);
   273		unsigned int steps;
   274		int stepsh, stepsl;
   275		u32 val;
   276		int ret;
   277	
   278		/*
   279		 * Check which resolution mode (every 20 or 60s) can be used.
   280		 * Between 2 and 124 clock pulses can be added or substracted.
   281		 *
   282		 * In 20s mode, the minimum resolution is 2 / (32768 * 20) which is
   283		 * close to 3051 ppb. In 60s mode, the resolution is closer to 1017.
   284		 */
   285		stepsh = DIV_ROUND_CLOSEST(offset, 1017);
   286		stepsl = DIV_ROUND_CLOSEST(offset, 3051);
   287	
   288		if (stepsh >= -0x3E && stepsh <= 0x3E) {
   289			/* 1017 ppb per step */
   290			steps = stepsh;
 > 291			val |= RZN1_RTC_SUBU_DEV;
   292		} else if (stepsl >= -0x3E && stepsl <= 0x3E) {
   293			/* 3051 ppb per step */
   294			steps = stepsl;
   295		} else {
   296			return -ERANGE;
   297		}
   298	
   299		if (!steps)
   300			return 0;
   301	
   302		if (steps > 0) {
   303			val |= steps + 1;
   304		} else {
   305			val |= RZN1_RTC_SUBU_DECR;
   306			val |= (~(-steps - 1)) & 0x3F;
   307		}
   308	
   309		ret = readl_poll_timeout(rtc->base + RZN1_RTC_CTL2, val,
   310					 !(val & RZN1_RTC_CTL2_WUST), 100, 2000000);
   311		if (ret)
   312			return ret;
   313	
   314		writel(val, rtc->base + RZN1_RTC_SUBU);
   315	
   316		return 0;
   317	}
   318	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-05-22  3:52 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=202205221120.Tt6UxePI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=miquel.raynal@bootlin.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;
as well as URLs for NNTP newsgroup(s).