net/bnxt: fix build
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 8 Jul 2021 22:09:18 +0000 (15:09 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 9 Jul 2021 20:34:06 +0000 (22:34 +0200)
commit72d7b5959fa5ebceb6175757ea6c1a46a4ffd4bc
tree4e24f8280bbce9664e01500630b55a4c49343433
parent699fa1d40eeabe086d4491a0b4edd7a0a19e6aa7
net/bnxt: fix build

Fix build failures seen on Fedora Core 34 (GCC 11)
because of uninitialized variables.

In function ‘ulp_mapper_index_tbl_process’:
drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error:
‘*(unsigned int *)((char *)&glb_res + offsetof(struct bnxt_ulp_glb_resource_info, resource_func))’
may be used uninitialized in this function
 2252 |         struct bnxt_ulp_glb_resource_info glb_res;
      |                                           ^~~~~~~
drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error:
‘glb_res.resource_type’ may be used uninitialized in this function

In function ‘dpool_defrag’:
drivers/net/bnxt/tf_core/dpool.c:95:18: error:
‘index’ may be used uninitialized in this function
   95 |         uint32_t index;
      |                  ^~~~~

Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/tf_core/dpool.c
drivers/net/bnxt/tf_ulp/ulp_mapper.c