public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Harald Freudenberger <freude@linux.ibm.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read() warn: inconsistent indenting
Date: Fri, 12 Jun 2020 01:43:03 +0800	[thread overview]
Message-ID: <202006120100.vAwRFHVk%lkp@intel.com> (raw)

[-- 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 --]

                 reply	other threads:[~2020-06-11 17:44 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=202006120100.vAwRFHVk%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=freude@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox