From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BF153A0350; Wed, 24 Jun 2020 10:04:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E32581D92B; Wed, 24 Jun 2020 10:01:52 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 291CC1D91A for ; Wed, 24 Jun 2020 10:01:50 +0200 (CEST) IronPort-SDR: KV8wiWv6GAtc4UrVDmo6j5h2ejSfPvD/P0GTBdbBVwdVs7MHRhG9Ijyl8qzDWuXH/X0UCyqsqc IERpGTXTIKww== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="143472872" X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="143472872" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 01:01:49 -0700 IronPort-SDR: FaefstpdF/OkiQoGKPDWHEs4UxbM9X6z2ILNhEt4kCf3pQs1hpPtkZuvnXaV/5qv6kVcvfNDIF RsgD2YbiWRzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="385102712" Received: from intel.sh.intel.com ([10.239.255.48]) by fmsmga001.fm.intel.com with ESMTP; 24 Jun 2020 01:01:47 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Wenzhuo Lu , Guinan Sun , Todd Fujinaka Date: Wed, 24 Jun 2020 07:53:08 +0000 Message-Id: <20200624075337.6768-14-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200624075337.6768-1-guinanx.sun@intel.com> References: <20200622064634.70941-1-guinanx.sun@intel.com> <20200624075337.6768-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 13/42] net/e1000/base: modify klockwork about unused return values X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Klockwork found unreachable code since *clock_in_i2c_* always return success. Don't return unused s32 and don't check for constants. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun --- drivers/net/e1000/base/e1000_82575.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/e1000/base/e1000_82575.c b/drivers/net/e1000/base/e1000_82575.c index 021a54fc5..c49e81ae5 100644 --- a/drivers/net/e1000/base/e1000_82575.c +++ b/drivers/net/e1000/base/e1000_82575.c @@ -75,10 +75,10 @@ STATIC void e1000_clear_vfta_i350(struct e1000_hw *hw); STATIC void e1000_i2c_start(struct e1000_hw *hw); STATIC void e1000_i2c_stop(struct e1000_hw *hw); -STATIC s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); +STATIC void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); STATIC s32 e1000_clock_out_i2c_byte(struct e1000_hw *hw, u8 data); STATIC s32 e1000_get_i2c_ack(struct e1000_hw *hw); -STATIC s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); +STATIC void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); STATIC s32 e1000_clock_out_i2c_bit(struct e1000_hw *hw, bool data); STATIC void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); STATIC void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); @@ -3300,9 +3300,7 @@ s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset, if (status != E1000_SUCCESS) goto fail; - status = e1000_clock_in_i2c_byte(hw, data); - if (status != E1000_SUCCESS) - goto fail; + e1000_clock_in_i2c_byte(hw, data); status = e1000_clock_out_i2c_bit(hw, nack); if (status != E1000_SUCCESS) @@ -3466,7 +3464,7 @@ STATIC void e1000_i2c_stop(struct e1000_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -STATIC s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) +STATIC void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -3478,8 +3476,6 @@ STATIC s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) e1000_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return E1000_SUCCESS; } /** @@ -3568,7 +3564,7 @@ STATIC s32 e1000_get_i2c_ack(struct e1000_hw *hw) * * Clocks in one bit via I2C data/clock **/ -STATIC s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) +STATIC void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) { u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); @@ -3586,8 +3582,6 @@ STATIC s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(E1000_I2C_T_LOW); - - return E1000_SUCCESS; } /** -- 2.17.1