From: Viral Mehta <redacted>
Date: Wed, 7 Nov 2012 16:42:09 +0530
Hi,
On Tue, Nov 6, 2012 at 7:07 PM, Vipul Pandya [off-list ref] wrote:
quoted
We should not assume reserve fields to be don't cares as fields may change.
Clearing data structures before using.
Signed-off-by: Jay Hernandez <redacted>
Signed-off-by: Vipul Pandya <redacted>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 32eec15..01fa5b7 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -2519,6 +2519,7 @@ int t4_fw_bye(struct adapter *adap, unsigned int mbox)
{
struct fw_bye_cmd c;
+ memset(&c, 0, sizeof(c));
struct fw_byte_cmd c = {0};
Isn't it better ?
There is no fundamental difference, as far as the compiler and
optimizations are concerned, it's pretty much identical.