Received: by 10.223.164.221 with SMTP id h29csp2899454wrb; Thu, 2 Nov 2017 20:55:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SjdzaSb8uiVr2BoE1oDr7XQPpZP50WBMTpU2RELqH0iA446I94RAdh/zXv4lDu9GvFl+cl X-Received: by 10.99.51.6 with SMTP id z6mr5756546pgz.276.1509681323740; Thu, 02 Nov 2017 20:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509681323; cv=none; d=google.com; s=arc-20160816; b=fcwOi0pXizzIBJz8HaCBCy1obb51Ginj+BhqfRx4rYixFByOsKHINjsHOU4EISdvP7 +XGrJnZKSFVsXNMkZicttCxheDGPSI/tTYj/VPyrjA0btKhi4zVjfTOpOJ5qfn5wJKUj 3xeasZAxRKdxouln1iYP8VVgchIeBCMh8Z3C7xCE99pYIDwW3dvD9WaRX8Q4JZ7y2tQf vHab/7KyRENhgLBWaVr20SV4yRvURUO/tMpHMhgrmgqRV+eZfwA0uDmXrp3kNR83KrAD nI++cuRWQrt2dgF1Y6iimR0aF+NYpS4GGOICtlgHMJPfuyssAZfgPhhyY48lHhyORWUu TguQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=QCeByJ/EVlZx0R8NEcvR3IXxw0Z/i9us8NhQCWT5o9g=; b=OQgZHtxblIzaY/EMrpa9qjDOpAmrKw69GTuqW3LdgblcAQRbU+8NZEyAwvfSZkEU+R OR1EwSUXirFa6KykIDJMfc9CB/u6HZxz7LcdH8hnmsTp6BM4qS844yDNK6uyXmNaSQjD DfO2o/ZtGuMaGFd29Xb+onivX66DK06h2EnT6kpop/sGTTQ6w0zKScnhYfH7SNOC5mtI Hqa4TM+WMBSEMpyT5gHF62vieJLiULuw/k6NGC89dCP67ULRv4eL4KFGMlo32Ixl9j6Z mf2G5eO9oyWKo+AAMnZ/TdJRKRJt9PWoL8rSc4ZwQXbUiFe+76NMxNoMYagpRtq3iJE7 a8KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q68si5321884pfb.223.2017.11.02.20.55.10; Thu, 02 Nov 2017 20:55:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754374AbdKCDvM (ORCPT + 97 others); Thu, 2 Nov 2017 23:51:12 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9945 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751297AbdKCDvI (ORCPT ); Thu, 2 Nov 2017 23:51:08 -0400 Received: from 172.30.72.58 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKE90172; Fri, 03 Nov 2017 11:51:05 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Fri, 3 Nov 2017 11:50:55 +0800 From: Lipeng To: CC: , , , , Subject: [PATCH net-next 3/6] net: hns3: fix a bug in hns3_driv_to_eth_caps Date: Fri, 3 Nov 2017 12:18:27 +0800 Message-ID: <1509682710-94908-4-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> References: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59FBE7A9.007D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 409d0dfd4f404a93daaa2913776570a7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang The value of link_modes.advertising and the value of link_modes.supported is initialized to zero every time in for loop in hns3_driv_to_eth_caps(). But we just want to set specified bit for them. Initialization is unnecessary. This patch fixes it. Fixes: 496d03e (net: hns3: Add Ethtool support to HNS3 driver) Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index 0e10a43..c7b8ebd 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -359,17 +359,12 @@ static void hns3_driv_to_eth_caps(u32 caps, struct ethtool_link_ksettings *cmd, if (!(caps & hns3_lm_map[i].hns3_link_mode)) continue; - if (is_advertised) { - ethtool_link_ksettings_zero_link_mode(cmd, - advertising); + if (is_advertised) __set_bit(hns3_lm_map[i].ethtool_link_mode, cmd->link_modes.advertising); - } else { - ethtool_link_ksettings_zero_link_mode(cmd, - supported); + else __set_bit(hns3_lm_map[i].ethtool_link_mode, cmd->link_modes.supported); - } } } -- 1.9.1 From 1582948763522258501@xxx Thu Nov 02 10:12:59 +0000 2017 X-GM-THRID: 1582948763522258501 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread