Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp636118ybj; Thu, 7 May 2020 04:12:35 -0700 (PDT) X-Google-Smtp-Source: APiQypKf7IhsYDGey1I0fWE/x0OPQ+yjvq2SQWRbLvTNyZeH+g7V8jEa4n0FcZRxw2FBc7rPuAtX X-Received: by 2002:a50:a883:: with SMTP id k3mr11082404edc.198.1588849955635; Thu, 07 May 2020 04:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588849955; cv=none; d=google.com; s=arc-20160816; b=kAqicPSFg3Z0ItPiSDnKg6oYcw7e9D2hYxZdm1QNfXJaHYvFNTKh5Fb7F8eUVmXEQi F/9vVhOI0LfJqECONP0d7OKceGwmlpQR1iTatrHPvGTachklaA2ugSxFpp2BKQ/FoDnB M9Anv/jG/bP/TpIYBvgSflsR+FMGqWW6JTEMXSF+5aUcOdFYoUS0iirEMN1EpbKsLoNC OYjkGWJEgeGHdDr3VVYj72mTLnAZs2ln8O9Zer31ErUoaxh3P0tmr/ZGF1ZB9xIlSoLf T4ewA02RHdbVBDT0h4FEbxWxK1izRB4NkHJrbDyoh9ERjz6O2pzY2f5KSwf2TMVqcS55 PDyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=qXGcnE1ivmEXD/KVRXY5+FTRVuHSNnkbZOU819ws5GA=; b=QwK4LSZOxCATBDLAZkR30+2mB97cAnT5tXcAHC7IbgTkCYv935RBhUiV4wJ5ZTRoV0 qiPtVxRy57VRchryV2ADFr57zmyo0Y00nq584n56uzSvKwvOWFSWe1kVtfk6xoGmUhZN NnXHnsK0BsO1SUmoK+KDvrG+OW92nikYdN8CwgT49j5aGql+YFN9Esic2JUJZlbShi3t lcobHzflsPTAue59VPZGzLIHVwIWEIZ2pkHCyiwejRJUqn52fVZKzd7dqWY827FCklcE A7UVOq2NhWJ2v4q+SpZYiapx0KkY5fF8avre0EMsRWvl2BHTE3ilC7/kKZMPg+JFNMyW Ln+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si1425297edz.293.2020.05.07.04.12.11; Thu, 07 May 2020 04:12:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgEGLKE (ORCPT + 99 others); Thu, 7 May 2020 07:10:04 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41222 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726467AbgEGLKD (ORCPT ); Thu, 7 May 2020 07:10:03 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B08031ABE3B00C9375E2; Thu, 7 May 2020 19:10:01 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 19:09:54 +0800 From: Jason Yan To: , , , , , Subject: [PATCH net-next] igb: make igb_set_fc_watermarks() return void Date: Thu, 7 May 2020 19:09:15 +0800 Message-ID: <20200507110915.38349-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function always return 0 now, we can make it return void to simplify the code. This fixes the following coccicheck warning: drivers/net/ethernet/intel/igb/e1000_mac.c:728:5-12: Unneeded variable: "ret_val". Return "0" on line 751 Signed-off-by: Jason Yan --- drivers/net/ethernet/intel/igb/e1000_mac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c index 79ee0a747260..3254737c07a3 100644 --- a/drivers/net/ethernet/intel/igb/e1000_mac.c +++ b/drivers/net/ethernet/intel/igb/e1000_mac.c @@ -12,7 +12,7 @@ #include "igb.h" static s32 igb_set_default_fc(struct e1000_hw *hw); -static s32 igb_set_fc_watermarks(struct e1000_hw *hw); +static void igb_set_fc_watermarks(struct e1000_hw *hw); /** * igb_get_bus_info_pcie - Get PCIe bus information @@ -687,7 +687,7 @@ s32 igb_setup_link(struct e1000_hw *hw) wr32(E1000_FCTTV, hw->fc.pause_time); - ret_val = igb_set_fc_watermarks(hw); + igb_set_fc_watermarks(hw); out: @@ -723,9 +723,8 @@ void igb_config_collision_dist(struct e1000_hw *hw) * flow control XON frame transmission is enabled, then set XON frame * tansmission as well. **/ -static s32 igb_set_fc_watermarks(struct e1000_hw *hw) +static void igb_set_fc_watermarks(struct e1000_hw *hw) { - s32 ret_val = 0; u32 fcrtl = 0, fcrth = 0; /* Set the flow control receive threshold registers. Normally, @@ -747,8 +746,6 @@ static s32 igb_set_fc_watermarks(struct e1000_hw *hw) } wr32(E1000_FCRTL, fcrtl); wr32(E1000_FCRTH, fcrth); - - return ret_val; } /** -- 2.21.1