On Wed, Jan 06, 2021 at 04:12:18PM +0530, Srujana Challa wrote:
quoted hunk ↗ jump to hunk
+static int cpt_ucode_load_fw(struct pci_dev *pdev, struct fw_info_t *fw_info)
+{
+ char filename[OTX2_CPT_NAME_LENGTH];
+ char eng_type[8] = {0};
+ int ret, e, i;
+
+ INIT_LIST_HEAD(&fw_info->ucodes);
+
+ for (e = 1; e < OTX2_CPT_MAX_ENG_TYPES; e++) {
+ strncpy(eng_type, get_eng_type_str(e), 2);
This triggers a compiler warning:
../drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c: In function ‘cpt_ucode_load_fw’:
../drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c:408:3: warning: ‘strncpy’ output may be truncated copying 2 bytes from a string of length 2 [-Wstringop-truncation]
strncpy(eng_type, get_eng_type_str(e), 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please fix. Thanks,
--
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt