Re: [PATCH v2 1/2] crypto: hisilicon - Add HiSilicon ADVCA Subsystem

From: kernel test robot
Date: Sat May 13 2023 - 04:43:21 EST


Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 9a48d604672220545d209e9996c2a1edbb5637f6]

url: https://github.com/intel-lab-lkp/linux/commits/David-Yang/crypto-hisilicon-Add-HiSilicon-ADVCA-Subsystem/20230513-154545
base: 9a48d604672220545d209e9996c2a1edbb5637f6
patch link: https://lore.kernel.org/r/20230513074339.266879-2-mmyangfl%40gmail.com
patch subject: [PATCH v2 1/2] crypto: hisilicon - Add HiSilicon ADVCA Subsystem
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20230513/202305131630.Wt74Rpda-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/6f6cb7dd5da91063c560d2d252104268ffac785b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review David-Yang/crypto-hisilicon-Add-HiSilicon-ADVCA-Subsystem/20230513-154545
git checkout 6f6cb7dd5da91063c560d2d252104268ffac785b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/crypto/hisilicon/advca/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202305131630.Wt74Rpda-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/crypto/hisilicon/advca/hisi-advca-muc.c:77:41: warning: unsigned conversion from 'int' to 'unsigned char:2' changes value from '4' to '0' [-Woverflow]
77 | #define MUC_MODE_CTR 4 /* not for DES */
| ^
drivers/crypto/hisilicon/advca/hisi-advca-muc.c:1283:25: note: in expansion of macro 'MUC_MODE_CTR'
1283 | .mode = MUC_MODE_##_MODE, \
| ^~~~~~~~~
drivers/crypto/hisilicon/advca/hisi-advca-muc.c:1298:9: note: in expansion of macro 'hica_muc_tmpl_define'
1298 | hica_muc_tmpl_define(AES, _MODE, aes, _mode, AES_MIN_KEY_SIZE, \
| ^~~~~~~~~~~~~~~~~~~~
drivers/crypto/hisilicon/advca/hisi-advca-muc.c:1311:9: note: in expansion of macro 'hica_muc_tmpl_define_aes'
1311 | hica_muc_tmpl_define_aes(CTR, ctr),
| ^~~~~~~~~~~~~~~~~~~~~~~~


vim +77 drivers/crypto/hisilicon/advca/hisi-advca-muc.c

69
70 /* for CTRL reg */
71 #define MUC_DECRYPT BIT(0)
72 #define MUC_MODE GENMASK(3, 1) /* other: as 0 */
73 #define MUC_MODE_ECB 0
74 #define MUC_MODE_CBC 1
75 #define MUC_MODE_CFB 2
76 #define MUC_MODE_OFB 3
> 77 #define MUC_MODE_CTR 4 /* not for DES */
78 #define MUC_ALG GENMASK(5, 4) /* other: as 0 */
79 #define MUC_ALG_DES 0
80 #define MUC_ALG_DES3_EDE 1
81 #define MUC_ALG_AES 2
82 #define MUC_WIDTH GENMASK(7, 6) /* other: as 0 */
83 #define MUC_WIDTH_BLOCK 0
84 #define MUC_WIDTH_8B 1
85 #define MUC_WIDTH_1B 2
86 #define MUC_CHAN0_IV_CHANGE BIT(8)
87 #define MUC_KEY GENMASK(10, 9) /* other: as 0 */
88 #define MUC_KEY_AES_128B 0
89 #define MUC_KEY_AES_192B 1
90 #define MUC_KEY_AES_256B 2
91 #define MUC_KEY_DES 0
92 #define MUC_KEY_DES3_EDE_3KEY 0
93 #define MUC_KEY_DES3_EDE_2KEY 3
94 #define MUC_KEY_FROM_MKL BIT(13)
95 #define MUC_KEY_ID GENMASK(16, 14)
96 #define MUC_WEIGHT GENMASK(31, 22)
97

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests