From nobody Wed Apr 1 22:20:21 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD95B47277C for ; Wed, 1 Apr 2026 16:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775061576; cv=none; b=FZ7Zoa78duaVjcD7vw8gqq7pvqa7mfo0MOlAOIm82pELvMnM5ZjtnO2FZ5BJ8uXw5qShx/PpmGo1jZ+BCiKBsChdFL3PdK9Goof8NIf5NdBM7mMqbRzxm4WFuf9srnAsjCcuIIrhOIqY9pw0giy75h8ZzQKc+vozAVDJf/3A7bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775061576; c=relaxed/simple; bh=2Li85y3O0B5xRflVjiPQmdDthz1Sij/s+po81PL0O5g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+QHtnpipdf+Mn2vnU+ouWFWC51s5Vsspc/nA/7PROeKXAExlBNxHA9mnKE1x/tcTmHEHND+viLRzeIn/Cpj8yleAMzYtSxfNiFj8PLi5B0F0en2IyWwFmazcPxwXjiaq4wH3dn/52TlkjHjcrluVR4rNi6MQTqjbmEaPZuarQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=zLlB3BlQ; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="zLlB3BlQ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 23F88C5996F; Wed, 1 Apr 2026 16:40:02 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 11656602BF; Wed, 1 Apr 2026 16:39:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 94F7510450306; Wed, 1 Apr 2026 18:39:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775061569; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=DWtIq6jd1F1PaNYVYR5QTVPdsPIiGubpvbe0+JPvC9s=; b=zLlB3BlQyXf0HvaA39mmXsTSYrpAbohWHoKNcgIHs/WQY9I8t1pcHN7rJve5bTQj44YoCc kcuTvlG2XKfElBvPFaB9o7sDtBvSQROixp6HFz8kO0POj8kZmX2m+bBNlJ0CkYpG8f14xn EYd6cj3QMz12TIRtOl07ia0X77M0jUMjbGvVUz0PWA4hjjSUl3zqB5zwUUh9dJM7C6YP/1 YnbPM+JzbjOSTcrpHIz1qCJBlcrkUiiO9FbVEV8t9m7yT6R8ThA6Low2zy2mqv5SOgRkw5 Oea+L/PcETGAyUtlkR4JIbhfJzh8eIrtx1qhKK4VR6OeaP8PphL5ASsxF9JCqA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 01 Apr 2026 18:39:06 +0200 Subject: [PATCH net-next 03/11] net: macb: unify queue index variable naming convention and types Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260401-macb-context-v1-3-9590c5ab7272@bootlin.com> References: <20260401-macb-context-v1-0-9590c5ab7272@bootlin.com> In-Reply-To: <20260401-macb-context-v1-0-9590c5ab7272@bootlin.com> To: Nicolas Ferre , Claudiu Beznea , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Russell King Cc: Paolo Valerio , Conor Dooley , Nicolai Buchwitz , Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Beno=C3=AEt_Monin?= , Tawfik Bayouk , Thomas Petazzoni , Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.15.0 X-Last-TLS-Session-Version: TLSv1.3 Variables are named q or queue_index. Types are int, unsigned int, u32 and u16. Use `unsigned int q` everywhere. Skip over taprio functions. They use `u8 queue_id` which fits with the `struct macb_queue_enst_config` field. Using `queue_id` everywhere would be too verbose. Signed-off-by: Th=C3=A9o Lebrun --- drivers/net/ethernet/cadence/macb_main.c | 30 +++++++++++++++-------------= -- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 05ccb6f186f7..087401163771 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -873,7 +873,7 @@ static void gem_shuffle_tx_one_ring(struct macb_queue *= queue) static void gem_shuffle_tx_rings(struct macb *bp) { struct macb_queue *queue; - int q; + unsigned int q; =20 for (q =3D 0, queue =3D bp->queues; q < bp->num_queues; q++, queue++) gem_shuffle_tx_one_ring(queue); @@ -1254,7 +1254,7 @@ static void macb_tx_error_task(struct work_struct *wo= rk) tx_error_task); bool halt_timeout =3D false; struct macb *bp =3D queue->bp; - u32 queue_index; + unsigned int q; u32 packets =3D 0; u32 bytes =3D 0; struct macb_tx_skb *tx_skb; @@ -1263,9 +1263,9 @@ static void macb_tx_error_task(struct work_struct *wo= rk) unsigned int tail; unsigned long flags; =20 - queue_index =3D queue - bp->queues; + q =3D queue - bp->queues; netdev_vdbg(bp->netdev, "macb_tx_error_task: q =3D %u, t =3D %u, h =3D %u= \n", - queue_index, queue->tx_tail, queue->tx_head); + q, queue->tx_tail, queue->tx_head); =20 /* Prevent the queue NAPI TX poll from running, as it calls * macb_tx_complete(), which in turn may call netif_wake_subqueue(). @@ -1338,7 +1338,7 @@ static void macb_tx_error_task(struct work_struct *wo= rk) macb_tx_unmap(bp, tx_skb, 0); } =20 - netdev_tx_completed_queue(netdev_get_tx_queue(bp->netdev, queue_index), + netdev_tx_completed_queue(netdev_get_tx_queue(bp->netdev, q), packets, bytes); =20 /* Set end of TX queue */ @@ -1403,7 +1403,7 @@ static bool ptp_one_step_sync(struct sk_buff *skb) static int macb_tx_complete(struct macb_queue *queue, int budget) { struct macb *bp =3D queue->bp; - u16 queue_index =3D queue - bp->queues; + unsigned int q =3D queue - bp->queues; unsigned long flags; unsigned int tail; unsigned int head; @@ -1465,14 +1465,14 @@ static int macb_tx_complete(struct macb_queue *queu= e, int budget) } } =20 - netdev_tx_completed_queue(netdev_get_tx_queue(bp->netdev, queue_index), + netdev_tx_completed_queue(netdev_get_tx_queue(bp->netdev, q), packets, bytes); =20 queue->tx_tail =3D tail; - if (__netif_subqueue_stopped(bp->netdev, queue_index) && + if (__netif_subqueue_stopped(bp->netdev, q) && CIRC_CNT(queue->tx_head, queue->tx_tail, bp->tx_ring_size) <=3D MACB_TX_WAKEUP_THRESH(bp)) - netif_wake_subqueue(bp->netdev, queue_index); + netif_wake_subqueue(bp->netdev, q); spin_unlock_irqrestore(&queue->tx_ptr_lock, flags); =20 if (packets) @@ -2496,10 +2496,10 @@ static int macb_pad_and_fcs(struct sk_buff **skb, s= truct net_device *netdev) static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *netdev) { - u16 queue_index =3D skb_get_queue_mapping(skb); struct macb *bp =3D netdev_priv(netdev); - struct macb_queue *queue =3D &bp->queues[queue_index]; + unsigned int q =3D skb_get_queue_mapping(skb); unsigned int desc_cnt, nr_frags, frag_size, f; + struct macb_queue *queue =3D &bp->queues[q]; unsigned int hdrlen; unsigned long flags; bool is_lso; @@ -2539,7 +2539,7 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *sk= b, #if defined(DEBUG) && defined(VERBOSE_DEBUG) netdev_vdbg(bp->netdev, "start_xmit: queue %hu len %u head %p data %p tail %p end %p\n", - queue_index, skb->len, skb->head, skb->data, + q, skb->len, skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb)); print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1, skb->data, 16, true); @@ -2565,7 +2565,7 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *sk= b, /* This is a hard error, log it. */ if (CIRC_SPACE(queue->tx_head, queue->tx_tail, bp->tx_ring_size) < desc_cnt) { - netif_stop_subqueue(netdev, queue_index); + netif_stop_subqueue(netdev, q); netdev_dbg(netdev, "tx_head =3D %u, tx_tail =3D %u\n", queue->tx_head, queue->tx_tail); ret =3D NETDEV_TX_BUSY; @@ -2581,7 +2581,7 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *sk= b, /* Make newly initialized descriptor visible to hardware */ wmb(); skb_tx_timestamp(skb); - netdev_tx_sent_queue(netdev_get_tx_queue(bp->netdev, queue_index), + netdev_tx_sent_queue(netdev_get_tx_queue(bp->netdev, q), skb->len); =20 spin_lock(&bp->lock); @@ -2590,7 +2590,7 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *sk= b, spin_unlock(&bp->lock); =20 if (CIRC_SPACE(queue->tx_head, queue->tx_tail, bp->tx_ring_size) < 1) - netif_stop_subqueue(netdev, queue_index); + netif_stop_subqueue(netdev, q); =20 unlock: spin_unlock_irqrestore(&queue->tx_ptr_lock, flags); --=20 2.53.0