Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp263447pxx; Thu, 29 Oct 2020 01:55:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeEXjvyWeaV1ZxBhD7c6rGWeSFhr4SJcpuKKW8F2eix+Qap80SRMtxAmZNCBR5HYjNe6QD X-Received: by 2002:a50:eb45:: with SMTP id z5mr2838454edp.144.1603961702333; Thu, 29 Oct 2020 01:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961702; cv=none; d=google.com; s=arc-20160816; b=XYTFQx8tRnyJX/OVLdy/aIZkfu9XVek2ckoOyODPee/l2EOaE5Mh+AYC5XJqyQCBT0 3+i/JlDCGrNmaNB8/Z7vX5V3oRj0iOp/mKhSSSRzU2aGbzEGix/xDbyUJBWd/CA3Ybfp bio4XVyAaIT9v2AqbeiGPm+f8doNctgoy5NUkXKSt8cvsb2QmE5XcfPFOLwELgaTjVgI Vub3nf8LwKvi5P05aV4j3E8iDUM8jfKnjBc93+94DETP/eHlmsUniiviVEVy7qDBF0S7 VyTs4KtK5nwIsD9DijPcuNc3JJH+AxLhPz57IhCcixdZO3xil/ehIagiXmcOKdjUxxy7 S25A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=i6usnOm154a0LQfNGu6zLAw6CvipyZoYIqfT3Z+DNWs=; b=f3ygpGRLZ9JZyeKs7Cz2D1dtVzoRfk9OXegosRKAL9d1X1Ftv/KD9YcrWFT5aVu+Zc SBlWMOacj2asc+H2WXahGA9QvS/mdZrYevLLGIMOQqeF5rT8p67wsfE5L4TUt+WidHiQ Dm8OZ8J7GN/z+NUnjdFeV/YNO2El4k/0uZEJ7mK3mAagBco2pXT1/rWWVItK2pd25xfR LvzbW0xvpg2fLa1ekQmpSWk6E56/jBVafaeKfiEE01BTCFDAjlDHYvEFbnYtcxmrjAQG rmHMvYkizHkkPLVn5pxD2UqHhpLHH9QPiNnWom8eyuxUoXfPj8UteeGUcjoaCTXlq1gq iD9Q== 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 i12si1342191eje.696.2020.10.29.01.54.40; Thu, 29 Oct 2020 01:55:02 -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 S2404430AbgJ2CSt (ORCPT + 99 others); Wed, 28 Oct 2020 22:18:49 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6705 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgJ2CSY (ORCPT ); Wed, 28 Oct 2020 22:18:24 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CM8Hh6yMNzkb6j; Thu, 29 Oct 2020 10:18:24 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Thu, 29 Oct 2020 10:18:15 +0800 From: Zou Wei To: , , , CC: , , Zou Wei Subject: [PATCH -next] net: nvidia: forcedeth: remove useless if/else Date: Thu, 29 Oct 2020 10:30:14 +0800 Message-ID: <1603938614-53589-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccinelle report: ./drivers/net/ethernet/nvidia/forcedeth.c:3479:8-10: WARNING: possible condition with no effect (if == else) Both branches are the same, so remove the else if/else altogether. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/net/ethernet/nvidia/forcedeth.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 2fc10a3..87ed7e1 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -3476,9 +3476,6 @@ static int nv_update_linkspeed(struct net_device *dev) } else if (adv_lpa & LPA_10FULL) { newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; newdup = 1; - } else if (adv_lpa & LPA_10HALF) { - newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; - newdup = 0; } else { newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; newdup = 0; -- 2.6.2