All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [miquelraynal:nand/next 15/38] drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.
@ 2020-10-28 18:27 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-10-28 18:27 UTC (permalink / raw
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Miquel Raynal <miquel.raynal@bootlin.com>

tree:   https://github.com/miquelraynal/linux-0day.git nand/next
head:   b44e912a80e34026f5f7548e7c76d31cee3b4093
commit: 731717c4e5ac208a3bb6e928d56e05ff12447fd6 [15/38] mtd: nand: ecc-hamming: Rename the exported functions
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-randconfig-m021-20201028 (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>

smatch warnings:
drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.

vim +/rp17 +348 drivers/mtd/nand/ecc-sw-hamming.c

e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  282  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  283  	/* finally reduce par to 8 bits */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  284  	par ^= (par >> 8);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  285  	par &= 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  286  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  287  	/*
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  288  	 * and calculate rp5..rp15..rp17
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  289  	 * note that par = rp4 ^ rp5 and due to the commutative property
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  290  	 * of the ^ operator we can say:
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  291  	 * rp5 = (par ^ rp4);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  292  	 * The & 0xff seems superfluous, but benchmarking learned that
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  293  	 * leaving it out gives slightly worse results. No idea why, probably
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  294  	 * it has to do with the way the pipeline in pentium is organized.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  295  	 */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  296  	rp5 = (par ^ rp4) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  297  	rp7 = (par ^ rp6) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  298  	rp9 = (par ^ rp8) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  299  	rp11 = (par ^ rp10) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  300  	rp13 = (par ^ rp12) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  301  	rp15 = (par ^ rp14) & 0xff;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  302  	if (eccsize_mult == 2)
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  303  		rp17 = (par ^ rp16) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  304  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  305  	/*
7854d3f7495b11b drivers/mtd/nand/nand_ecc.c       Brian Norris    2011-06-23  306  	 * Finally calculate the ECC bits.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  307  	 * Again here it might seem that there are performance optimisations
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  308  	 * possible, but benchmarks showed that on the system this is developed
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  309  	 * the code below is the fastest
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  310  	 */
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  311  	if (sm_order) {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  312  		code[0] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  313  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  314  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  315  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  316  		code[1] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  317  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  318  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  319  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  320  	} else {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  321  		code[1] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  322  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  323  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  324  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  325  		code[0] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  326  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  327  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  328  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  329  	}
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  330  
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  331  	if (eccsize_mult == 1)
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  332  		code[2] =
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  333  		    (invparity[par & 0xf0] << 7) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  334  		    (invparity[par & 0x0f] << 6) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  335  		    (invparity[par & 0xcc] << 5) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  336  		    (invparity[par & 0x33] << 4) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  337  		    (invparity[par & 0xaa] << 3) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  338  		    (invparity[par & 0x55] << 2) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  339  		    3;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  340  	else
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  341  		code[2] =
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  342  		    (invparity[par & 0xf0] << 7) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  343  		    (invparity[par & 0x0f] << 6) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  344  		    (invparity[par & 0xcc] << 5) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  345  		    (invparity[par & 0x33] << 4) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  346  		    (invparity[par & 0xaa] << 3) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  347  		    (invparity[par & 0x55] << 2) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23 @348  		    (invparity[rp17] << 1) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  349  		    (invparity[rp16] << 0);
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  350  
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  351  	return 0;
1c63aca32903efc drivers/mtd/nand/nand_ecc.c       Akinobu Mita    2009-10-22  352  }
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  353  EXPORT_SYMBOL(ecc_sw_hamming_calculate);
1c63aca32903efc drivers/mtd/nand/nand_ecc.c       Akinobu Mita    2009-10-22  354  

:::::: The code@line 348 was first introduced by commit
:::::: d68156cfad0fe09201dd049fff167a8a881427ad [MTD] [NAND] nand_ecc.c: adding support for 512 byte ecc

:::::: TO: Singh, Vimal <vimalsingh@ti.com>
:::::: CC: David Woodhouse <David.Woodhouse@intel.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [miquelraynal:nand/next 15/38] drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.
@ 2020-10-28 19:45 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-10-28 19:45 UTC (permalink / raw
  To: kbuild-all

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

tree:   https://github.com/miquelraynal/linux-0day.git nand/next
head:   b44e912a80e34026f5f7548e7c76d31cee3b4093
commit: 731717c4e5ac208a3bb6e928d56e05ff12447fd6 [15/38] mtd: nand: ecc-hamming: Rename the exported functions
config: i386-randconfig-m021-20201028 (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>

smatch warnings:
drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.

vim +/rp17 +348 drivers/mtd/nand/ecc-sw-hamming.c

e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  282  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  283  	/* finally reduce par to 8 bits */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  284  	par ^= (par >> 8);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  285  	par &= 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  286  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  287  	/*
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  288  	 * and calculate rp5..rp15..rp17
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  289  	 * note that par = rp4 ^ rp5 and due to the commutative property
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  290  	 * of the ^ operator we can say:
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  291  	 * rp5 = (par ^ rp4);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  292  	 * The & 0xff seems superfluous, but benchmarking learned that
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  293  	 * leaving it out gives slightly worse results. No idea why, probably
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  294  	 * it has to do with the way the pipeline in pentium is organized.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  295  	 */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  296  	rp5 = (par ^ rp4) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  297  	rp7 = (par ^ rp6) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  298  	rp9 = (par ^ rp8) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  299  	rp11 = (par ^ rp10) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  300  	rp13 = (par ^ rp12) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  301  	rp15 = (par ^ rp14) & 0xff;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  302  	if (eccsize_mult == 2)
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  303  		rp17 = (par ^ rp16) & 0xff;

"rp17" not set on else path.

e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  304  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  305  	/*
7854d3f7495b11b drivers/mtd/nand/nand_ecc.c       Brian Norris    2011-06-23  306  	 * Finally calculate the ECC bits.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  307  	 * Again here it might seem that there are performance optimisations
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  308  	 * possible, but benchmarks showed that on the system this is developed
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  309  	 * the code below is the fastest
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  310  	 */
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  311  	if (sm_order) {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  312  		code[0] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  313  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  314  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  315  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  316  		code[1] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  317  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  318  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  319  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  320  	} else {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  321  		code[1] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  322  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  323  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  324  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  325  		code[0] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  326  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  327  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  328  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  329  	}
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  330  
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  331  	if (eccsize_mult == 1)
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  332  		code[2] =
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  333  		    (invparity[par & 0xf0] << 7) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  334  		    (invparity[par & 0x0f] << 6) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  335  		    (invparity[par & 0xcc] << 5) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  336  		    (invparity[par & 0x33] << 4) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  337  		    (invparity[par & 0xaa] << 3) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  338  		    (invparity[par & 0x55] << 2) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  339  		    3;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  340  	else
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  341  		code[2] =
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  342  		    (invparity[par & 0xf0] << 7) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  343  		    (invparity[par & 0x0f] << 6) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  344  		    (invparity[par & 0xcc] << 5) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  345  		    (invparity[par & 0x33] << 4) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  346  		    (invparity[par & 0xaa] << 3) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  347  		    (invparity[par & 0x55] << 2) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23 @348  		    (invparity[rp17] << 1) |

Are the only possible values for "eccsize_mult" 1 and 2?  If so then
this code is fine.  It's hard to tell just from looking, though.

d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  349  		    (invparity[rp16] << 0);
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  350  
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  351  	return 0;
1c63aca32903efc drivers/mtd/nand/nand_ecc.c       Akinobu Mita    2009-10-22  352  }

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [miquelraynal:nand/next 15/38] drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.
@ 2020-10-28 19:45 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-10-28 19:45 UTC (permalink / raw
  To: kbuild

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

tree:   https://github.com/miquelraynal/linux-0day.git nand/next
head:   b44e912a80e34026f5f7548e7c76d31cee3b4093
commit: 731717c4e5ac208a3bb6e928d56e05ff12447fd6 [15/38] mtd: nand: ecc-hamming: Rename the exported functions
config: i386-randconfig-m021-20201028 (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>

smatch warnings:
drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17'.

vim +/rp17 +348 drivers/mtd/nand/ecc-sw-hamming.c

e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  282  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  283  	/* finally reduce par to 8 bits */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  284  	par ^= (par >> 8);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  285  	par &= 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  286  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  287  	/*
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  288  	 * and calculate rp5..rp15..rp17
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  289  	 * note that par = rp4 ^ rp5 and due to the commutative property
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  290  	 * of the ^ operator we can say:
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  291  	 * rp5 = (par ^ rp4);
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  292  	 * The & 0xff seems superfluous, but benchmarking learned that
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  293  	 * leaving it out gives slightly worse results. No idea why, probably
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  294  	 * it has to do with the way the pipeline in pentium is organized.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  295  	 */
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  296  	rp5 = (par ^ rp4) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  297  	rp7 = (par ^ rp6) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  298  	rp9 = (par ^ rp8) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  299  	rp11 = (par ^ rp10) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  300  	rp13 = (par ^ rp12) & 0xff;
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  301  	rp15 = (par ^ rp14) & 0xff;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  302  	if (eccsize_mult == 2)
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  303  		rp17 = (par ^ rp16) & 0xff;

"rp17" not set on else path.

e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  304  
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  305  	/*
7854d3f7495b11b drivers/mtd/nand/nand_ecc.c       Brian Norris    2011-06-23  306  	 * Finally calculate the ECC bits.
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  307  	 * Again here it might seem that there are performance optimisations
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  308  	 * possible, but benchmarks showed that on the system this is developed
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  309  	 * the code below is the fastest
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  310  	 */
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  311  	if (sm_order) {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  312  		code[0] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  313  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  314  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  315  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  316  		code[1] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  317  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  318  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  319  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  320  	} else {
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  321  		code[1] = (invparity[rp7] << 7) | (invparity[rp6] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  322  			  (invparity[rp5] << 5) | (invparity[rp4] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  323  			  (invparity[rp3] << 3) | (invparity[rp2] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  324  			  (invparity[rp1] << 1) | (invparity[rp0]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  325  		code[0] = (invparity[rp15] << 7) | (invparity[rp14] << 6) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  326  			  (invparity[rp13] << 5) | (invparity[rp12] << 4) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  327  			  (invparity[rp11] << 3) | (invparity[rp10] << 2) |
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  328  			  (invparity[rp9] << 1) | (invparity[rp8]);
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  329  	}
309600c14e36d0e drivers/mtd/nand/raw/nand_ecc.c   Boris Brezillon 2018-09-04  330  
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  331  	if (eccsize_mult == 1)
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  332  		code[2] =
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  333  		    (invparity[par & 0xf0] << 7) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  334  		    (invparity[par & 0x0f] << 6) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  335  		    (invparity[par & 0xcc] << 5) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  336  		    (invparity[par & 0x33] << 4) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  337  		    (invparity[par & 0xaa] << 3) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  338  		    (invparity[par & 0x55] << 2) |
e6cf5df1838c28b drivers/mtd/nand/nand_ecc.c       frans           2008-08-15  339  		    3;
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  340  	else
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  341  		code[2] =
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  342  		    (invparity[par & 0xf0] << 7) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  343  		    (invparity[par & 0x0f] << 6) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  344  		    (invparity[par & 0xcc] << 5) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  345  		    (invparity[par & 0x33] << 4) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  346  		    (invparity[par & 0xaa] << 3) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  347  		    (invparity[par & 0x55] << 2) |
d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23 @348  		    (invparity[rp17] << 1) |

Are the only possible values for "eccsize_mult" 1 and 2?  If so then
this code is fine.  It's hard to tell just from looking, though.

d68156cfad0fe09 drivers/mtd/nand/nand_ecc.c       Singh, Vimal    2008-08-23  349  		    (invparity[rp16] << 0);
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  350  
731717c4e5ac208 drivers/mtd/nand/ecc-sw-hamming.c Miquel Raynal   2020-09-30  351  	return 0;
1c63aca32903efc drivers/mtd/nand/nand_ecc.c       Akinobu Mita    2009-10-22  352  }

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-28 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-28 19:45 [miquelraynal:nand/next 15/38] drivers/mtd/nand/ecc-sw-hamming.c:348 ecc_sw_hamming_calculate() error: uninitialized symbol 'rp17' Dan Carpenter
2020-10-28 19:45 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-10-28 18:27 kernel test robot

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.