linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [net-next] net: korina: fix compile-testing on x86
@ 2021-04-21 14:01 Arnd Bergmann
  2021-04-21 14:09 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-04-21 14:01 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Thomas Bogendoerfer
  Cc: Arnd Bergmann, Andrew Lunn, Valentin Vidic, Mike Rapoport,
	Vincent Stehlé,
	netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The 'desc_empty' enum in this driver conflicts with a function
of the same namem that is declared in an x86 header:

drivers/net/ethernet/korina.c:326:9: error: 'desc_empty' redeclared as different kind of symbol
  326 |         desc_empty
      |         ^~~~~~~~~~
In file included from arch/x86/include/asm/elf.h:93,
                 from include/linux/elf.h:6,
                 from include/linux/module.h:18,
                 from drivers/net/ethernet/korina.c:36:
arch/x86/include/asm/desc.h:99:19: note: previous definition of 'desc_empty' with type 'int(const void *)'
   99 | static inline int desc_empty(const void *ptr)

As the header was there first, rename the enum value to use
a more specific namespace.

Fixes: 6ef92063bf94 ("net: korina: Make driver COMPILE_TESTable")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/korina.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index 4878e527e3c8..300b5e8aac3a 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -322,8 +322,8 @@ struct dma_reg {
 #define TX_TIMEOUT	(6000 * HZ / 1000)
 
 enum chain_status {
-	desc_filled,
-	desc_empty
+	korina_desc_filled,
+	korina_desc_empty
 };
 
 #define DMA_COUNT(count)	((count) & DMA_DESC_COUNT_MSK)
@@ -459,7 +459,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
 	chain_next = (idx + 1) & KORINA_TDS_MASK;
 
 	if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
-		if (lp->tx_chain_status == desc_empty) {
+		if (lp->tx_chain_status == korina_desc_empty) {
 			/* Update tail */
 			td->control = DMA_COUNT(length) |
 					DMA_DESC_COF | DMA_DESC_IOF;
@@ -486,16 +486,16 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
 			       &lp->tx_dma_regs->dmandptr);
 			/* Move head to tail */
 			lp->tx_chain_head = lp->tx_chain_tail;
-			lp->tx_chain_status = desc_empty;
+			lp->tx_chain_status = korina_desc_empty;
 		}
 	} else {
-		if (lp->tx_chain_status == desc_empty) {
+		if (lp->tx_chain_status == korina_desc_empty) {
 			/* Update tail */
 			td->control = DMA_COUNT(length) |
 					DMA_DESC_COF | DMA_DESC_IOF;
 			/* Move tail */
 			lp->tx_chain_tail = chain_next;
-			lp->tx_chain_status = desc_filled;
+			lp->tx_chain_status = korina_desc_filled;
 		} else {
 			/* Update tail */
 			td->control = DMA_COUNT(length) |
@@ -864,11 +864,11 @@ korina_tx_dma_interrupt(int irq, void *dev_id)
 
 		korina_tx(dev);
 
-		if (lp->tx_chain_status == desc_filled &&
+		if (lp->tx_chain_status == korina_desc_filled &&
 			(readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
 			writel(korina_tx_dma(lp, lp->tx_chain_head),
 			       &lp->tx_dma_regs->dmandptr);
-			lp->tx_chain_status = desc_empty;
+			lp->tx_chain_status = korina_desc_empty;
 			lp->tx_chain_head = lp->tx_chain_tail;
 			netif_trans_update(dev);
 		}
@@ -999,7 +999,7 @@ static int korina_alloc_ring(struct net_device *dev)
 	}
 	lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail =
 			lp->tx_full = lp->tx_count = 0;
-	lp->tx_chain_status = desc_empty;
+	lp->tx_chain_status = korina_desc_empty;
 
 	/* Initialize the receive descriptors */
 	for (i = 0; i < KORINA_NUM_RDS; i++) {
@@ -1027,7 +1027,7 @@ static int korina_alloc_ring(struct net_device *dev)
 	lp->rx_next_done  = 0;
 	lp->rx_chain_head = 0;
 	lp->rx_chain_tail = 0;
-	lp->rx_chain_status = desc_empty;
+	lp->rx_chain_status = korina_desc_empty;
 
 	return 0;
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [net-next] net: korina: fix compile-testing on x86
  2021-04-21 14:01 [PATCH] [net-next] net: korina: fix compile-testing on x86 Arnd Bergmann
@ 2021-04-21 14:09 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2021-04-21 14:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S. Miller, Jakub Kicinski, Thomas Bogendoerfer,
	Arnd Bergmann, Valentin Vidic, Mike Rapoport, Vincent Stehlé,
	netdev, linux-kernel

On Wed, Apr 21, 2021 at 04:01:12PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The 'desc_empty' enum in this driver conflicts with a function
> of the same namem that is declared in an x86 header:

Hi Arnd

DaveM fixed this yesterday. It should be in net-next.

      Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-21 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 14:01 [PATCH] [net-next] net: korina: fix compile-testing on x86 Arnd Bergmann
2021-04-21 14:09 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).