From: kbuild test robot <lkp@intel.com>
To: Yael Chemla <yael.chemla@foss.arm.com>
Cc: kbuild-all@01.org, Gilad Ben-Yossef <gilad@benyossef.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, Ofir Drang <ofir.drang@arm.com>,
linux-kernel@vger.kernel.org,
Yael Chemla <yael.chemla@foss.arm.com>
Subject: Re: [PATCH 3/3] crypto: ccree: add SM3 support
Date: Fri, 19 Oct 2018 07:36:32 +0800 [thread overview]
Message-ID: <201810190734.gAC1zWwm%fengguang.wu@intel.com> (raw)
In-Reply-To: <1539867599-20504-4-git-send-email-yael.chemla@foss.arm.com>
[-- Attachment #1: Type: text/plain, Size: 6710 bytes --]
Hi Yael,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on crypto/master]
[also build test WARNING on v4.19-rc8 next-20181018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Yael-Chemla/crypto-ccree-add-SM3-support/20181019-042354
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git master
config: i386-randconfig-x019-201841 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/crypto/ccree/cc_hash.c:1729:17: error: 'CC_HW_REV_713' undeclared here (not in a function); did you mean 'CC_HW_REV_712'?
.min_hw_rev = CC_HW_REV_713,
^~~~~~~~~~~~~
CC_HW_REV_712
drivers/crypto/ccree/cc_hash.c: In function 'cc_init_hash_sram':
drivers/crypto/ccree/cc_hash.c:1832:40: warning: comparison between pointer and integer
bool sm3_supported = (drvdata->hw_rev >= CC_HW_REV_713);
^~
In file included from include/linux/kernel.h:10:0,
from drivers/crypto/ccree/cc_hash.c:4:
drivers/crypto/ccree/cc_hash.c: In function 'cc_hash_alloc':
drivers/crypto/ccree/cc_hash.c:1975:22: warning: comparison between pointer and integer
if (drvdata->hw_rev >= CC_HW_REV_713)
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/crypto/ccree/cc_hash.c:1975:2: note: in expansion of macro 'if'
if (drvdata->hw_rev >= CC_HW_REV_713)
^~
drivers/crypto/ccree/cc_hash.c:1975:22: warning: comparison between pointer and integer
if (drvdata->hw_rev >= CC_HW_REV_713)
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/crypto/ccree/cc_hash.c:1975:2: note: in expansion of macro 'if'
if (drvdata->hw_rev >= CC_HW_REV_713)
^~
drivers/crypto/ccree/cc_hash.c:1975:22: warning: comparison between pointer and integer
if (drvdata->hw_rev >= CC_HW_REV_713)
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> drivers/crypto/ccree/cc_hash.c:1975:2: note: in expansion of macro 'if'
if (drvdata->hw_rev >= CC_HW_REV_713)
^~
drivers/crypto/ccree/cc_hash.c: In function 'cc_larval_digest_addr':
drivers/crypto/ccree/cc_hash.c:2252:41: warning: comparison between pointer and integer
bool sm3_supported = (_drvdata->hw_rev >= CC_HW_REV_713);
^~
vim +/if +1975 drivers/crypto/ccree/cc_hash.c
1952
1953 int cc_hash_alloc(struct cc_drvdata *drvdata)
1954 {
1955 struct cc_hash_handle *hash_handle;
1956 cc_sram_addr_t sram_buff;
1957 u32 sram_size_to_alloc;
1958 struct device *dev = drvdata_to_dev(drvdata);
1959 int rc = 0;
1960 int alg;
1961
1962 hash_handle = kzalloc(sizeof(*hash_handle), GFP_KERNEL);
1963 if (!hash_handle)
1964 return -ENOMEM;
1965
1966 INIT_LIST_HEAD(&hash_handle->hash_list);
1967 drvdata->hash_handle = hash_handle;
1968
1969 sram_size_to_alloc = sizeof(digest_len_init) +
1970 sizeof(md5_init) +
1971 sizeof(sha1_init) +
1972 sizeof(sha224_init) +
1973 sizeof(sha256_init);
1974
> 1975 if (drvdata->hw_rev >= CC_HW_REV_713)
1976 sram_size_to_alloc += sizeof(sm3_init);
1977
1978 if (drvdata->hw_rev >= CC_HW_REV_712)
1979 sram_size_to_alloc += sizeof(digest_len_sha512_init) +
1980 sizeof(sha384_init) + sizeof(sha512_init);
1981
1982 sram_buff = cc_sram_alloc(drvdata, sram_size_to_alloc);
1983 if (sram_buff == NULL_SRAM_ADDR) {
1984 dev_err(dev, "SRAM pool exhausted\n");
1985 rc = -ENOMEM;
1986 goto fail;
1987 }
1988
1989 /* The initial digest-len offset */
1990 hash_handle->digest_len_sram_addr = sram_buff;
1991
1992 /*must be set before the alg registration as it is being used there*/
1993 rc = cc_init_hash_sram(drvdata);
1994 if (rc) {
1995 dev_err(dev, "Init digest CONST failed (rc=%d)\n", rc);
1996 goto fail;
1997 }
1998
1999 /* ahash registration */
2000 for (alg = 0; alg < ARRAY_SIZE(driver_hash); alg++) {
2001 struct cc_hash_alg *t_alg;
2002 int hw_mode = driver_hash[alg].hw_mode;
2003
2004 /* We either support both HASH and MAC or none */
2005 if (driver_hash[alg].min_hw_rev > drvdata->hw_rev)
2006 continue;
2007 if (driver_hash[alg].is_mac) {
2008 /* register hmac version */
2009 t_alg = cc_alloc_hash_alg(&driver_hash[alg], dev, true);
2010 if (IS_ERR(t_alg)) {
2011 rc = PTR_ERR(t_alg);
2012 dev_err(dev, "%s alg allocation failed\n",
2013 driver_hash[alg].driver_name);
2014 goto fail;
2015 }
2016 t_alg->drvdata = drvdata;
2017
2018 rc = crypto_register_ahash(&t_alg->ahash_alg);
2019 if (rc) {
2020 dev_err(dev, "%s alg registration failed\n",
2021 driver_hash[alg].driver_name);
2022 kfree(t_alg);
2023 goto fail;
2024 } else {
2025 list_add_tail(&t_alg->entry,
2026 &hash_handle->hash_list);
2027 }
2028 }
2029 if (hw_mode == DRV_CIPHER_XCBC_MAC ||
2030 hw_mode == DRV_CIPHER_CMAC)
2031 continue;
2032
2033 /* register hash version */
2034 t_alg = cc_alloc_hash_alg(&driver_hash[alg], dev, false);
2035 if (IS_ERR(t_alg)) {
2036 rc = PTR_ERR(t_alg);
2037 dev_err(dev, "%s alg allocation failed\n",
2038 driver_hash[alg].driver_name);
2039 goto fail;
2040 }
2041 t_alg->drvdata = drvdata;
2042
2043 rc = crypto_register_ahash(&t_alg->ahash_alg);
2044 if (rc) {
2045 dev_err(dev, "%s alg registration failed\n",
2046 driver_hash[alg].driver_name);
2047 kfree(t_alg);
2048 goto fail;
2049 } else {
2050 list_add_tail(&t_alg->entry, &hash_handle->hash_list);
2051 }
2052 }
2053
2054 return 0;
2055
2056 fail:
2057 kfree(drvdata->hash_handle);
2058 drvdata->hash_handle = NULL;
2059 return rc;
2060 }
2061
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27996 bytes --]
next prev parent reply other threads:[~2018-10-18 23:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 12:59 [PATCH 0/3] " Yael Chemla
2018-10-18 12:59 ` [PATCH 1/3] crypto: ccree: adjust hash length to suit certain context specifics Yael Chemla
2018-10-18 12:59 ` [PATCH 2/3] crypto: ccree: modify set_cipher_mode usage from cc_hash Yael Chemla
2018-10-18 12:59 ` [PATCH 3/3] crypto: ccree: add SM3 support Yael Chemla
2018-10-18 23:36 ` kbuild test robot [this message]
2018-10-18 23:55 ` kbuild test robot
2018-10-18 13:26 ` [PATCH 0/3] " Gilad Ben-Yossef
2018-10-21 7:06 ` yael.chemla
2018-11-09 9:51 ` Herbert Xu
-- strict thread matches above, loose matches on Subject: below --
2018-10-18 12:56 Yael Chemla
2018-10-18 12:56 ` [PATCH 3/3] " Yael Chemla
2018-10-18 19:57 ` kbuild test robot
2018-10-18 20:46 ` yael.chemla
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=201810190734.gAC1zWwm%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=davem@davemloft.net \
--cc=gilad@benyossef.com \
--cc=herbert@gondor.apana.org.au \
--cc=kbuild-all@01.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ofir.drang@arm.com \
--cc=yael.chemla@foss.arm.com \
/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
all inboxes | Powered by JetHome®