All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [drm-drm-misc:drm-misc-next 10/24] drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.
Date: Thu, 12 Aug 2021 18:55:28 +0800	[thread overview]
Message-ID: <202108121820.0bO8dsT7-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Zimmermann <tzimmermann@suse.de>

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   2ca380ea0e6a31046b7c4048e3f61cfc2f6b2aa3
commit: 2545ac960364d0395802a27374b46f13827b4cf5 [10/24] drm/mgag200: Abstract pixel PLL via struct mgag200_pll
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: x86_64-randconfig-m001-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.

vim +/delta +142 drivers/gpu/drm/mgag200/mgag200_pll.c

2545ac960364d0 Thomas Zimmermann 2021-07-14  109  
2545ac960364d0 Thomas Zimmermann 2021-07-14  110  /*
2545ac960364d0 Thomas Zimmermann 2021-07-14  111   * G200SE
2545ac960364d0 Thomas Zimmermann 2021-07-14  112   */
2545ac960364d0 Thomas Zimmermann 2021-07-14  113  
2545ac960364d0 Thomas Zimmermann 2021-07-14  114  static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clock,
2545ac960364d0 Thomas Zimmermann 2021-07-14  115  					    struct mgag200_pll_values *pixpllc)
2545ac960364d0 Thomas Zimmermann 2021-07-14  116  {
2545ac960364d0 Thomas Zimmermann 2021-07-14  117  	static const unsigned int vcomax = 320000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  118  	static const unsigned int vcomin = 160000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  119  	static const unsigned int pllreffreq = 25000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  120  
2545ac960364d0 Thomas Zimmermann 2021-07-14  121  	unsigned int delta, tmpdelta, permitteddelta;
2545ac960364d0 Thomas Zimmermann 2021-07-14  122  	unsigned int testp, testm, testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  123  	unsigned int p, m, n, s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  124  	unsigned int computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14  125  
2545ac960364d0 Thomas Zimmermann 2021-07-14  126  	m = n = p = s = 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  127  	permitteddelta = clock * 5 / 1000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  128  
2545ac960364d0 Thomas Zimmermann 2021-07-14  129  	for (testp = 8; testp > 0; testp /= 2) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  130  		if (clock * testp > vcomax)
2545ac960364d0 Thomas Zimmermann 2021-07-14  131  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  132  		if (clock * testp < vcomin)
2545ac960364d0 Thomas Zimmermann 2021-07-14  133  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  134  
2545ac960364d0 Thomas Zimmermann 2021-07-14  135  		for (testn = 17; testn < 256; testn++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  136  			for (testm = 1; testm < 32; testm++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  137  				computed = (pllreffreq * testn) / (testm * testp);
2545ac960364d0 Thomas Zimmermann 2021-07-14  138  				if (computed > clock)
2545ac960364d0 Thomas Zimmermann 2021-07-14  139  					tmpdelta = computed - clock;
2545ac960364d0 Thomas Zimmermann 2021-07-14  140  				else
2545ac960364d0 Thomas Zimmermann 2021-07-14  141  					tmpdelta = clock - computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14 @142  				if (tmpdelta < delta) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  143  					delta = tmpdelta;
2545ac960364d0 Thomas Zimmermann 2021-07-14  144  					m = testm;
2545ac960364d0 Thomas Zimmermann 2021-07-14  145  					n = testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  146  					p = testp;
2545ac960364d0 Thomas Zimmermann 2021-07-14  147  				}
2545ac960364d0 Thomas Zimmermann 2021-07-14  148  			}
2545ac960364d0 Thomas Zimmermann 2021-07-14  149  		}
2545ac960364d0 Thomas Zimmermann 2021-07-14  150  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  151  
2545ac960364d0 Thomas Zimmermann 2021-07-14  152  	if (delta > permitteddelta) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  153  		pr_warn("PLL delta too large\n");
2545ac960364d0 Thomas Zimmermann 2021-07-14  154  		return -EINVAL;
2545ac960364d0 Thomas Zimmermann 2021-07-14  155  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  156  
2545ac960364d0 Thomas Zimmermann 2021-07-14  157  	pixpllc->m = m;
2545ac960364d0 Thomas Zimmermann 2021-07-14  158  	pixpllc->n = n;
2545ac960364d0 Thomas Zimmermann 2021-07-14  159  	pixpllc->p = p;
2545ac960364d0 Thomas Zimmermann 2021-07-14  160  	pixpllc->s = s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  161  
2545ac960364d0 Thomas Zimmermann 2021-07-14  162  	return 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  163  }
2545ac960364d0 Thomas Zimmermann 2021-07-14  164  

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] [drm-drm-misc:drm-misc-next 10/24] drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.
Date: Thu, 12 Aug 2021 14:51:09 +0300	[thread overview]
Message-ID: <202108121820.0bO8dsT7-lkp@intel.com> (raw)

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

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   2ca380ea0e6a31046b7c4048e3f61cfc2f6b2aa3
commit: 2545ac960364d0395802a27374b46f13827b4cf5 [10/24] drm/mgag200: Abstract pixel PLL via struct mgag200_pll
config: x86_64-randconfig-m001-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.

vim +/delta +142 drivers/gpu/drm/mgag200/mgag200_pll.c

2545ac960364d0 Thomas Zimmermann 2021-07-14  114  static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clock,
2545ac960364d0 Thomas Zimmermann 2021-07-14  115  					    struct mgag200_pll_values *pixpllc)
2545ac960364d0 Thomas Zimmermann 2021-07-14  116  {
2545ac960364d0 Thomas Zimmermann 2021-07-14  117  	static const unsigned int vcomax = 320000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  118  	static const unsigned int vcomin = 160000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  119  	static const unsigned int pllreffreq = 25000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  120  
2545ac960364d0 Thomas Zimmermann 2021-07-14  121  	unsigned int delta, tmpdelta, permitteddelta;
                                                        ^^^^^^^^^^^^^^^^^^
2545ac960364d0 Thomas Zimmermann 2021-07-14  122  	unsigned int testp, testm, testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  123  	unsigned int p, m, n, s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  124  	unsigned int computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14  125  
2545ac960364d0 Thomas Zimmermann 2021-07-14  126  	m = n = p = s = 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  127  	permitteddelta = clock * 5 / 1000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  128  
2545ac960364d0 Thomas Zimmermann 2021-07-14  129  	for (testp = 8; testp > 0; testp /= 2) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  130  		if (clock * testp > vcomax)
2545ac960364d0 Thomas Zimmermann 2021-07-14  131  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  132  		if (clock * testp < vcomin)
2545ac960364d0 Thomas Zimmermann 2021-07-14  133  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  134  
2545ac960364d0 Thomas Zimmermann 2021-07-14  135  		for (testn = 17; testn < 256; testn++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  136  			for (testm = 1; testm < 32; testm++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  137  				computed = (pllreffreq * testn) / (testm * testp);
2545ac960364d0 Thomas Zimmermann 2021-07-14  138  				if (computed > clock)
2545ac960364d0 Thomas Zimmermann 2021-07-14  139  					tmpdelta = computed - clock;
2545ac960364d0 Thomas Zimmermann 2021-07-14  140  				else
2545ac960364d0 Thomas Zimmermann 2021-07-14  141  					tmpdelta = clock - computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14 @142  				if (tmpdelta < delta) {

"delta" is not intialized until the next line.


2545ac960364d0 Thomas Zimmermann 2021-07-14  143  					delta = tmpdelta;
2545ac960364d0 Thomas Zimmermann 2021-07-14  144  					m = testm;
2545ac960364d0 Thomas Zimmermann 2021-07-14  145  					n = testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  146  					p = testp;
2545ac960364d0 Thomas Zimmermann 2021-07-14  147  				}
2545ac960364d0 Thomas Zimmermann 2021-07-14  148  			}
2545ac960364d0 Thomas Zimmermann 2021-07-14  149  		}
2545ac960364d0 Thomas Zimmermann 2021-07-14  150  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  151  
2545ac960364d0 Thomas Zimmermann 2021-07-14  152  	if (delta > permitteddelta) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  153  		pr_warn("PLL delta too large\n");
2545ac960364d0 Thomas Zimmermann 2021-07-14  154  		return -EINVAL;
2545ac960364d0 Thomas Zimmermann 2021-07-14  155  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  156  
2545ac960364d0 Thomas Zimmermann 2021-07-14  157  	pixpllc->m = m;
2545ac960364d0 Thomas Zimmermann 2021-07-14  158  	pixpllc->n = n;
2545ac960364d0 Thomas Zimmermann 2021-07-14  159  	pixpllc->p = p;
2545ac960364d0 Thomas Zimmermann 2021-07-14  160  	pixpllc->s = s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  161  
2545ac960364d0 Thomas Zimmermann 2021-07-14  162  	return 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  163  }

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

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Thomas Zimmermann <tzimmermann@suse.de>
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [kbuild] [drm-drm-misc:drm-misc-next 10/24] drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.
Date: Thu, 12 Aug 2021 14:51:09 +0300	[thread overview]
Message-ID: <202108121820.0bO8dsT7-lkp@intel.com> (raw)

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   2ca380ea0e6a31046b7c4048e3f61cfc2f6b2aa3
commit: 2545ac960364d0395802a27374b46f13827b4cf5 [10/24] drm/mgag200: Abstract pixel PLL via struct mgag200_pll
config: x86_64-randconfig-m001-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.

vim +/delta +142 drivers/gpu/drm/mgag200/mgag200_pll.c

2545ac960364d0 Thomas Zimmermann 2021-07-14  114  static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clock,
2545ac960364d0 Thomas Zimmermann 2021-07-14  115  					    struct mgag200_pll_values *pixpllc)
2545ac960364d0 Thomas Zimmermann 2021-07-14  116  {
2545ac960364d0 Thomas Zimmermann 2021-07-14  117  	static const unsigned int vcomax = 320000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  118  	static const unsigned int vcomin = 160000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  119  	static const unsigned int pllreffreq = 25000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  120  
2545ac960364d0 Thomas Zimmermann 2021-07-14  121  	unsigned int delta, tmpdelta, permitteddelta;
                                                        ^^^^^^^^^^^^^^^^^^
2545ac960364d0 Thomas Zimmermann 2021-07-14  122  	unsigned int testp, testm, testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  123  	unsigned int p, m, n, s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  124  	unsigned int computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14  125  
2545ac960364d0 Thomas Zimmermann 2021-07-14  126  	m = n = p = s = 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  127  	permitteddelta = clock * 5 / 1000;
2545ac960364d0 Thomas Zimmermann 2021-07-14  128  
2545ac960364d0 Thomas Zimmermann 2021-07-14  129  	for (testp = 8; testp > 0; testp /= 2) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  130  		if (clock * testp > vcomax)
2545ac960364d0 Thomas Zimmermann 2021-07-14  131  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  132  		if (clock * testp < vcomin)
2545ac960364d0 Thomas Zimmermann 2021-07-14  133  			continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14  134  
2545ac960364d0 Thomas Zimmermann 2021-07-14  135  		for (testn = 17; testn < 256; testn++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  136  			for (testm = 1; testm < 32; testm++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  137  				computed = (pllreffreq * testn) / (testm * testp);
2545ac960364d0 Thomas Zimmermann 2021-07-14  138  				if (computed > clock)
2545ac960364d0 Thomas Zimmermann 2021-07-14  139  					tmpdelta = computed - clock;
2545ac960364d0 Thomas Zimmermann 2021-07-14  140  				else
2545ac960364d0 Thomas Zimmermann 2021-07-14  141  					tmpdelta = clock - computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14 @142  				if (tmpdelta < delta) {

"delta" is not intialized until the next line.


2545ac960364d0 Thomas Zimmermann 2021-07-14  143  					delta = tmpdelta;
2545ac960364d0 Thomas Zimmermann 2021-07-14  144  					m = testm;
2545ac960364d0 Thomas Zimmermann 2021-07-14  145  					n = testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14  146  					p = testp;
2545ac960364d0 Thomas Zimmermann 2021-07-14  147  				}
2545ac960364d0 Thomas Zimmermann 2021-07-14  148  			}
2545ac960364d0 Thomas Zimmermann 2021-07-14  149  		}
2545ac960364d0 Thomas Zimmermann 2021-07-14  150  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  151  
2545ac960364d0 Thomas Zimmermann 2021-07-14  152  	if (delta > permitteddelta) {
2545ac960364d0 Thomas Zimmermann 2021-07-14  153  		pr_warn("PLL delta too large\n");
2545ac960364d0 Thomas Zimmermann 2021-07-14  154  		return -EINVAL;
2545ac960364d0 Thomas Zimmermann 2021-07-14  155  	}
2545ac960364d0 Thomas Zimmermann 2021-07-14  156  
2545ac960364d0 Thomas Zimmermann 2021-07-14  157  	pixpllc->m = m;
2545ac960364d0 Thomas Zimmermann 2021-07-14  158  	pixpllc->n = n;
2545ac960364d0 Thomas Zimmermann 2021-07-14  159  	pixpllc->p = p;
2545ac960364d0 Thomas Zimmermann 2021-07-14  160  	pixpllc->s = s;
2545ac960364d0 Thomas Zimmermann 2021-07-14  161  
2545ac960364d0 Thomas Zimmermann 2021-07-14  162  	return 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14  163  }

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

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


             reply	other threads:[~2021-08-12 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 10:55 kernel test robot [this message]
2021-08-12 11:51 ` [kbuild] [drm-drm-misc:drm-misc-next 10/24] drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta' Dan Carpenter
2021-08-12 11:51 ` Dan Carpenter

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=202108121820.0bO8dsT7-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.