Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp418007rwe; Fri, 26 Aug 2022 07:24:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qrkwbYfQ4GvxVXmkeehm4f2Z2dPsukF4Min0/7QocQcWnn6EPzum5dKvC9u3lQOXak3tX X-Received: by 2002:a17:907:1689:b0:73d:c059:a18c with SMTP id hc9-20020a170907168900b0073dc059a18cmr5757504ejc.396.1661523855936; Fri, 26 Aug 2022 07:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661523855; cv=none; d=google.com; s=arc-20160816; b=RMjUmOLuNTY+q+9V5R0XLR7UX241qYBZ7Cd6WSLm0WuViDmeUCNLQkANOxmVt+/CIg KM8buzDSI2oCfpwoNRWPVRX5adlwv9DO8TG50U9f6vo4NSCgw9NezAN/xLlArpFADgCK EAPhPG4CnDM0QpnRhs6F86G47BvHsia5iJvleFUKv4is39BAInzbgst7Vf3lMXiX0RXj ff525JN5gORbLKlAlB/v2z87KXgC8jYH7HCukR6bqkhm/fCSlldPeZu88MuNaQONA5mQ 7wg5Ib0XZND9GMqpM2D7Orsu9FS1eADZlbPoaSQ2zi0K4bkN1u2aNsSbO9BJmOKo2OsR ExlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z9sKp+7AeBEnC99qskaSacC/BNkZK2Qi85fLquRHceM=; b=T/huN699cGf61vojInfjVqGRylvlyRJoKC82GvObxhw3R4m3wOCzabJLPJsRQpjJck Au2K9CbFlM9YxmAdj/ZiiHV7PejKmzVCczyKFGEgndRJcQiaX8yXUbk2QwAGn4Ylu5tP SaqjKH1MVijIYZIAe/IJbAqX5WZIGLHMGx3qUUOnn/QkLJlyVDJqcKb/7YO7xsLJWAbq WzXUevH8KCET4iDT/LOx53f7QH1YODfJupyU9DQDKPeUWMPZGrE7QGI2KnThgyLYn/yi +vZcNZQQx2dBVyF+jVRtzwR0SJorTPzeSbKaYIndaMG/WABrILJSF60mM0fAjoHdYEBh ov/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LWpriFrb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o29-20020a509b1d000000b0043cfe918270si1364713edi.529.2022.08.26.07.23.43; Fri, 26 Aug 2022 07:24:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LWpriFrb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344377AbiHZNzW (ORCPT + 99 others); Fri, 26 Aug 2022 09:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344378AbiHZNzH (ORCPT ); Fri, 26 Aug 2022 09:55:07 -0400 X-Greylist: delayed 91259 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 26 Aug 2022 06:55:04 PDT Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BC9E37FAE; Fri, 26 Aug 2022 06:55:01 -0700 (PDT) Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 65D3D240004; Fri, 26 Aug 2022 13:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1661522100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z9sKp+7AeBEnC99qskaSacC/BNkZK2Qi85fLquRHceM=; b=LWpriFrbAPgjv/5oM66x9Kxb/rWPfKp5C1hF53GZ4iE+S6CUVgq7HCeIPFSl/oVnqkeu3e BsKfvL2DyaaSHbkCPLGbz/NARkbaX95qItaA3pVPRqWxXx8NDNDYSXsKpO8Mn46ZG2Ro8r 3mXArEsrBpLmjyVvFXwdtMjJLlFJ2gKSze++otXAKF73CxPmaRG5mYK9tCKhgJ/dCREbA5 PHrHLgAaKHLZbFj3+tYiXZswidOqXvFpAfJlubQUIlSlDoPuum/14fT4yHvsilxQlgkvZG +hvR9nz+JNRoNmLVdyekBMRpr4fl5Wl7LYQBVWCNIwPAojK7xcMrRYiKOB9kzg== From: Maxime Chevallier To: davem@davemloft.net, Rob Herring Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH net-next 2/5] net: altera: tse: cosmetic change to use reverse xmas tree ordering Date: Fri, 26 Aug 2022 15:54:48 +0200 Message-Id: <20220826135451.526756-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220826135451.526756-1-maxime.chevallier@bootlin.com> References: <20220826135451.526756-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit is a strictly cosmetic change, to use the reverse xmas tree variable declaration ordering, and introduces no functional changes. Signed-off-by: Maxime Chevallier --- .../net/ethernet/altera/altera_tse_ethtool.c | 2 +- drivers/net/ethernet/altera/altera_tse_main.c | 43 ++++++++++--------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/altera/altera_tse_ethtool.c b/drivers/net/ethernet/altera/altera_tse_ethtool.c index 3081e5874ac5..f0b11a278644 100644 --- a/drivers/net/ethernet/altera/altera_tse_ethtool.c +++ b/drivers/net/ethernet/altera/altera_tse_ethtool.c @@ -199,9 +199,9 @@ static int tse_reglen(struct net_device *dev) static void tse_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) { - int i; struct altera_tse_private *priv = netdev_priv(dev); u32 *buf = regbuf; + int i; /* Set version to a known value, so ethtool knows * how to do any special formatting of this data. diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 8c5828582c21..930afc9ec833 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -141,10 +141,10 @@ static int altera_tse_mdio_write(struct mii_bus *bus, int mii_id, int regnum, static int altera_tse_mdio_create(struct net_device *dev, unsigned int id) { struct altera_tse_private *priv = netdev_priv(dev); - int ret; struct device_node *mdio_node = NULL; - struct mii_bus *mdio = NULL; struct device_node *child_node = NULL; + struct mii_bus *mdio = NULL; + int ret; for_each_child_of_node(priv->device->of_node, child_node) { if (of_device_is_compatible(child_node, "altr,tse-mdio")) { @@ -236,8 +236,8 @@ static int tse_init_rx_buffer(struct altera_tse_private *priv, static void tse_free_rx_buffer(struct altera_tse_private *priv, struct tse_buffer *rxbuffer) { - struct sk_buff *skb = rxbuffer->skb; dma_addr_t dma_addr = rxbuffer->dma_addr; + struct sk_buff *skb = rxbuffer->skb; if (skb != NULL) { if (dma_addr) @@ -358,6 +358,7 @@ static inline void tse_rx_vlan(struct net_device *dev, struct sk_buff *skb) { struct ethhdr *eth_hdr; u16 vid; + if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && !__vlan_get_tag(skb, &vid)) { eth_hdr = (struct ethhdr *)skb->data; @@ -371,10 +372,10 @@ static inline void tse_rx_vlan(struct net_device *dev, struct sk_buff *skb) */ static int tse_rx(struct altera_tse_private *priv, int limit) { - unsigned int count = 0; + unsigned int entry = priv->rx_cons % priv->rx_ring_size; unsigned int next_entry; + unsigned int count = 0; struct sk_buff *skb; - unsigned int entry = priv->rx_cons % priv->rx_ring_size; u32 rxstatus; u16 pktlength; u16 pktstatus; @@ -448,10 +449,10 @@ static int tse_rx(struct altera_tse_private *priv, int limit) static int tse_tx_complete(struct altera_tse_private *priv) { unsigned int txsize = priv->tx_ring_size; - u32 ready; - unsigned int entry; struct tse_buffer *tx_buff; + unsigned int entry; int txcomplete = 0; + u32 ready; spin_lock(&priv->tx_lock); @@ -497,8 +498,8 @@ static int tse_poll(struct napi_struct *napi, int budget) { struct altera_tse_private *priv = container_of(napi, struct altera_tse_private, napi); - int rxcomplete = 0; unsigned long int flags; + int rxcomplete = 0; tse_tx_complete(priv); @@ -561,13 +562,13 @@ static irqreturn_t altera_isr(int irq, void *dev_id) static netdev_tx_t tse_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); + unsigned int nopaged_len = skb_headlen(skb); unsigned int txsize = priv->tx_ring_size; - unsigned int entry; - struct tse_buffer *buffer = NULL; int nfrags = skb_shinfo(skb)->nr_frags; - unsigned int nopaged_len = skb_headlen(skb); + struct tse_buffer *buffer = NULL; netdev_tx_t ret = NETDEV_TX_OK; dma_addr_t dma_addr; + unsigned int entry; spin_lock_bh(&priv->tx_lock); @@ -696,8 +697,8 @@ static void altera_tse_adjust_link(struct net_device *dev) static struct phy_device *connect_local_phy(struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); - struct phy_device *phydev = NULL; char phy_id_fmt[MII_BUS_ID_SIZE + 3]; + struct phy_device *phydev = NULL; if (priv->phy_addr != POLL_PHY) { snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, @@ -773,8 +774,8 @@ static int altera_tse_phy_get_addr_mdio_create(struct net_device *dev) static int init_phy(struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); - struct phy_device *phydev; struct device_node *phynode; + struct phy_device *phydev; bool fixed_link = false; int rc = 0; @@ -1012,8 +1013,8 @@ static int tse_change_mtu(struct net_device *dev, int new_mtu) static void altera_tse_set_mcfilter(struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); - int i; struct netdev_hw_addr *ha; + int i; /* clear the hash filter */ for (i = 0; i < 64; i++) @@ -1152,9 +1153,9 @@ static int init_sgmii_pcs(struct net_device *dev) static int tse_open(struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); + unsigned long flags; int ret = 0; int i; - unsigned long int flags; /* Reset and configure TSE MAC and probe associated PHY */ ret = priv->dmaops->init_dma(priv); @@ -1265,8 +1266,8 @@ static int tse_open(struct net_device *dev) static int tse_shutdown(struct net_device *dev) { struct altera_tse_private *priv = netdev_priv(dev); - int ret; unsigned long int flags; + int ret; /* Stop the PHY */ if (dev->phydev) @@ -1320,8 +1321,8 @@ static struct net_device_ops altera_tse_netdev_ops = { static int request_and_map(struct platform_device *pdev, const char *name, struct resource **res, void __iomem **ptr) { - struct resource *region; struct device *device = &pdev->dev; + struct resource *region; *res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); if (*res == NULL) { @@ -1350,13 +1351,13 @@ static int request_and_map(struct platform_device *pdev, const char *name, */ static int altera_tse_probe(struct platform_device *pdev) { - struct net_device *ndev; - int ret = -ENODEV; + const struct of_device_id *of_id = NULL; + struct altera_tse_private *priv; struct resource *control_port; struct resource *dma_res; - struct altera_tse_private *priv; + struct net_device *ndev; void __iomem *descmap; - const struct of_device_id *of_id = NULL; + int ret = -ENODEV; ndev = alloc_etherdev(sizeof(struct altera_tse_private)); if (!ndev) { -- 2.37.2