Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752251AbaFATg7 (ORCPT ); Sun, 1 Jun 2014 15:36:59 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:34740 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512AbaFATg6 (ORCPT ); Sun, 1 Jun 2014 15:36:58 -0400 MIME-Version: 1.0 In-Reply-To: References: <1401626055-15144-1-git-send-email-rickard_strandqvist@spectrumdigital.se> Date: Sun, 1 Jun 2014 21:36:57 +0200 Message-ID: Subject: Re: [PATCH] net: ethernet: chelsio: cxgb4: t4_hw.c: Cleaning up uninitialized variables From: Rickard Strandqvist To: Dimitrios Michailidis Cc: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dimitrios! Okay sorry, I see what you mean... Best regards Rickard Strandqvist 2014-06-01 21:11 GMT+02:00 Dimitrios Michailidis : > Rickard Strandqvist wrote: >> There is a risk that the variable will be used without being initialized. > > There isn't actual risk here, this variable is not used uninitialized AFAICS. > >> This was largely found by using a static code analysis program called cppcheck. > > It seems this is a false inference by the tool. I think the preferred method to suppress false tool warnings is to use uninitialized_var. > >> Signed-off-by: Rickard Strandqvist >> --- >> drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c >> b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c >> index bba6768..326c005 100644 >> --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c >> +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c >> @@ -571,7 +571,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool >> enable) >> */ >> int get_vpd_params(struct adapter *adapter, struct vpd_params *p) >> { >> - u32 cclk_param, cclk_val; >> + u32 cclk_param, cclk_val = 0; >> int i, ret, addr; >> int ec, sn, pn; >> u8 *vpd, csum; >> -- >> 1.7.10.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/