linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read() warn: inconsistent indenting
@ 2020-06-11 17:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-06-11 17:43 UTC (permalink / raw)
  To: Harald Freudenberger; +Cc: kbuild-all, linux-kernel, Vasily Gorbik

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b29482fde649c72441d5478a4ea2c52c56d97a5e
commit: 55d0a513a0e202c68af2c8f4b1e923a345227bbb s390/pkey/zcrypt: Support EP11 AES secure keys
date:   4 months ago
config: s390-randconfig-m031-20200611 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0

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

smatch warnings:
drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read() warn: inconsistent indenting

vim +1606 drivers/s390/crypto/pkey_api.c

f71fee2711a788 Ingo Franzki         2019-08-20  1569  
f71fee2711a788 Ingo Franzki         2019-08-20  1570  /*
f71fee2711a788 Ingo Franzki         2019-08-20  1571   * Sysfs attribute read function for all secure key ccacipher binary attributes.
f71fee2711a788 Ingo Franzki         2019-08-20  1572   * The implementation can not deal with partial reads, because a new random
f71fee2711a788 Ingo Franzki         2019-08-20  1573   * secure key blob is generated with each read. In case of partial reads
f71fee2711a788 Ingo Franzki         2019-08-20  1574   * (i.e. off != 0 or count < key blob size) -EINVAL is returned.
f71fee2711a788 Ingo Franzki         2019-08-20  1575   */
f71fee2711a788 Ingo Franzki         2019-08-20  1576  static ssize_t pkey_ccacipher_aes_attr_read(enum pkey_key_size keybits,
f71fee2711a788 Ingo Franzki         2019-08-20  1577  					    bool is_xts, char *buf, loff_t off,
f71fee2711a788 Ingo Franzki         2019-08-20  1578  					    size_t count)
f71fee2711a788 Ingo Franzki         2019-08-20  1579  {
55d0a513a0e202 Harald Freudenberger 2019-12-06  1580  	int i, rc, card, dom;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1581  	u32 nr_apqns, *apqns = NULL;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1582  	size_t keysize = CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki         2019-08-20  1583  
f71fee2711a788 Ingo Franzki         2019-08-20  1584  	if (off != 0 || count < CCACIPHERTOKENSIZE)
f71fee2711a788 Ingo Franzki         2019-08-20  1585  		return -EINVAL;
f71fee2711a788 Ingo Franzki         2019-08-20  1586  	if (is_xts)
f71fee2711a788 Ingo Franzki         2019-08-20  1587  		if (count < 2 * CCACIPHERTOKENSIZE)
f71fee2711a788 Ingo Franzki         2019-08-20  1588  			return -EINVAL;
f71fee2711a788 Ingo Franzki         2019-08-20  1589  
55d0a513a0e202 Harald Freudenberger 2019-12-06  1590  	/* build a list of apqns able to generate an cipher key */
55d0a513a0e202 Harald Freudenberger 2019-12-06  1591  	rc = cca_findcard2(&apqns, &nr_apqns, 0xFFFF, 0xFFFF,
55d0a513a0e202 Harald Freudenberger 2019-12-06  1592  			   ZCRYPT_CEX6, 0, 0, 0);
f71fee2711a788 Ingo Franzki         2019-08-20  1593  	if (rc)
f71fee2711a788 Ingo Franzki         2019-08-20  1594  		return rc;
f71fee2711a788 Ingo Franzki         2019-08-20  1595  
55d0a513a0e202 Harald Freudenberger 2019-12-06  1596  	memset(buf, 0, is_xts ? 2 * keysize : keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06  1597  
55d0a513a0e202 Harald Freudenberger 2019-12-06  1598  	/* simple try all apqns from the list */
55d0a513a0e202 Harald Freudenberger 2019-12-06  1599  	for (i = 0, rc = -ENODEV; i < nr_apqns; i++) {
55d0a513a0e202 Harald Freudenberger 2019-12-06  1600  		card = apqns[i] >> 16;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1601  		dom = apqns[i] & 0xFFFF;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1602  		rc = cca_gencipherkey(card, dom, keybits, 0, buf, &keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06  1603  		if (rc == 0)
55d0a513a0e202 Harald Freudenberger 2019-12-06  1604  			break;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1605  	}
f71fee2711a788 Ingo Franzki         2019-08-20 @1606  		if (rc)
f71fee2711a788 Ingo Franzki         2019-08-20  1607  			return rc;
f71fee2711a788 Ingo Franzki         2019-08-20  1608  
55d0a513a0e202 Harald Freudenberger 2019-12-06  1609  	if (is_xts) {
55d0a513a0e202 Harald Freudenberger 2019-12-06  1610  		keysize = CCACIPHERTOKENSIZE;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1611  		buf += CCACIPHERTOKENSIZE;
55d0a513a0e202 Harald Freudenberger 2019-12-06  1612  		rc = cca_gencipherkey(card, dom, keybits, 0, buf, &keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06  1613  		if (rc == 0)
f71fee2711a788 Ingo Franzki         2019-08-20  1614  			return 2 * CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki         2019-08-20  1615  	}
f71fee2711a788 Ingo Franzki         2019-08-20  1616  
f71fee2711a788 Ingo Franzki         2019-08-20  1617  	return CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki         2019-08-20  1618  }
f71fee2711a788 Ingo Franzki         2019-08-20  1619  

:::::: The code at line 1606 was first introduced by commit
:::::: f71fee2711a788b94ff0acb02fbd2bfe2de7e0a3 s390/pkey: Add sysfs attributes to emit AES CIPHER key blobs

:::::: TO: Ingo Franzki <ifranzki@linux.ibm.com>
:::::: CC: Vasily Gorbik <gor@linux.ibm.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-11 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 17:43 drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read() warn: inconsistent indenting kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).