From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/dsa/mt7530.c:908 mt7530_set_ageing_time() error: uninitialized symbol 'age_count'.
Date: Tue, 23 Nov 2021 10:40:56 +0800 [thread overview]
Message-ID: <202111231044.act7MryR-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4294 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: DENG Qingfang <dqfext@gmail.com>
CC: Andrew Lunn <andrew@lunn.ch>
CC: Vladimir Oltean <olteanv@gmail.com>
CC: Florian Fainelli <f.fainelli@gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 136057256686de39cc3a07c2e39ef6bc43003ff6
commit: ea6d5c924e391872d402acac38461a5f8261e57f net: dsa: mt7530: support setting ageing time
date: 12 months ago
:::::: branch date: 29 hours ago
:::::: commit date: 12 months ago
config: ia64-randconfig-m031-20211122 (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.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
b8f126a8d54318 Sean Wang 2017-04-07 872
ea6d5c924e3918 DENG Qingfang 2020-12-08 873 static int
ea6d5c924e3918 DENG Qingfang 2020-12-08 874 mt7530_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
ea6d5c924e3918 DENG Qingfang 2020-12-08 875 {
ea6d5c924e3918 DENG Qingfang 2020-12-08 876 struct mt7530_priv *priv = ds->priv;
ea6d5c924e3918 DENG Qingfang 2020-12-08 877 unsigned int secs = msecs / 1000;
ea6d5c924e3918 DENG Qingfang 2020-12-08 878 unsigned int tmp_age_count;
ea6d5c924e3918 DENG Qingfang 2020-12-08 879 unsigned int error = -1;
ea6d5c924e3918 DENG Qingfang 2020-12-08 880 unsigned int age_count;
ea6d5c924e3918 DENG Qingfang 2020-12-08 881 unsigned int age_unit;
ea6d5c924e3918 DENG Qingfang 2020-12-08 882
ea6d5c924e3918 DENG Qingfang 2020-12-08 883 /* Applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds */
ea6d5c924e3918 DENG Qingfang 2020-12-08 884 if (secs < 1 || secs > (AGE_CNT_MAX + 1) * (AGE_UNIT_MAX + 1))
ea6d5c924e3918 DENG Qingfang 2020-12-08 885 return -ERANGE;
ea6d5c924e3918 DENG Qingfang 2020-12-08 886
ea6d5c924e3918 DENG Qingfang 2020-12-08 887 /* iterate through all possible age_count to find the closest pair */
ea6d5c924e3918 DENG Qingfang 2020-12-08 888 for (tmp_age_count = 0; tmp_age_count <= AGE_CNT_MAX; ++tmp_age_count) {
ea6d5c924e3918 DENG Qingfang 2020-12-08 889 unsigned int tmp_age_unit = secs / (tmp_age_count + 1) - 1;
ea6d5c924e3918 DENG Qingfang 2020-12-08 890
ea6d5c924e3918 DENG Qingfang 2020-12-08 891 if (tmp_age_unit <= AGE_UNIT_MAX) {
ea6d5c924e3918 DENG Qingfang 2020-12-08 892 unsigned int tmp_error = secs -
ea6d5c924e3918 DENG Qingfang 2020-12-08 893 (tmp_age_count + 1) * (tmp_age_unit + 1);
ea6d5c924e3918 DENG Qingfang 2020-12-08 894
ea6d5c924e3918 DENG Qingfang 2020-12-08 895 /* found a closer pair */
ea6d5c924e3918 DENG Qingfang 2020-12-08 896 if (error > tmp_error) {
ea6d5c924e3918 DENG Qingfang 2020-12-08 897 error = tmp_error;
ea6d5c924e3918 DENG Qingfang 2020-12-08 898 age_count = tmp_age_count;
ea6d5c924e3918 DENG Qingfang 2020-12-08 899 age_unit = tmp_age_unit;
ea6d5c924e3918 DENG Qingfang 2020-12-08 900 }
ea6d5c924e3918 DENG Qingfang 2020-12-08 901
ea6d5c924e3918 DENG Qingfang 2020-12-08 902 /* found the exact match, so break the loop */
ea6d5c924e3918 DENG Qingfang 2020-12-08 903 if (!error)
ea6d5c924e3918 DENG Qingfang 2020-12-08 904 break;
ea6d5c924e3918 DENG Qingfang 2020-12-08 905 }
ea6d5c924e3918 DENG Qingfang 2020-12-08 906 }
ea6d5c924e3918 DENG Qingfang 2020-12-08 907
ea6d5c924e3918 DENG Qingfang 2020-12-08 @908 mt7530_write(priv, MT7530_AAC, AGE_CNT(age_count) | AGE_UNIT(age_unit));
ea6d5c924e3918 DENG Qingfang 2020-12-08 909
ea6d5c924e3918 DENG Qingfang 2020-12-08 910 return 0;
ea6d5c924e3918 DENG Qingfang 2020-12-08 911 }
ea6d5c924e3918 DENG Qingfang 2020-12-08 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: 37291 bytes --]
next reply other threads:[~2021-11-23 2:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 2:40 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-25 14:55 drivers/net/dsa/mt7530.c:908 mt7530_set_ageing_time() error: uninitialized symbol 'age_count' 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=202111231044.act7MryR-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.