public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 11: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=202108121820.0bO8dsT7-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=tzimmermann@suse.de \
    /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