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 3E5CFA0350; Mon, 22 Jun 2020 09:08:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5504F1D170; Mon, 22 Jun 2020 09:05:51 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B59EC1D168 for ; Mon, 22 Jun 2020 09:05:48 +0200 (CEST) IronPort-SDR: JYAcKtDv92iOSimqXwr6NtPLh6+//BjAZHm0i8S7UPYaQOkLmRXHPwNrvUIKDY9V6axOjYvDG3 AelAxuoxnuNg== X-IronPort-AV: E=McAfee;i="6000,8403,9659"; a="141944764" X-IronPort-AV: E=Sophos;i="5.75,266,1589266800"; d="scan'208";a="141944764" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 00:05:48 -0700 IronPort-SDR: Z/D+VC3BSXCjkpjqXfMsacUvNuWsm/15Ug+SDhCB5loVNODL19L5tueTnHKpJHTx7ViboOBkOM QK+LENwjXgwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,266,1589266800"; d="scan'208";a="384408874" Received: from dpdk.sh.intel.com ([10.239.255.83]) by fmsmga001.fm.intel.com with ESMTP; 22 Jun 2020 00:05:46 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Zhao1 Wei , Guinan Sun , Todd Fujinaka Date: Mon, 22 Jun 2020 06:45:42 +0000 Message-Id: <20200622064634.70941-19-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200622064634.70941-1-guinanx.sun@intel.com> References: <20200622064634.70941-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 18/70] 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 627349de8..49c065014 100644 --- a/drivers/net/e1000/base/e1000_82575.c +++ b/drivers/net/e1000/base/e1000_82575.c @@ -76,10 +76,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); @@ -3305,9 +3305,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) @@ -3471,7 +3469,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; @@ -3483,8 +3481,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; } /** @@ -3573,7 +3569,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); @@ -3591,8 +3587,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