From patchwork Fri Dec 11 14:34:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Lo X-Patchwork-Id: 11968319 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A49A5C4361B for ; Fri, 11 Dec 2020 15:07:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D94022571 for ; Fri, 11 Dec 2020 15:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405421AbgLKOm7 (ORCPT ); Fri, 11 Dec 2020 09:42:59 -0500 Received: from ns.kevlo.org ([220.134.220.36]:29994 "EHLO mail.kevlo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730988AbgLKOm1 (ORCPT ); Fri, 11 Dec 2020 09:42:27 -0500 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Dec 2020 09:42:27 EST Received: from localhost (ns.kevlo.org [local]) by ns.kevlo.org (OpenSMTPD) with ESMTPA id 0dc73e40; Fri, 11 Dec 2020 22:34:56 +0800 (CST) Date: Fri, 11 Dec 2020 22:34:56 +0800 From: Kevin Lo To: Sasha Neftin , Jeff Kirsher Cc: "David S . Miller" , netdev@vger.kernel.org Subject: [PATCH] igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr Message-ID: <20201211143456.GA83809@ns.kevlo.org> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout. Signed-off-by: Kevin Lo diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c index 8b67d9b49a83..b0a5cd31683e 100644 --- a/drivers/net/ethernet/intel/igc/igc_i225.c +++ b/drivers/net/ethernet/intel/igc/igc_i225.c @@ -221,7 +221,7 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, struct igc_nvm_info *nvm = &hw->nvm; u32 attempts = 100000; u32 i, k, eewr = 0; - s32 ret_val = 0; + s32 ret_val = -IGC_ERR_NVM; /* A check for invalid values: offset too large, too many words, * too many words for the offset, and not enough words. @@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || words == 0) { hw_dbg("nvm parameter(s) out of bounds\n"); - ret_val = -IGC_ERR_NVM; goto out; }