From patchwork Mon Jul 19 11:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruud Bos X-Patchwork-Id: 480323 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 2F7EEC07E9B for ; Mon, 19 Jul 2021 11:33:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F597610C7 for ; Mon, 19 Jul 2021 11:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236409AbhGSKwk (ORCPT ); Mon, 19 Jul 2021 06:52:40 -0400 Received: from mail-eopbgr70108.outbound.protection.outlook.com ([40.107.7.108]:20000 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232156AbhGSKwj (ORCPT ); Mon, 19 Jul 2021 06:52:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=huhUWh6f9pIax2alrY0L4AZnfLDmvl9HK2fAMqa+5uSKC7q/Mqp6jRIBzMdEVvvksDzfirDM1Wnz9dRSeFO9jgd/7YRzDZZi86wLifda3NxVwbULiwTTKLkhEbGAXEUgKH8oPsdTkVaJpdXX2bc7FylgUg1MwdXzQsxtfdFMzcaxPlNijf3T0k+JEaUNRUJZGj8LskOce9cft6BN6x/Pq3ohTtiB6ymnYHq6f4WhgwfRXIMzrIMgHmHsE+I9QHM6S5FxYaHRxsHLIoREDQEIyhnQAp0FDgSZrq99PfN/FLonn+jWWZss4291gAPpOB44QS5c8KVAED6uVCECoG7aEA== 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=Qwx942aEqBEsYbk6sBr8oS3fgXsXdRsntYtidZpmCVZiuSB1EMD+VUwxRDNyG6G96RnR418W0JcSeAmvdP/mhHIWE0tgWIEDNYym2fFHhM2Rckx9oxO3gR96Tyb/jtVRaxQDq3cAVwR5q5pVu8QZOrEKciHFXy1/4pLBvFS4Gt2RNMr9oAiih1ci/p5H4EIlfCiBXbnjclGqASo3Nd1WAEULiJM0FNxt611+QzGIDX99OqJa1mjJEwRzmzBF4bjqhpDoc4npFhVaPvshprybKNfN/n6z8A/YeCr01aK5qEETMhPvfRMzEYbO8wH4Pv2zRzQteAjM/7hBiNqNYuyxYg== 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=dt2FBAWr+tvDsUF2Gp2eud1G/0cx6XBHRfWsowUnhO7WJowA8hOuku15hOrjwBeo84tsEb01NWVwGQLL6aEL9rJ6yj7BthgMJAZ6gY50nW6ZFB56q9wltDwp/ur6U27WnYuQlDtLuEhj7PSFcHQmKuWwr1cVkz/BofN3ZfeJU47xS3IcDmqGXp5kJiZvX200xA3HBMh+g9GkXa64qXNp1E6ItV9bZBlj0FQaZPNDotI7otf8Y9YYiNtEw8LrQIYXEwIaOvulZ4WoFBSWsqVorFWQ7v0t/TntNS5a3M9v2hRXYZYLUzpEos2R6zw2TBOOp94H4GaltHww/gGizazy3w== Received: from AM0PR09MB4276.eurprd09.prod.outlook.com (2603:10a6:20b:166::10) by AM8PR09MB5228.eurprd09.prod.outlook.com (2603:10a6:20b:3db::19) 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 11:33:17 +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 11:33:17 +0000 From: Ruud Bos To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , "kuba@kernel.org" , "jesse.brandeburg@intel.com" , "anthony.l.nguyen@intel.com" Subject: [PATCH net-next 1/4 resend] igb: move SDP config initialization to separate function Thread-Topic: [PATCH net-next 1/4 resend] igb: move SDP config initialization to separate function Thread-Index: Add8kFEBf7R8NvzVR1qaYQ8/VtYXhA== Date: Mon, 19 Jul 2021 11:33:17 +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-19T11:33:16Z; 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=80a0f707-28de-48c1-9f90-f80f8b6a5765; 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: 0c303a7d-3bc5-4d63-ad33-08d94aa900f0 x-ms-traffictypediagnostic: AM8PR09MB5228: 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: KXmiOwASyn3KfYEri6XKz5hDWg77ZFcP0jifDuxciL+DrSv+KVcRRnsu2Wmv+JWOyDj4up5RCn+ycCssFaRS1TFH4giUGE6lKrQRSwewWOvioiEcn4Ce859wCRj4j66f87QfVBA1OQNY+/wtly4oYZ0Fg9p7iB05x5JsARNjyAiqn6BXdeWWLrB1L2Gr7RtfS0QDEj/2qb8urp1/3Ma+1Q//9PQByz69GG9/uPIzkbpwGWNR6NL+XnUbE9SQ9Yu/IUu2px5P25W3QwzQEhsiHugbAD0MjbboyP3F1BtDlZ1O4Qx6SSvxGh0kqNUtuJC20ELRI79LmjzoaVlbdpFbA9abYwyEQtiCn1BA5lLLiVbjAMJ2mwIx+GbLkLLJq9iOAotSFCksu3XNd2xKm2aUj479JKGQbO5sI123rywQPg6Vh1eVZAdsNWNSSyP2UolE1JSWesO0RiN5WAz+EqiZUAXC869MIDMwmJbDQNTOKh3aOE2BInFoqZppCW5rx5FtGryoUgLBgwzyE6ckKdMbVs30lNnWi878TLnFexe1hCJPhiZZr90q3wG2ynFx9nCIXmLEuGsZGkx/mLF2YLHix0RhE2895yiw1l1Dl6JuueSS0WlEfCq291juXM/NGYXvVHkIZfllV/dL7xIg54nh9iveYqiTjoJpig5+Q4nAD/+0E4NC8ksPETVk6ZNG4ZcXav/EvxK83CnjxofvR4twYQ== 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)(39850400004)(366004)(136003)(396003)(346002)(376002)(8936002)(8676002)(5660300002)(6916009)(55016002)(33656002)(52536014)(83380400001)(38100700002)(2906002)(44832011)(122000001)(26005)(9686003)(54906003)(86362001)(186003)(15974865002)(66446008)(64756008)(66556008)(66476007)(4326008)(316002)(71200400001)(66946007)(478600001)(76116006)(7696005)(6506007)(38070700004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?r/1+JN2/1eiClGxasS/xRVFlU?= =?utf-8?q?TIpkx2iGFoRuDsnYxCfIluLTr9pZWzTGIWlIC9W3Dw4P/aAMwuhFImNe?= =?utf-8?q?i02NDKj80tmdVnUu/olfNcjggvHYsEoLaC1C3ciKRqam8FZ2zMDgkXfv?= =?utf-8?q?DwK897sFZGvlSlWNk9n2J2mtVmYGc1PAOOEw8mpnMrERXg8oRbUi2CZi?= =?utf-8?q?20Bo4kTqGVqyZbE3dTFF+wzolXmHGw/4V+MPuzC/Gm9GBAS8NIeNcZP0?= =?utf-8?q?DwSKZhfGvuxg9JhX0Q7vXsD59+7QEwKBmnCneUh25EzjEtyTkebeZwk7?= =?utf-8?q?2i1zrTxIgxPHbbi/I3PLNl2G3GfGmHu103tLuHjKSnAmCfCiPXlObN+d?= =?utf-8?q?725meLhrzSiIxIjJ0Pst2oSuulWsFNz98Jro0wC3pEDfh279aWOvKvon?= =?utf-8?q?JfJldj99XBySqJVDjtNehpXDqee36cZ3vcBpzyJL7VMhdW0+yDthumpj?= =?utf-8?q?lp2nm8TEp/C01/ks4aDF3QfQ0XHT5MPJPorGCgC7CJv/KbyeN3l7tnXl?= =?utf-8?q?Wh5j+9gNThpuOWZe8Wq2l5HzW6RMpykTUKq+IB1PV7AM1F6UhGJlOi8T?= =?utf-8?q?XGvdlgyDcyWuvU7FZWKEDSSZBOmRSoG4n5v4K6BDUn1ASaxkrCEIhOUU?= =?utf-8?q?Zm0UuCTI4eOFpEM551t9SRTUG5XlZ6nVYg5MY1z1TLO7qtk3iCkstH/p?= =?utf-8?q?L2DIeysSzc7Ml34JRXtJJ8xaNZj3mPlxPwuiPaCxpbLW52Yspy1SVn/i?= =?utf-8?q?UjZL5sa6wLLlNIRmfddKbT8lfyexh2pvB2TbXDNPiwnW7/TM/MVaoMVP?= =?utf-8?q?5QvptOliyxRr0s8jjmSTJK0puqdDaxPnBE6M+Erd0yvPi7e0/wZU0j8V?= =?utf-8?q?yff/ZzZQOeFGj9Rs1wR5GGy7GC8vLEnCI3n6hJYlEOW3oHJg9V4B1aCQ?= =?utf-8?q?4Lz8nrs6Md8yRzh7jH4rqm6iwq0SxyQhFe7UV8TejrxPIvOBySXpLlqR?= =?utf-8?q?D6inNjskvWcOAAtcXkZ4errx6sOBNZzIxq4wMuHD946y8mZWNyL+PhFH?= =?utf-8?q?ZJdiHG9n4FMHXvX50nErgswCiZj7HcToGzm8kLzueoVlm7SI84DJWGvG?= =?utf-8?q?XuKSclXC5dw8QCs40naM7QAA5sNAGzEEzyv4ysVgWq8yo6yAVZq2Whsv?= =?utf-8?q?V3JmhYiPkNnS8rgHHNd7vXRV4MFn3ABK7ruQon8pzbpCnhx4j0ZtWX9E?= =?utf-8?q?KTOl4PrhLvMms8SZdTDv5jP8AF0uyOvilWhkYbHNzOL9CFCCCqkeYeiP?= =?utf-8?q?Ldt7Sbw2UrYf2LsZsbxlPHMW4vjqFXXjXFEoJx9uzhDlBCU+l05jqzRq?= =?utf-8?q?cBWWum/Z88=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: 0c303a7d-3bc5-4d63-ad33-08d94aa900f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2021 11:33:17.4032 (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: emqpzrKoZZm4fNCCHNc8UVby5unv3Ewv9iw6Vz8RFSLIJpH2HdhcInrwliSz+HT6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR09MB5228 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