mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Stephen Boyd <sboyd@kernel.org>
Subject: drivers/clk/at91/clk-sam9x60-pll.c:334:13: warning: variable 'best_div' set but not used
Date: Sun, 16 Aug 2020 21:00:22 +0800	[thread overview]
Message-ID: <202008162120.kXs4SM9t%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4b6c093e21d36bede0fd88fd0aeb3b03647260e4
commit: 43b1bb4a9b3e183af12225f56c27164c10d06223 clk: at91: clk-sam9x60-pll: re-factor to support plls with multiple outputs
date:   3 weeks ago
config: arm-at91_dt_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
        git checkout 43b1bb4a9b3e183af12225f56c27164c10d06223
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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/clk/at91/clk-sam9x60-pll.c: In function 'sam9x60_div_pll_compute_div':
>> drivers/clk/at91/clk-sam9x60-pll.c:334:13: warning: variable 'best_div' set but not used [-Wunused-but-set-variable]
     334 |  u32 divid, best_div;
         |             ^~~~~~~~

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43b1bb4a9b3e183af12225f56c27164c10d06223
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 43b1bb4a9b3e183af12225f56c27164c10d06223
vim +/best_div +334 drivers/clk/at91/clk-sam9x60-pll.c

   324	
   325	static long sam9x60_div_pll_compute_div(struct sam9x60_pll_core *core,
   326						unsigned long *parent_rate,
   327						unsigned long rate)
   328	{
   329		const struct clk_pll_characteristics *characteristics =
   330								core->characteristics;
   331		struct clk_hw *parent = clk_hw_get_parent(&core->hw);
   332		unsigned long tmp_rate, tmp_parent_rate, tmp_diff;
   333		long best_diff = -1, best_rate = -EINVAL;
 > 334		u32 divid, best_div;
   335	
   336		if (!rate)
   337			return 0;
   338	
   339		if (rate < characteristics->output[0].min ||
   340		    rate > characteristics->output[0].max)
   341			return -ERANGE;
   342	
   343		for (divid = 1; divid < core->layout->div_mask; divid++) {
   344			tmp_parent_rate = clk_hw_round_rate(parent, rate * divid);
   345			if (!tmp_parent_rate)
   346				continue;
   347	
   348			tmp_rate = DIV_ROUND_CLOSEST_ULL(tmp_parent_rate, divid);
   349			tmp_diff = abs(rate - tmp_rate);
   350	
   351			if (best_diff < 0 || best_diff > tmp_diff) {
   352				*parent_rate = tmp_parent_rate;
   353				best_rate = tmp_rate;
   354				best_diff = tmp_diff;
   355				best_div = divid;
   356			}
   357	
   358			if (!best_diff)
   359				break;
   360		}
   361	
   362		if (best_rate < characteristics->output[0].min ||
   363		    best_rate > characteristics->output[0].max)
   364			return -ERANGE;
   365	
   366		return best_rate;
   367	}
   368	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28785 bytes --]

                 reply	other threads:[~2020-08-16 13:07 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=202008162120.kXs4SM9t%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®