From patchwork Tue Jan 19 15:07:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 12030167 X-Patchwork-Delegate: kuba@kernel.org 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=-18.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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 724A5C433E9 for ; Tue, 19 Jan 2021 15:33:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E9D52312B for ; Tue, 19 Jan 2021 15:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391410AbhASPdl (ORCPT ); Tue, 19 Jan 2021 10:33:41 -0500 Received: from mail-eopbgr60117.outbound.protection.outlook.com ([40.107.6.117]:28545 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389305AbhASPLQ (ORCPT ); Tue, 19 Jan 2021 10:11:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ELSmdjscpdxh9S0O4gk2Fe5sQEDSwYuvobMkX1MxmfkLBsbspsSaUEE3fmZObPCXweSEAxUTbp8ZZ2Y8egd8QO+fnwlQga7YEH/l7qXXFryeknrI4Ox6NgZ7lGYPDX96b8Ce8z4g/mFSGdBEzQC9AM5m/CXrwuNUDS6Ea/99R18wxCJ/62A5i3mBNTtDxF/O4tUKX7fbOtTZ+fI+axEwUm0EQIHS9+ab1eYXUS2jeYlDAS90Yj8nLxRd6FecPmK2a39YpNlsJ/E490+TUlsq9euUcKu6GQ4ZrZKTuxXAmKoY+XD8F9BXuvHgmzZWlMrCWfQf0csgpQdjexNvMrRk+w== 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=fTUqxgU+jZblnI01UQpiUO5A6doOPu4IclqFIZSQiZE=; b=aTPyUBVkuAvUx1LNT4IgrZjzckgXjzLYrbIXuaWqFZEdxvhMTraVpw7RcXEXzcz0IqE0dsqW47iQiRvujDB4Wo3qaxF9lrwegg6Kf9EeCwSMT8qhEkYNyb87G/5h3vR3KTsiGjtB8yN/QTHHVrpvM85xs+F1OR/zV4OLZ8LrFoxlhcvbR3MrkFbh6gWK8rOPF81ZfO2vffo4laitTurgNGHHObgq99+5nTfnr8jNmcrseCFIt47OTsJjheLU9Aa7WmOFljH1MbV6TNdgrpCe/sKTbII3wehijEBfvrVpaym+L6E7G9J1e2++cZaTe6Y3ZJXxNSkEWnFVsj5L5SuueA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fTUqxgU+jZblnI01UQpiUO5A6doOPu4IclqFIZSQiZE=; b=awWDApkHQpZgxE6nMHJO8lCvTirOwatAMKIPYTh4J+c78EyGym46b4lA0hL3kWPfCsIWXg3me/TynfZk+XgzfjIqOVFQnwfsiZw3v6zbIRllblyH/MMHyo6fNQqUifXWbpG+hVQIyCmRgE33t/Pv6NvpL1N8Nu36VbgAlU+k2vQ= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB3681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:15d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9; Tue, 19 Jan 2021 15:09:17 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3763.014; Tue, 19 Jan 2021 15:09:17 +0000 From: Rasmus Villemoes To: netdev@vger.kernel.org Cc: Li Yang , "David S . Miller" , Zhao Qiang , Andrew Lunn , Christophe Leroy , Jakub Kicinski , Joakim Tjernlund , Rasmus Villemoes Subject: [PATCH net-next v2 12/17] ethernet: ucc_geth: use UCC_GETH_{RX,TX}_BD_RING_ALIGNMENT macros directly Date: Tue, 19 Jan 2021 16:07:57 +0100 Message-Id: <20210119150802.19997-13-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210119150802.19997-1-rasmus.villemoes@prevas.dk> References: <20210119150802.19997-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM6PR02CA0036.eurprd02.prod.outlook.com (2603:10a6:20b:6e::49) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM6PR02CA0036.eurprd02.prod.outlook.com (2603:10a6:20b:6e::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Tue, 19 Jan 2021 15:09:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f63e2583-15c0-4b9f-f3de-08d8bc8c30aa X-MS-TrafficTypeDiagnostic: AM0PR10MB3681: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UKX4eM4jo+StN+mIMWP2w255A0pWpGJcnfjvigPbwRVmMckrDKFdkYaGuYTU0R2P1KsHE7ndQFPeYJSlirPs84xHuNQfGnE71dCD/VIEHqysyYII0nW2j4CAnXHFOqtBEkVQEYESfwE7QIromizvEKoV8TmyO92sVUaEJUW1QO2VheABEn1+Cld5DMoQNK0NA7jIzdGJB+8dbcmO879ncfSrALdLxiyURCyeACUTGWaBsIwa4qDLpUzltC2+ePn85TyxbviKzBxlB8aizuhzJW9WXSlp0YxXPA5c215iGRE4d/Xi/gr29FPaqfvQ3fgxAkpxTxGhvS/J5XeiE1TMlR+2ff1phM0OBKox/SNj0F/DEvxuf2AmVIaNvkP984uuAt3L7AJ/eEG7+Ghfbas0lA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(346002)(396003)(136003)(39840400004)(376002)(8976002)(16526019)(6916009)(5660300002)(8936002)(2906002)(6506007)(66476007)(52116002)(66946007)(1076003)(83380400001)(186003)(956004)(6666004)(6486002)(8676002)(66556008)(4326008)(54906003)(44832011)(107886003)(478600001)(36756003)(6512007)(86362001)(26005)(2616005)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: dg7g3Y80ENQBTSxl25NfPTsWZfPwyK3aeR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enant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2021 15:09:17.4116 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oRAoBUYucABVuyv4RuLekHfWPK3nRER3mMAGmwfNg35IZqi3D2gRWIbmev5E0uQY8kLGKA1etISwUQj+10IUHXBBg3hw3fla6a5Q3EvooWs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3681 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org These macros both have the value 32, there's no point first initializing align to a lower value. If anything, one could throw in a BUILD_BUG_ON(UCC_GETH_TX_BD_RING_ALIGNMENT < 4), but it's not worth it - lots of code depends on named constants having sensible values. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 67b93d60243e..2369a5ede680 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2196,9 +2196,8 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT) length += UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT; if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = 4; - if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4) - align = UCC_GETH_TX_BD_RING_ALIGNMENT; + u32 align = UCC_GETH_TX_BD_RING_ALIGNMENT; + ugeth->tx_bd_ring_offset[j] = (u32) kmalloc((u32) (length + align), GFP_KERNEL); @@ -2274,9 +2273,8 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) for (j = 0; j < ug_info->numQueuesRx; j++) { length = ug_info->bdRingLenRx[j] * sizeof(struct qe_bd); if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = 4; - if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4) - align = UCC_GETH_RX_BD_RING_ALIGNMENT; + u32 align = UCC_GETH_RX_BD_RING_ALIGNMENT; + ugeth->rx_bd_ring_offset[j] = (u32) kmalloc((u32) (length + align), GFP_KERNEL); if (ugeth->rx_bd_ring_offset[j] != 0)