From patchwork Mon Jul 19 06:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruud Bos X-Patchwork-Id: 480341 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 CCE58C12002 for ; Mon, 19 Jul 2021 06:25:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA35961073 for ; Mon, 19 Jul 2021 06:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233717AbhGSG2p (ORCPT ); Mon, 19 Jul 2021 02:28:45 -0400 Received: from mail-eopbgr80119.outbound.protection.outlook.com ([40.107.8.119]:14596 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233580AbhGSG2o (ORCPT ); Mon, 19 Jul 2021 02:28:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jiL8X71DXzWScDBhM4cwBFIGZKwyBTcTbU3w/kErGli7/9QnTeocjxQxxNuaytgmx9F/K+TmS+e/7UCgfOq6inqwGTN9pTfXIPXz2D8iRJ0k+yJXneDNQcYdW7p6Vd83/9W3e+Sl3PPasY+FzpU4KTH6di3dv1MDZKbLwFZMEFC/nEp54o/4v1GxcjKBYz0zsdxsL2+4i8EGu7E3hhwC84kjrRtXPRDFDvnjoUy6VcTq4OMyxcm631fh0yyKH4TbVEsQeCBU+6zs8Y9V0Jv1GBAcIoAij0wl8xa4kCCj7Z2mWMDl9z5sxY/59IYmqTOdOS/fB722lDr8s234UZ3jSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dS5a4c2ZKFzE8zL4AeAbXR18mkQsM5YX1LneI7g1I6o=; b=mGXvcc/PjPQ0leF2WawZuz7HBVNKKMt8mTlxHHjSxKW/zg2lnjmDuEAvjqfbeMhF7slkpG+8UWHbQMvWao7nj++wxqb1yf9Y6HSuIVa2Az+2Er9Ij6yNIdaIeAcr5fnwhe+/Z+SUfyI/VsHvjOlos6lfNtM4omWVhDprCmrcqZuvv3ayLf4hmFfWd2Fbz6k7kia/9PvYZ9db+hxlUbYtPS6hfy0YPI5vwWVSNnWfRN5zEB9QL4Y4NRnQyMBerzzM0/Nil0DJB+Rz9myS7rfhoWeG3WzY3JJ9Xv0PqUeQB66x1mY6YODIws7W73r1EJQwObZ4sYme/b3woqfo5mdTgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hbkworld.com; dmarc=pass action=none header.from=hbkworld.com; dkim=pass header.d=hbkworld.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hbkworld.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dS5a4c2ZKFzE8zL4AeAbXR18mkQsM5YX1LneI7g1I6o=; b=SQ4Xdbh1307GFsebQq2MjvC8X/Wg/MkM+hIzoPKjpBBM72JKo7yi25N4yeus93gJdr5mPBxZxF2ai9BhxK35/nhywsYQyqMKHlEfPoIHjWBh1mYkERDcI/CtoqNMeEbn0jKaZOf306JoholGUM/knRLVHTOW3rW3Ir+KeHXlgjaZfeC2O2d0ueskOhHF3CrXo54fWeTe9HeydGOcp/NgoDJXCYy0OonSOsn+6onf2FAuooDx+hVTNuxEfDDbnohkTyFw/IdTlAMA/snN1+TDRoWoRjIL3QqlRhAxRJArmkAydiPNF0hew7glE6qRYBus9Z2K9xQWeqTxvvdnVPug2w== Received: from AM0PR09MB4276.eurprd09.prod.outlook.com (2603:10a6:20b:166::10) by AM0PR09MB2628.eurprd09.prod.outlook.com (2603:10a6:208:d7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Mon, 19 Jul 2021 06:25:41 +0000 Received: from AM0PR09MB4276.eurprd09.prod.outlook.com ([fe80::4d88:bf9c:b655:7a92]) by AM0PR09MB4276.eurprd09.prod.outlook.com ([fe80::4d88:bf9c:b655:7a92%7]) with mapi id 15.20.4331.032; Mon, 19 Jul 2021 06:25:41 +0000 From: Ruud Bos To: "netdev@vger.kernel.org" Subject: [PATCH net-next 1/4] igb: move SDP config initialization to separate function Thread-Topic: [PATCH net-next 1/4] igb: move SDP config initialization to separate function Thread-Index: Add8ZdnZwW0JgSK1QxiyoIhbvUIypg== Date: Mon, 19 Jul 2021 06:25:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_Enabled=true; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_SetDate=2021-07-19T06:25:40Z; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_Method=Privileged; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_Name=Unrestricted; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_SiteId=6cce74a3-3975-45e0-9893-b072988b30b6; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_ActionId=78a564ba-32c2-48ba-bd85-c09c86e4c53b; MSIP_Label_9208be00-d674-40fd-8399-cd3587f85bc0_ContentBits=2 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=hbkworld.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a306f40d-c23c-422a-5fa1-08d94a7e082d x-ms-traffictypediagnostic: AM0PR09MB2628: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: p0tc9mi7uzxPgA9L6gZXwR0Sm9FaoAK9A8iK4r1fHCl05YgJUt/5/M5S8yL9X5wEGTbUo19gS4zGhG/AdaD9TP8U9PhKvn8fkiy9q44x8T/ya1VakZWdCt80XbyyzpXwV/mWFXnkhOa/k+Mo5cIcpeOakwBZ5Y65S1XBy60PRuGUZNBL6G6CsMq2d5EwWBmizj9iN1Jnq2KEiZjLL1ENFeqLHir9uizW/eroEpH/4obDA69KI+Svb45naOCyr2WQLxmMW8YNQhv8nGyB6yfhIJ2lIE/3U3dC/XcA8yMf0ONwtSDDm6TQp79FbnuXm8Shr95YKBbDANPvNt6AacP3nPqAHRtWdrPi2vajHuQelBvxtIJh9JJkbK3FYg05pSanBm8FE1Bqf2VilgpfMo2e0Of6CbjkLsWDkJkHI+3iOH3ZvVjX0Noxwe37Dy/58kic78qk2E6kWnsPXU+024nh+4o0vqeBe+qaj5E2DL2sGC5t9emmOlQemm5e8yIrmR33UsI8Ofx4VR6fMuyQd/qGXbiryR5anwCccbVyU8wfucQ2CKyhWX5TZATnEiUPZ/xK5St8aRWq3nc89s5GfYf+foiRWUs0F2TyDJSrwe6snaQvR/bzqqg4flB681e9aDjzl80sgCGHqIRw0vJkI7cJQM9gNRkxBhBsVE6RXDr+Q917tiErDEtBk6J7w6j4zHIOtnKQsT9o1Qev2iQnkNIEmQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR09MB4276.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(9686003)(26005)(55016002)(186003)(33656002)(71200400001)(86362001)(64756008)(66446008)(5660300002)(66476007)(83380400001)(15974865002)(52536014)(66556008)(8936002)(38100700002)(122000001)(66946007)(2906002)(8676002)(44832011)(6506007)(7696005)(316002)(76116006)(508600001)(6916009)(38070700004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?jaDZhBIEo+tIurUQH+D5vvk/A?= =?utf-8?q?63jl+kAh8V9PKXSkUVO9WV6pavud9xYZ3UM+onmn7eNldJLxKYpGxlxH?= =?utf-8?q?FeB5im9WfwhjEJsKLeXH4awEUe1pZ9lJ6iEywnU88m4toi/CKC92a5We?= =?utf-8?q?DJ6ykJ/MBih3L8Kpngp0qjZL5NOW/WPV9ZKLvGNxj/foEMFlt/8LUUgo?= =?utf-8?q?0T+dwu4sFUhOtW3kCucLZ16w54pLFJ3uuXKTxquDypaO6q3q7NfFbrXm?= =?utf-8?q?QCLa4vC54ZojVVIbQm3QkAyEaDKcPZrlFoG6PSIrqt8NBvplFOTbOykG?= =?utf-8?q?opfHxkMF/kVTUn9EuY8U1DmKoGk9EY2u5LumRsQohi1hq+VKuyoD+CRB?= =?utf-8?q?b9zpdw/cX4ZEtAjrIwPvoG7j8PBhHiy8FSdSRNM4Bqg0YaJpoIm9xcNq?= =?utf-8?q?Bm5wQo9IhAsbtyk6O1uPNtI47q1ScQz7gE+KvBaB4WekjepBhL5+0v0K?= =?utf-8?q?k3HYMU2/Nff/PwqLwU4E3zNDSfNqQM9YZhFYZPfRMBpxsvVvwjorFz68?= =?utf-8?q?XheY/nABfSMhhY6m1sEQsKFulbfOMrAPp3jcwCxsTny6Tj4UEUL6CpiV?= =?utf-8?q?SkIl4nSlwM8Y8CJ2iZWe4DGWfU23zXOM62CqoVX+huFEAgVLoCO32WXT?= =?utf-8?q?vatzlES0TWNvPe3O3euYNbHai4an971QUoGEBAbwBqxoYg0rWT7kqKwZ?= =?utf-8?q?87TGqVz5A4fLxrThRcljj1t8YRvEndedUKThPmwcnaERfABW7jeN3/qa?= =?utf-8?q?GyCAt80BDmEfLc8LJGSlDAvebCe18I+iInjIffCm1cJ/7ffl3tpNztZH?= =?utf-8?q?QjbinKHoSEtf+GPD5RjjYw1FVqkjDz3yD7YKPYXOAJ5E6lQhNwv7jGQv?= =?utf-8?q?6nvGUfkR9fim2/bBkWBCUxfXmg6YJT2OgJTOGGMDqaQY7ah9ZDRljDeU?= =?utf-8?q?2K9FoN0XdbU/hBlfMHAwjnAfID9bqKcjZh7nzInMwik8qS9qY8yu5LFQ?= =?utf-8?q?1F7lgPWP4Yq69G4o87M+DWMNBvx2fK0EnTtt4N127bIUoM5k8uqpuBW8?= =?utf-8?q?yje8UZNpvgEFgWmHSKEhZ5enTtaGrZBe1XSXH0dvrBldr6QYmbLgCJmQ?= =?utf-8?q?QO3weblwsks52lH5OYVXawrc+OIRIGYq8cVUmf2oEWGbE4zgCkPXfsiC?= =?utf-8?q?iI44bzkYCuYBpHXPdgW48oiBO1axMhYjFqIYBakQ+Ji8JZGK8RL227kn?= =?utf-8?q?CGCk+GAuhNrPQ33RqIHoH5kIQfbq00qrJWQck0vTfwfdBkL9qgQtxz0K?= =?utf-8?q?37+CFg4ShEqmIY2A4Wj5fE+nM4QT8rjsTyOCTXVyLf/D8hJ3zs9VJHR5?= =?utf-8?q?AoBITqv2go=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: hbkworld.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR09MB4276.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a306f40d-c23c-422a-5fa1-08d94a7e082d X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2021 06:25:41.2564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6cce74a3-3975-45e0-9893-b072988b30b6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SgoW/KgyTv0YMoOw0vo2RhMkbCnDhlfVIluiHl3C0wz12H0DhH1WfD26hB4c5FLs X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB2628 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Allow reuse of SDP config struct initialization by moving it to a separate function. Signed-off-by: Ruud Bos --- drivers/net/ethernet/intel/igb/igb_ptp.c | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) -- 2.30.2 UNRESTRICTED HBK Benelux B.V., Schutweg 15a, NL-5145 NP Waalwijk, The Netherlands www.hbkworld.com Registered as B.V. (Dutch limited liability company) in the Dutch commercial register 08183075 0000 Company domiciled in Waalwijk Managing Directors : Alexandra Hellemans, Jens Wiegand, Jorn Bagijn The information in this email is confidential. It is intended solely for the addressee. If you are not the intended recipient, please let me know and delete this email. diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 0011b15e678c..c78d0c2a5341 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -69,6 +69,7 @@ #define IGB_NBITS_82580 40 static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter); +static void igb_ptp_sdp_init(struct igb_adapter *adapter); /* SYSTIM read access for the 82576 */ static u64 igb_ptp_read_82576(const struct cyclecounter *cc) @@ -1192,7 +1193,6 @@ void igb_ptp_init(struct igb_adapter *adapter) { struct e1000_hw *hw = &adapter->hw; struct net_device *netdev = adapter->netdev; - int i; switch (hw->mac.type) { case e1000_82576: @@ -1233,13 +1233,7 @@ void igb_ptp_init(struct igb_adapter *adapter) break; case e1000_i210: case e1000_i211: - for (i = 0; i < IGB_N_SDP; i++) { - struct ptp_pin_desc *ppd = &adapter->sdp_config[i]; - - snprintf(ppd->name, sizeof(ppd->name), "SDP%d", i); - ppd->index = i; - ppd->func = PTP_PF_NONE; - } + igb_ptp_sdp_init(adapter); snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr); adapter->ptp_caps.owner = THIS_MODULE; adapter->ptp_caps.max_adj = 62499999; @@ -1284,6 +1278,23 @@ void igb_ptp_init(struct igb_adapter *adapter) } } +/** + * igb_ptp_sdp_init - utility function which inits the SDP config structs + * @adapter: Board private structure. + **/ +void igb_ptp_sdp_init(struct igb_adapter *adapter) +{ + int i; + + for (i = 0; i < IGB_N_SDP; i++) { + struct ptp_pin_desc *ppd = &adapter->sdp_config[i]; + + snprintf(ppd->name, sizeof(ppd->name), "SDP%d", i); + ppd->index = i; + ppd->func = PTP_PF_NONE; + } +} + /** * igb_ptp_suspend - Disable PTP work items and prepare for suspend * @adapter: Board private structure