* [PATCH] net/cxgbe: fix warnings when using optimization=1 flag
@ 2022-06-09 8:49 Rahul Lakkireddy
2022-06-09 14:02 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Rahul Lakkireddy @ 2022-06-09 8:49 UTC (permalink / raw)
To: dev; +Cc: daxuex.gao
Initialize maddr and mtype to fix following warnings when
using optimization=1 compilation flag.
In file included from ../drivers/net/cxgbe/base/common.h:13,
from ../drivers/net/cxgbe/cxgbe_main.c:37:
../drivers/net/cxgbe/cxgbe_main.c: In function ‘cxgbe_probe’:
../drivers/net/cxgbe/base/t4fw_interface.h:656:7: warning: ‘maddr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
^~
../drivers/net/cxgbe/cxgbe_main.c:1111:40: note: ‘maddr’ was declared here
u32 finiver, finicsum, cfcsum, mtype, maddr, param, val;
^~~~~
In file included from ../drivers/net/cxgbe/base/common.h:13,
from ../drivers/net/cxgbe/cxgbe_main.c:37:
../drivers/net/cxgbe/base/t4fw_interface.h:648:7: warning: ‘mtype’ may be used uninitialized in this function [-Wmaybe-uninitialized]
((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
^~
../drivers/net/cxgbe/cxgbe_main.c:1111:33: note: ‘mtype’ was declared here
u32 finiver, finicsum, cfcsum, mtype, maddr, param, val;
^~~~~
Bugzilla ID: 1029
Fixes: 6d7d651bbc15 ("net/cxgbe: read firmware configuration file from filesystem")
Reported-by: Daxue Gao <daxuex.gao@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
drivers/net/cxgbe/cxgbe_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 7b162af3e7..3c02c98b3d 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -1108,9 +1108,10 @@ static int cxgbe_load_fw_config_from_filesystem(struct adapter *adap,
static int cxgbe_load_fw_config(struct adapter *adap)
{
- u32 finiver, finicsum, cfcsum, mtype, maddr, param, val;
struct fw_caps_config_cmd caps_cmd = { 0 };
+ u32 finiver, finicsum, cfcsum, param, val;
const char *config_name = NULL;
+ u32 mtype = 0, maddr = 0;
int ret;
ret = cxgbe_load_fw_config_from_filesystem(adap, &config_name,
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/cxgbe: fix warnings when using optimization=1 flag
2022-06-09 8:49 [PATCH] net/cxgbe: fix warnings when using optimization=1 flag Rahul Lakkireddy
@ 2022-06-09 14:02 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2022-06-09 14:02 UTC (permalink / raw)
To: Rahul Lakkireddy; +Cc: daxuex.gao, dev
On 6/9/2022 9:49 AM, Rahul Lakkireddy wrote:
> Initialize maddr and mtype to fix following warnings when
> using optimization=1 compilation flag.
>
> In file included from ../drivers/net/cxgbe/base/common.h:13,
> from ../drivers/net/cxgbe/cxgbe_main.c:37:
> ../drivers/net/cxgbe/cxgbe_main.c: In function ‘cxgbe_probe’:
> ../drivers/net/cxgbe/base/t4fw_interface.h:656:7: warning: ‘maddr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> ((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
> ^~
> ../drivers/net/cxgbe/cxgbe_main.c:1111:40: note: ‘maddr’ was declared here
> u32 finiver, finicsum, cfcsum, mtype, maddr, param, val;
> ^~~~~
> In file included from ../drivers/net/cxgbe/base/common.h:13,
> from ../drivers/net/cxgbe/cxgbe_main.c:37:
> ../drivers/net/cxgbe/base/t4fw_interface.h:648:7: warning: ‘mtype’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> ((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
> ^~
> ../drivers/net/cxgbe/cxgbe_main.c:1111:33: note: ‘mtype’ was declared here
> u32 finiver, finicsum, cfcsum, mtype, maddr, param, val;
> ^~~~~
> Bugzilla ID: 1029
> Fixes: 6d7d651bbc15 ("net/cxgbe: read firmware configuration file from filesystem")
>
> Reported-by: Daxue Gao<daxuex.gao@intel.com>
> Signed-off-by: Rahul Lakkireddy<rahul.lakkireddy@chelsio.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-09 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 8:49 [PATCH] net/cxgbe: fix warnings when using optimization=1 flag Rahul Lakkireddy
2022-06-09 14:02 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).