Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp950843ybz; Wed, 29 Apr 2020 12:17:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLp6gdb0pKpddRTBYX+jy0wPfDn+JjyELjeuRHBoat7MlfXCUlwrQpL3OpeAmpiOilOnnaP X-Received: by 2002:a17:906:3713:: with SMTP id d19mr3902158ejc.111.1588187821441; Wed, 29 Apr 2020 12:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588187821; cv=none; d=google.com; s=arc-20160816; b=ttyUCv/tEBGmC/O6KiINe38YoGcCfz83G5DxHUdY+IoFsyUsPoj9I04OHTckS2xxDI 23G8TPdTI8Xf7OBiiqIERP71BshDO6SXLWVpOaluz1rEAWLoZM/pzYULseJxTtZLVyih boLaRI83kVy4U1vOZr9PUbmfBuuHgARy8qFVhz5kS/o/AWE+m1Ixa+enh7TxhMvsqkxt cyef5niBSCrPiTh88ItVhEUDGOCwC/z/9i5E3WTFCpBRQrfttXLzbeH0V37kiGq0cTtK 7rzXjbFN67QTeT/LAmS5zFkEURWqUKtIikcD7QsN3Ievh0GU/Q/sMi6IEiLKLy7cNh0P h2EA== 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 :references:in-reply-to:from:subject:cc:to:message-id:date; bh=g7eGvb1SR8BPHbIkoUR3UeVhxm5CcpSR9aeMY3wb3is=; b=ErlM7AkHyvu43Po5U6Svfb/oHabHTYQlA7wuoijTLba3+4NuIpuqfjBHE0cwQK7M9B OSH/3tfpWHpU7iGMpdPEWVJcfLk8qFLOCATx8q7UepsLZUTZEoDygKC90LN4jJ4y+Z98 rh7Qebql4XFpQ6v5M5pjMaAvIxMNo2A/G4r4zxti9US9g7polflk5BMSX9muEPMtic5w e32yIo1EOg41chKaxQ7XWAecPYdFMwnOV+RpxDC2qM3RWumV6sqwXSpKYFBivjslapsE OGXddabv6uJC9lsWw87k18PuOskSSEMztw54hW8q9wky5GNynN6kHUrjoB/rta/qlIn7 teOw== 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 n21si4437869ejc.113.2020.04.29.12.16.38; Wed, 29 Apr 2020 12:17:01 -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 S1726889AbgD2TPK (ORCPT + 99 others); Wed, 29 Apr 2020 15:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726519AbgD2TPK (ORCPT ); Wed, 29 Apr 2020 15:15:10 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95163C03C1AE; Wed, 29 Apr 2020 12:15:10 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B96F31210A3E3; Wed, 29 Apr 2020 12:15:09 -0700 (PDT) Date: Wed, 29 Apr 2020 12:15:08 -0700 (PDT) Message-Id: <20200429.121508.82832560496943961.davem@davemloft.net> To: yanaijie@huawei.com Cc: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dsa: mv88e6xxx: remove duplicate assignment of struct members From: David Miller In-Reply-To: <20200429141001.8361-1-yanaijie@huawei.com> References: <20200429141001.8361-1-yanaijie@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 29 Apr 2020 12:15:10 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Yan Date: Wed, 29 Apr 2020 22:10:01 +0800 > 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 Applied, thanks.