From patchwork Thu Apr 14 12:37:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radhey Shyam Pandey X-Patchwork-Id: 12813471 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53EE9C433EF for ; Thu, 14 Apr 2022 12:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243441AbiDNMkT (ORCPT ); Thu, 14 Apr 2022 08:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242863AbiDNMkS (ORCPT ); Thu, 14 Apr 2022 08:40:18 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2056.outbound.protection.outlook.com [40.107.95.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB289024D; Thu, 14 Apr 2022 05:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZA/+i84HO4VpYmDZUEDkS5YW4xhLu2FM2C/uDIGNEov4Rxwv0IG2cvGN1K1ZPlzrjm991NuaDAPGGZX47kwOkcGfxMEOTJHkWyRC//c9Gd60GmlNjRDceKfWcUSQkjzxjstStz3Yjl9MsYAkO+I1xWhghCC4Eko85s7dYzgig41RNIAucYh0GSIxYWchu+fLn8MJeYM2kTnFcH0+PJxPFFC2vOdDskwWE3VpL27nsqpaSVCyNf0bzMN33qSmWIZABAjRnCeVsVWWVRwzRdlwwOItCLHI5YGB2bMEMOmSyEtkiV3FeORgQiVTm+xT7orNz5lehb7I2ZUMzwYGMmbsuw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BUzmbD21xEL2uVjUNJ5UxIA8ohCfobohDasC6OAUTSE=; b=ifalR+AF5iwMYfp6Dax6aDdMd3FllUa+pArIVwOFcUBqnAe3MUnF1MPbnEDBv2tl8DsVjWdit0RWKw+vwAuLpNHbbi3JHnFlUnooxLYel4B5q4b35WSrQf1NJm7nbd24UEpyZkddzV8uuW8y9y0lvXyxt9AM9SInfktsQM5/d+s0WvbqJs3mlkKWaIuVTBU/UunZPgB4uFrWsT0Rn2BJE2+c3co6vss8Ak5K0TDaOD+lG1Dli/stZiTjvWHNTlZYVOu2PY7UMd33nhfwfWpxT2hpoJr7KPHtkOku2szIqwj1EwHepsjreOYlG8gSPB9jTCDQ09GCmAMeRF9eel2wXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=davemloft.net smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BUzmbD21xEL2uVjUNJ5UxIA8ohCfobohDasC6OAUTSE=; b=sY0Q7qybvdQ2c22Rjp1V9GNXTr8ryDCf24KLYh34o74UzRH6SjoDzdbhdke/MWW8dtFRGSYf+6BnoT2+nDcsv293U8dh5CJK7u6bGBH6hgkC2IvkMFuKCi5p9LEfQHU8E2h2fn1zatVigbnB21KN2jurFzELP5FS/vZCm4PIO+U= Received: from BN6PR19CA0093.namprd19.prod.outlook.com (2603:10b6:404:133::31) by BN7PR02MB5073.namprd02.prod.outlook.com (2603:10b6:408:2f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 12:37:52 +0000 Received: from BN1NAM02FT058.eop-nam02.prod.protection.outlook.com (2603:10b6:404:133:cafe::e0) by BN6PR19CA0093.outlook.office365.com (2603:10b6:404:133::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20 via Frontend Transport; Thu, 14 Apr 2022 12:37:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT058.mail.protection.outlook.com (10.13.2.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5164.19 via Frontend Transport; Thu, 14 Apr 2022 12:37:51 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 14 Apr 2022 05:37:33 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 14 Apr 2022 05:37:33 -0700 Envelope-to: git@xilinx.com, davem@davemloft.net, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, andrew@lunn.ch, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Received: from [172.23.64.6] (port=53839 helo=xhdvnc106.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1neyj7-0008bG-14; Thu, 14 Apr 2022 05:37:33 -0700 Received: by xhdvnc106.xilinx.com (Postfix, from userid 13245) id EB614600D1; Thu, 14 Apr 2022 18:07:18 +0530 (IST) From: Radhey Shyam Pandey To: , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH net-next 1/3] net: emaclite: Fix coding style Date: Thu, 14 Apr 2022 18:07:09 +0530 Message-ID: <1649939831-14901-2-git-send-email-radhey.shyam.pandey@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> References: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf8cb35b-4605-4fe0-c351-08da1e139733 X-MS-TrafficTypeDiagnostic: BN7PR02MB5073:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NmQpAItluiaxwaTCU02f7mYOk/xjfR7P7rm91N+wO5/CgMMZNtGLTp7m/XpSTOq9fZBDWyyPUZ4QGiMIw1RCt9g69Vm4AOAU3NRLNZv8lYBHOnl+tsB3vfoH1rR7aByq1mNY+xyEIlywdyBHlihtDcQWmodn2r3SfouzvZdEmTjd8tmlXSYgsdI/OxC6iiHEznsNJejYasveF5+zRIjgQHLsvioAhV34V3lE0f1xPXrb0rXQ5GrEwLVax7rst5JOxMhkBlzVOVqxvyYwPWeC7wN5NsvSKfMH+8yUdNspkJDie+WGhcX80V7exq6mm42TFQNUUjtPuwpkdGJVNWho9NrOlOrMbnCDKwQzExEaY4NUUs/5/O4dZSyXpN1sHm81OnuQL8ueq9LXNyxt74BTQKGVjT/2OESScG79TR0zSjpbO0RI2V4Nw5RiuFogb+bP1HSKKS7/ApIOi5df7Q3hoga97Z6fWPE2SWHkjSDMOqw61I3zH8qvXXdI3llqQnQLDhyq8mjiUUmgAilyaY8vS9vuIBAf8QUqjJNlp2sC6MzN/ddyVgeet5yesmXuDPAcJ9rusCjD3iu6K3pi8uL2W6UsDaDMMGMx05jlJmycEd3zBsXEQXIaJ7KfcOEHzcI5zbNoaONbskZdlPSmkuar8UP2GNY2ewIK5qf4eIVir7bK9FWmWiyodN9Ld6d0oCenzk+jrU0kv/6FdiE+RAagFQ== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(2616005)(8676002)(8936002)(107886003)(4326008)(426003)(70206006)(47076005)(26005)(5660300002)(336012)(186003)(82310400005)(40460700003)(2906002)(36756003)(36860700001)(508600001)(83380400001)(110136005)(54906003)(42186006)(6266002)(356005)(6666004)(7636003)(316002)(70586007)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 12:37:51.4904 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf8cb35b-4605-4fe0-c351-08da1e139733 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT058.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB5073 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Make coding style changes to fix checkpatch script warnings. There is no functional change. Fixes below check and warnings- CHECK: Blank lines aren't necessary after an open brace '{' CHECK: spinlock_t definition without comment CHECK: Please don't use multiple blank lines WARNING: Prefer 'unsigned int' to bare use of 'unsigned' CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement CHECK: Alignment should match open parenthesis WARNING: Missing a blank line after declarations Signed-off-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 35 ++++++++++++--------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 57a24f62e353..6294b714fbfa 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -/* - * Xilinx EmacLite Linux driver for the Xilinx Ethernet MAC Lite device. +/* Xilinx EmacLite Linux driver for the Xilinx Ethernet MAC Lite device. * * This is a new flat driver which is based on the original emac_lite * driver from John Williams . @@ -91,8 +90,6 @@ #define XEL_ARP_PACKET_SIZE 28 /* Max ARP packet size */ #define XEL_HEADER_IP_LENGTH_OFFSET 16 /* IP Length Offset */ - - #define TX_TIMEOUT (60 * HZ) /* Tx timeout is 60 seconds. */ #define ALIGNMENT 4 @@ -124,7 +121,6 @@ * @last_link: last link status */ struct net_local { - struct net_device *ndev; bool tx_ping_pong; @@ -133,7 +129,7 @@ struct net_local { u32 next_rx_buf_to_use; void __iomem *base_addr; - spinlock_t reset_lock; + spinlock_t reset_lock; /* serialize xmit and tx_timeout execution */ struct sk_buff *deferred_skb; struct phy_device *phy_dev; @@ -144,7 +140,6 @@ struct net_local { int last_link; }; - /*************************/ /* EmacLite driver calls */ /*************************/ @@ -207,7 +202,7 @@ static void xemaclite_disable_interrupts(struct net_local *drvdata) * address in the EmacLite device. */ static void xemaclite_aligned_write(const void *src_ptr, u32 *dest_ptr, - unsigned length) + unsigned int length) { const u16 *from_u16_ptr; u32 align_buffer; @@ -265,7 +260,7 @@ static void xemaclite_aligned_write(const void *src_ptr, u32 *dest_ptr, * to a 16-bit aligned buffer. */ static void xemaclite_aligned_read(u32 *src_ptr, u8 *dest_ptr, - unsigned length) + unsigned int length) { u16 *to_u16_ptr, *from_u16_ptr; u32 *from_u32_ptr; @@ -330,7 +325,6 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data, reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET); if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK)) == 0) { - /* Switch to next buffer if configured */ if (drvdata->tx_ping_pong != 0) drvdata->next_tx_buf_to_use ^= XEL_BUFFER_OFFSET; @@ -346,8 +340,9 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data, if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK)) != 0) return -1; /* Buffers were full, return failure */ - } else + } else { return -1; /* Buffer was full, return failure */ + } /* Write the frame to the buffer */ xemaclite_aligned_write(data, (u32 __force *)addr, byte_count); @@ -423,7 +418,6 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen) * or an IP packet or an ARP packet */ if (proto_type > ETH_DATA_LEN) { - if (proto_type == ETH_P_IP) { length = ((ntohl(xemaclite_readl(addr + XEL_HEADER_IP_LENGTH_OFFSET + @@ -433,23 +427,25 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen) length = min_t(u16, length, ETH_DATA_LEN); length += ETH_HLEN + ETH_FCS_LEN; - } else if (proto_type == ETH_P_ARP) + } else if (proto_type == ETH_P_ARP) { length = XEL_ARP_PACKET_SIZE + ETH_HLEN + ETH_FCS_LEN; - else + } else { /* Field contains type other than IP or ARP, use max * frame size and let user parse it */ length = ETH_FRAME_LEN + ETH_FCS_LEN; - } else + } + } else { /* Use the length in the frame, plus the header and trailer */ length = proto_type + ETH_HLEN + ETH_FCS_LEN; + } if (WARN_ON(length > maxlen)) length = maxlen; /* Read from the EmacLite device */ xemaclite_aligned_read((u32 __force *)(addr + XEL_RXBUFF_OFFSET), - data, length); + data, length); /* Acknowledge the frame */ reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET); @@ -671,8 +667,7 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id) /* Check if the Transmission for the first buffer is completed */ tx_status = xemaclite_readl(base_addr + XEL_TSR_OFFSET); if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) && - (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) { - + (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) { tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK; xemaclite_writel(tx_status, base_addr + XEL_TSR_OFFSET); @@ -682,8 +677,7 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id) /* Check if the Transmission for the second buffer is completed */ tx_status = xemaclite_readl(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET); if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) && - (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) { - + (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) { tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK; xemaclite_writel(tx_status, base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET); @@ -840,6 +834,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) of_address_to_resource(npp, 0, &res); if (lp->ndev->mem_start != res.start) { struct phy_device *phydev; + phydev = of_phy_find_device(lp->phy_node); if (!phydev) dev_info(dev, From patchwork Thu Apr 14 12:37:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radhey Shyam Pandey X-Patchwork-Id: 12813472 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46E6FC433EF for ; Thu, 14 Apr 2022 12:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243450AbiDNMka (ORCPT ); Thu, 14 Apr 2022 08:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240342AbiDNMk3 (ORCPT ); Thu, 14 Apr 2022 08:40:29 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2088.outbound.protection.outlook.com [40.107.212.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1C690256; Thu, 14 Apr 2022 05:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HYPXgR6Rieeb2eXJ7XmlH2aBmlK8xSWhBdsRJqoPD9RFEpiVS3FjzP+apBUi/q/ARVxcVjfAqd2wL2NLqLQb79cRErtMh49hzszCi8BcQVYdSCyLH7ipnZxsyEio1RpkNie/FTeHwg5Odr+O6XhHEG1FcUfM9U3837/BU6t89V16Vm23ApTjS0InRELLqOACMUW/86fQdpBWKDgF5EUB+/ISJHoI8DfgjDK3lB6BO42k1F8o1hx3MiavR9C37c4CCZYPS6NnBwe0Tkt31RhSb4EbGJvtzFZCmNyqpOq7RRYL9JA+BwhdOzpZEiRMkCaN0Qw0B612P9gzrqyGT2DRKw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8pn1lO4gZuzlwU6BMg0/WVkCEn/FoM0TglVS9ZPhiqI=; b=nt7Qvx3VlDhSa3o+E24MIV5qTElyMbx8AIAX3eWeBSFJhMVJrvyRM79qhPFJHakqX7/5R9xA+AbiIwxhwiksCGNOQPY+AeClp7RVJwEEILlrv++INgPnFzREqaD5cS0CnrAz2R8DUrWZYLHTUTjDUWIMkGBr+D8qouS0HmQCC2Mo7zDOGcc/nXY/jfSYdc8pR7NdCj0yMvCG9GPdxGLqIRtU+z7Ea9eVdvaiV9johjoljckUCpXHD5BK+kACfl5PWej++eoUWzekYIM13+6G34CQWRtLF7TUbtl4dAeDjY9Xo10+K0ExYUYgbuXwApAjgMJJJgQ1tha2H5dNpRTY0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=davemloft.net smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8pn1lO4gZuzlwU6BMg0/WVkCEn/FoM0TglVS9ZPhiqI=; b=H1O1C20pJvug2oEKTWxoNldB2DophaT0kE8zKy8uC+4Cm+mS6IAPHT8X989fR+OO05MSL7Q0W+8FtkWMJvWBv6ihhYmti607kvMq8GZWAHwN7KhMUJTkqsP3UnnwCaDAI8wfQ4RiZJVLTUEWgIi3iA+v6YhiQQTzS1ZmXG+HQ9Q= Received: from BN9PR03CA0809.namprd03.prod.outlook.com (2603:10b6:408:13f::34) by BL0PR02MB5699.namprd02.prod.outlook.com (2603:10b6:208:80::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Thu, 14 Apr 2022 12:38:01 +0000 Received: from BN1NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:408:13f:cafe::56) by BN9PR03CA0809.outlook.office365.com (2603:10b6:408:13f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20 via Frontend Transport; Thu, 14 Apr 2022 12:38:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT031.mail.protection.outlook.com (10.13.2.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5164.19 via Frontend Transport; Thu, 14 Apr 2022 12:38:01 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 14 Apr 2022 05:37:46 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 14 Apr 2022 05:37:46 -0700 Envelope-to: git@xilinx.com, davem@davemloft.net, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, andrew@lunn.ch, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Received: from [172.23.64.6] (port=53840 helo=xhdvnc106.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1neyjK-0006sK-9I; Thu, 14 Apr 2022 05:37:46 -0700 Received: by xhdvnc106.xilinx.com (Postfix, from userid 13245) id F27DF61066; Thu, 14 Apr 2022 18:07:18 +0530 (IST) From: Radhey Shyam Pandey To: , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH net-next 2/3] net: emaclite: Update copyright text to correct format Date: Thu, 14 Apr 2022 18:07:10 +0530 Message-ID: <1649939831-14901-3-git-send-email-radhey.shyam.pandey@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> References: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf4bfa8e-c5bc-4485-4010-08da1e139cf7 X-MS-TrafficTypeDiagnostic: BL0PR02MB5699:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0I/odbwozhIjOn0lpHYHKmSreL72hRfwgcSodUA/3zgwrZGyNLxa4Bd06qLJVTAzOWqGtRfExVopHD1tj8Pxvyi4hgOL6VcEkFK4obzS8hn0+K4IYgZPOOMXS2K58fmMKzgcOc5Pg8/wiQWXV1uzYAgPPWkYTv5mnK5eGHDF27QlgkEvDkHxWoQpdvkWXkxGe0EcjcaSvCIBONowXxczfjgZSzVu8ycYrK2LvDxwvachfu+47q4dQkcCUdABbtKOhCgLqe2pbC1d7GBiLlPPh6GdqfiXdN9ysn2wVjLK7EIrhDLvMQwmX3JvrRjRq/hBJvBG4J5q+UUyDG+i+nTkJwY4K0GXk423bp8Lpgw7e8heZoPV+QQQZADMEzbxYoGglm0HCq5k5zRWRmMA4qzM0qa+cj+nc//eM07QMvvZVMjuk5iRYmShZshKmPlgR7p+h+WPqvsv0Ypljh2lfoTeFdjOGCurSTMVL1JmnuQHIPowjj2q9akv7UraktEjk+dNuZ5O6M8xJG/dxCYvy4RZvfQ7ChInN1pLyN9j1taq63PEVb8m0uOXlkk8tGAEnbfuXC2yzcUR2mU7U6I/kBl0N0Zbpqe4xcNgiBjBUEvWmzTL7UH0Eg+xEq8r+Bb0KaCuzUhWJrmF1n3h15LwGlmMNJb4nhWXDGKt021ZcHE8ojWYhvs65EpSsZsbAC++s89YF+6DhJxNcAHGXxl/5REzfA== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(316002)(42186006)(508600001)(107886003)(356005)(47076005)(2616005)(110136005)(54906003)(70586007)(6666004)(336012)(426003)(36860700001)(186003)(7636003)(8676002)(6266002)(70206006)(4326008)(8936002)(26005)(82310400005)(4744005)(40460700003)(83380400001)(5660300002)(2906002)(36756003)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 12:38:01.1445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf4bfa8e-c5bc-4485-4010-08da1e139cf7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB5699 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Michal Simek Based on recommended guidance Copyright term should be also present in front of (c). That's why aligned driver to match this pattern. It helps automated tools with source code scanning. Signed-off-by: Michal Simek Signed-off-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 6294b714fbfa..bb9c3ebde522 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -4,7 +4,7 @@ * This is a new flat driver which is based on the original emac_lite * driver from John Williams . * - * 2007 - 2013 (c) Xilinx, Inc. + * Copyright (c) 2007 - 2013 Xilinx, Inc. */ #include From patchwork Thu Apr 14 12:37:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radhey Shyam Pandey X-Patchwork-Id: 12813473 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15636C433F5 for ; Thu, 14 Apr 2022 12:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242878AbiDNMlL (ORCPT ); Thu, 14 Apr 2022 08:41:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbiDNMlK (ORCPT ); Thu, 14 Apr 2022 08:41:10 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2049.outbound.protection.outlook.com [40.107.93.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EB19027D; Thu, 14 Apr 2022 05:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JVCgdsjCuAsd20+Y44d0vR3fPsyHgb3nCxbFK+qoRpiPNqLsVVMcK+EOFQEaYHgTIxC+SpbEezR7sU5GcAzA5qLuc8uCW+Zi19I2wWZ3IVfX+rgwp+dV+poZVrPqtEh4PTWMqIcBOokgiKv0NjPPo3cU9RTRhjo0p0lQzcQ/zpcSrKHGV8uX0kouZUgb8EPNcB31DwxBJ/i3RYsTKUlFHNuqhla3a0k2wGXccE0dRLN6LrNG5us4PWTK5gtHteh9Ynmxjrkb0KTHzoGflkZzyWjK1ov6JKxtOxUXKdJbVm7Dw93drwLOlIBl9ySG3gXyWwztLJiJGsi09dZbaKT5TQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ERScTANQNWWzuRaQXEXf9XcN7vExEMh0K9W4dzjHkmA=; b=MDizmhRcB9z5a05sxm7pZgkXula7lQZJ8+fls6er+WToS2Yig4ANDCRMAB8tNmFfmp0itjPG02fxUdSFk4Yp53EDSVXlOUtiE9PsTB/GH038rVpYbeaObplMrhaMHPNiHY+kZD/zDd/S+zMoDZmumB2bB29WOJyzsD6QIwrdh8hCEqLCokGFn/3hOOoMnovE5WD1Cu5jnuXsABZhYBAt7TEbU+5yWI2BV5O7JGi252f5h4smeNj16U6CsxEZyNneJwQkQ6kkaWQnwYrNDnyg3eZ322bw9a7ORU/+OJudW06ZZrhaHMPwcDSksk77vHVjCOSx1Fw1/u8QulePNXHoEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=davemloft.net smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ERScTANQNWWzuRaQXEXf9XcN7vExEMh0K9W4dzjHkmA=; b=s4GeB4IxnPvqwCy0W7mymEsJ/ZzLiW48smUPaYqYWrmS497602JgtDIAzTK/bQLJd/la4NbNBO9sKWS/WmiNOIFrs/d+2eGN/RPGfIcdtaQu8/rDYLwKW77/uBQhIo1iu3t8BqO2wGgom48cQEMij8el7Pj9aMWzbHcD/Jnsk90= Received: from BN9PR03CA0543.namprd03.prod.outlook.com (2603:10b6:408:138::8) by MWHPR0201MB3596.namprd02.prod.outlook.com (2603:10b6:301:79::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 12:38:42 +0000 Received: from BN1NAM02FT013.eop-nam02.prod.protection.outlook.com (2603:10b6:408:138:cafe::c0) by BN9PR03CA0543.outlook.office365.com (2603:10b6:408:138::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20 via Frontend Transport; Thu, 14 Apr 2022 12:38:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT013.mail.protection.outlook.com (10.13.2.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5164.19 via Frontend Transport; Thu, 14 Apr 2022 12:38:41 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 14 Apr 2022 05:37:59 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 14 Apr 2022 05:37:59 -0700 Envelope-to: git@xilinx.com, davem@davemloft.net, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, andrew@lunn.ch, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Received: from [172.23.64.6] (port=53841 helo=xhdvnc106.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1neyjX-0006t9-CM; Thu, 14 Apr 2022 05:37:59 -0700 Received: by xhdvnc106.xilinx.com (Postfix, from userid 13245) id 05E7661070; Thu, 14 Apr 2022 18:07:19 +0530 (IST) From: Radhey Shyam Pandey To: , , , CC: , , , , , Shravya Kumbham , "Radhey Shyam Pandey" Subject: [PATCH net-next 3/3] net: emaclite: Remove custom BUFFER_ALIGN macro Date: Thu, 14 Apr 2022 18:07:11 +0530 Message-ID: <1649939831-14901-4-git-send-email-radhey.shyam.pandey@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> References: <1649939831-14901-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a08b520-d528-4439-9122-08da1e13b502 X-MS-TrafficTypeDiagnostic: MWHPR0201MB3596:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sJqx79BPMXIHxuiLb+cwBLiVDzctVjNLhtORUXMSX+hAJKWo2oGqpsAxu3RjZn10LaJ6GNEE1nwJLNzujukFlc1bYP6aNOZNUeBsE+lQdHWWMYnYwJBqrTjxV/scBJXA5DD4Ok5WCaJjIGTCvv6Y0VbRy5qkdyy4b901wAEA0CBirB18a8yRHOclrTaBcvJlOHDK/4pKkqRUSaDRsDzg8ZGtlv+5Puk50UxPWUtvKUwEXxyGUJjv2sb35ECR048Vz0gKku+0/BK1e+Txkdc9fgb+CULDfkExVHEId2Rngyr5HHLWfDc9PO/8EEiCtdGN1oGFdTPdM1PA10inUnhWZhcItDHFjckjIDXjuld5mjXwbVq4S9s3cdgrM83PeyTfTHsh+l1ZHI0rsWdvwwXu5tRzNlm6nOBS0yS1qdOc8At6wwonvjpRPhetuvbnKQ2OP7xWPpnfV+8/rqbbOvOCawAounecXzCa59bGE85MMGBsAkqX7HBV8S1NqWRLjhqQCzsxk/kNHnsQF3FsJTJuvydrMAbI13SwrRRxmUkeOBztSVhXJrqAnnwGepXh3IKnDQaoQJjRxfjWQ9UOchO2HvF6pazu9uGudg27DI07YDwOszP0fBCbXoEgM+AU7kPGWh0IFXpFBUSWFkyn7DCuu32stiFuVPn1nh+UUF6LOY3W9oirhdKKJGosavr1YHRXCvYAbghkUD0VCZSVl4A2Gg== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(47076005)(82310400005)(70586007)(508600001)(6666004)(83380400001)(426003)(336012)(42186006)(7636003)(36756003)(316002)(36860700001)(356005)(110136005)(8936002)(54906003)(70206006)(5660300002)(2906002)(186003)(40460700003)(2616005)(8676002)(26005)(107886003)(4326008)(6266002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 12:38:41.4996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a08b520-d528-4439-9122-08da1e13b502 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT013.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3596 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Shravya Kumbham BUFFER_ALIGN macro is used to calculate the number of bytes required for the next alignment. Instead of this, we can directly use the skb_reserve(skb, NET_IP_ALIGN) to make the protocol header buffer aligned on at least a 4-byte boundary, where the NET_IP_ALIGN is by default defined as 2. So removing the BUFFER_ALIGN and its related defines which it can be done by the skb_reserve() itself. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index bb9c3ebde522..7a86ae82fcc1 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -91,10 +91,6 @@ #define XEL_HEADER_IP_LENGTH_OFFSET 16 /* IP Length Offset */ #define TX_TIMEOUT (60 * HZ) /* Tx timeout is 60 seconds. */ -#define ALIGNMENT 4 - -/* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */ -#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((uintptr_t)adr)) % ALIGNMENT) #ifdef __BIG_ENDIAN #define xemaclite_readl ioread32be @@ -595,11 +591,10 @@ static void xemaclite_rx_handler(struct net_device *dev) { struct net_local *lp = netdev_priv(dev); struct sk_buff *skb; - unsigned int align; u32 len; len = ETH_FRAME_LEN + ETH_FCS_LEN; - skb = netdev_alloc_skb(dev, len + ALIGNMENT); + skb = netdev_alloc_skb(dev, len + NET_IP_ALIGN); if (!skb) { /* Couldn't get memory. */ dev->stats.rx_dropped++; @@ -607,16 +602,7 @@ static void xemaclite_rx_handler(struct net_device *dev) return; } - /* A new skb should have the data halfword aligned, but this code is - * here just in case that isn't true. Calculate how many - * bytes we should reserve to get the data to start on a word - * boundary - */ - align = BUFFER_ALIGN(skb->data); - if (align) - skb_reserve(skb, align); - - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); len = xemaclite_recv_data(lp, (u8 *)skb->data, len);