Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp661301ybz; Wed, 29 Apr 2020 07:13:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKv4R6lMzIZ+4mzrZkwiiXU60g5QMh9//2y77WftqnI7abGr8hcTCw37i9mY8uxmuHu77Ek X-Received: by 2002:a05:6402:1d23:: with SMTP id dh3mr2642080edb.349.1588169590519; Wed, 29 Apr 2020 07:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588169590; cv=none; d=google.com; s=arc-20160816; b=T8ug0a5/Lts61jPR/YDmXeaoQZ3wpZ0eK+CCEPlugbFuZYAuUMXnzRSXOGrHPKjVo3 vAkXLlYJjea7XDySI8U9ZHcPOjLviCRSWY+L+IY3Z3xRbFSiooixb9WeVcPqGJF4wFUm uZTChLnQEFXn8ELbLgdx80RngrtjNTdB9aqIryxGOvjXdcnPLZz5KN+yt34JXlc+6FeR tAWNzMcn4uWogyfUwVJahbj9Y4s05vk9j4G6lBo9dg579wvrgIpsuUyiCtn6bZ1AomS4 x5oJ21C49WImB5lAAqKYGRv3XInkdAJe7LVhFUX1p26A3UvziTJi05zKcUp7RwhlH0Uu mRpA== 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:cc:to:from; bh=o/r2TUdGob94AHKGZ/Ni0sRJzN/t3McPGYi7A53sa0s=; b=us6ZDPskJW6HFdq0u+uox22LYa+4Tmm2RYkeynh2W2CUIfMfWdpQOm1P7PFOY0sPUo 3z/HgLSqUatVKAipwOanui5PziNRlk31TTPHNdc6ZL1hGXu1G8Gk9wMK+IDnPwDGhYHH 7XACnP1Sao5SOf9mygrZoVHEiH/o2/R7GuPbBQ/QF/0lUIviWavbxwMS4XRJ8Mq3oi81 +uAVCJrJhekQxLKJBj6ZhCblMk9cwuET5B4ch/yyYvEhBMgX/zkLgkxUMcZhPFa5S1jp mPYJle5UAbef3nPEmhh2pPBu04wv7KMkDjDOtnDZaD3AaJn66g2Fi0HT/9PZTwf5PFzt QB5w== 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 k3si3188382edk.571.2020.04.29.07.12.46; Wed, 29 Apr 2020 07:13:10 -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 S1728238AbgD2OKp (ORCPT + 99 others); Wed, 29 Apr 2020 10:10:45 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:37186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726691AbgD2OKo (ORCPT ); Wed, 29 Apr 2020 10:10:44 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 79FA820E5DA8037B5AF0; Wed, 29 Apr 2020 22:10:43 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 22:10:36 +0800 From: Jason Yan To: , , , , , , CC: Jason Yan Subject: [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members Date: Wed, 29 Apr 2020 22:10:01 +0800 Message-ID: <20200429141001.8361-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 These struct members named 'phylink_validate' was assigned twice: static const struct mv88e6xxx_ops mv88e6190_ops = { ...... .phylink_validate = mv88e6390_phylink_validate, ...... .phylink_validate = mv88e6390_phylink_validate, }; static const struct mv88e6xxx_ops mv88e6190x_ops = { ...... .phylink_validate = mv88e6390_phylink_validate, ...... .phylink_validate = mv88e6390x_phylink_validate, }; static const struct mv88e6xxx_ops mv88e6191_ops = { ...... .phylink_validate = mv88e6390_phylink_validate, ...... .phylink_validate = mv88e6390_phylink_validate, }; static const struct mv88e6xxx_ops mv88e6290_ops = { ...... .phylink_validate = mv88e6390_phylink_validate, ...... .phylink_validate = mv88e6390_phylink_validate, }; Remove all the first one and leave the second one which are been used in fact. Be aware that for 'mv88e6190x_ops' the assignment functions is different while the others are all the same. This fixes the following coccicheck warning: drivers/net/dsa/mv88e6xxx/chip.c:3911:48-49: phylink_validate: first occurrence line 3965, second occurrence line 3967 drivers/net/dsa/mv88e6xxx/chip.c:3970:49-50: phylink_validate: first occurrence line 4024, second occurrence line 4026 drivers/net/dsa/mv88e6xxx/chip.c:4029:48-49: phylink_validate: first occurrence line 4082, second occurrence line 4085 drivers/net/dsa/mv88e6xxx/chip.c:4184:48-49: phylink_validate: first occurrence line 4238, second occurrence line 4242 Signed-off-by: Jason Yan --- drivers/net/dsa/mv88e6xxx/chip.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index dd8a5666a584..2b4a723c8306 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3962,7 +3962,6 @@ static const struct mv88e6xxx_ops mv88e6190_ops = { .serdes_get_stats = mv88e6390_serdes_get_stats, .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, .serdes_get_regs = mv88e6390_serdes_get_regs, - .phylink_validate = mv88e6390_phylink_validate, .gpio_ops = &mv88e6352_gpio_ops, .phylink_validate = mv88e6390_phylink_validate, }; @@ -4021,7 +4020,6 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = { .serdes_get_stats = mv88e6390_serdes_get_stats, .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, .serdes_get_regs = mv88e6390_serdes_get_regs, - .phylink_validate = mv88e6390_phylink_validate, .gpio_ops = &mv88e6352_gpio_ops, .phylink_validate = mv88e6390x_phylink_validate, }; @@ -4079,7 +4077,6 @@ static const struct mv88e6xxx_ops mv88e6191_ops = { .serdes_get_stats = mv88e6390_serdes_get_stats, .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, .serdes_get_regs = mv88e6390_serdes_get_regs, - .phylink_validate = mv88e6390_phylink_validate, .avb_ops = &mv88e6390_avb_ops, .ptp_ops = &mv88e6352_ptp_ops, .phylink_validate = mv88e6390_phylink_validate, @@ -4235,7 +4232,6 @@ static const struct mv88e6xxx_ops mv88e6290_ops = { .serdes_get_stats = mv88e6390_serdes_get_stats, .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, .serdes_get_regs = mv88e6390_serdes_get_regs, - .phylink_validate = mv88e6390_phylink_validate, .gpio_ops = &mv88e6352_gpio_ops, .avb_ops = &mv88e6390_avb_ops, .ptp_ops = &mv88e6352_ptp_ops, -- 2.21.1