All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time
Date: Wed, 25 Nov 2020 14:00:11 +0800	[thread overview]
Message-ID: <202011251358.Epp17Yu4-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201119064020.19522-1-dqfext@gmail.com>
References: <20201119064020.19522-1-dqfext@gmail.com>
TO: DENG Qingfang <dqfext@gmail.com>

Hi DENG,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/DENG-Qingfang/net-dsa-mt7530-support-setting-ageing-time/20201119-144450
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e76d795ecb5bb67741fb9e304dcce7950c7aeea0
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-m001-20201125 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/net/dsa/mt7530.c:908 mt7530_set_ageing_time() error: uninitialized symbol 'age_count'.
drivers/net/dsa/mt7530.c:908 mt7530_set_ageing_time() error: uninitialized symbol 'age_unit'.

Old smatch warnings:
drivers/net/dsa/mt7530.c:469 mt7530_pad_clk_setup() error: uninitialized symbol 'ncpo1'.

vim +/age_count +908 drivers/net/dsa/mt7530.c

b8f126a8d54318b Sean Wang     2017-04-07  872  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  873  static int
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  874  mt7530_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  875  {
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  876  	struct mt7530_priv *priv = ds->priv;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  877  	unsigned int secs = msecs / 1000;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  878  	unsigned int tmp_age_count;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  879  	unsigned int error = -1;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  880  	unsigned int age_count;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  881  	unsigned int age_unit;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  882  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  883  	/* Applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds */
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  884  	if (secs < 1 || secs > (AGE_CNT_MAX + 1) * (AGE_UNIT_MAX + 1))
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  885  		return -ERANGE;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  886  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  887  	/* iterate through all possible age_count to find the closest pair */
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  888  	for (tmp_age_count = 0; tmp_age_count <= AGE_CNT_MAX; ++tmp_age_count) {
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  889  		unsigned int tmp_age_unit = secs / (tmp_age_count + 1) - 1;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  890  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  891  		if (tmp_age_unit <= AGE_UNIT_MAX) {
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  892  			unsigned int tmp_error = secs -
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  893  				(tmp_age_count + 1) * (tmp_age_unit + 1);
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  894  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  895  			/* found a closer pair */
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  896  			if (error > tmp_error) {
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  897  				error = tmp_error;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  898  				age_count = tmp_age_count;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  899  				age_unit = tmp_age_unit;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  900  			}
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  901  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  902  			/* found the exact match, so break the loop */
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  903  			if (!error)
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  904  				break;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  905  		}
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  906  	}
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  907  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19 @908  	mt7530_write(priv, MT7530_AAC, AGE_CNT(age_count) | AGE_UNIT(age_unit));
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  909  
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  910  	return 0;
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  911  }
d11e5a9ab8bb73d DENG Qingfang 2020-11-19  912  

---
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: 33282 bytes --]

             reply	other threads:[~2020-11-25  6:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  6:00 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-19  6:40 [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time DENG Qingfang
2020-11-19  6:40 ` DENG Qingfang
2020-11-20  2:25 ` Andrew Lunn
2020-11-20  2:25   ` Andrew Lunn
2020-11-20  3:37   ` DENG Qingfang
2020-11-20  3:37     ` DENG Qingfang

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=202011251358.Epp17Yu4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@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.