Skip to contentSkip to conversation

net: ax88796: avoid 64 bit arithmetic

PATCH Superseded Arnd Bergmann 2 participants 5 messages Apr 19, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ax88796: avoid 64 bit arithmetic

When building ax88796 on an ARM platform with 64-bit resource_size_t, we currently get

drivers/net/ethernet/8390/ax88796.c:875: undefined reference to `__aeabi_uldivmod'

because we do a division on the length of the MMIO resource. Since we know that this resource is very short, using an "unsigned long" instead of "resource_size_t" is entirely sufficient, and avoids this link-time error.

drivers/net/ethernet/8390/ax88796.c +1 -1
index cab306a..e1d2643 100644
@@ -828,7 +828,7 @@ static int ax_probe(struct platform_device *pdev)
 	struct ei_device *ei_local;
 	struct ax_device *ax;
 	struct resource *irq, *mem, *mem2;
-	resource_size_t mem_size, mem2_size = 0;
+	unsigned long mem_size, mem2_size = 0;
 	int ret = 0;
 
 	dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
maintainer
#1 lore raw

From: Arnd Bergmann <[email protected]>
Date: Fri, 19 Apr 2013 15:06:21 +0200

Quoted 9 lines

When building ax88796 on an ARM platform with 64-bit resource_size_t, we currently get

drivers/net/ethernet/8390/ax88796.c:875: undefined reference to `__aeabi_uldivmod'

because we do a division on the length of the MMIO resource. Since we know that this resource is very short, using an "unsigned long" instead of "resource_size_t" is entirely sufficient, and avoids this link-time error.

Please provide a proper signoff with your patches, thanks.

#2 lore raw
Quoted 6 lines · David Miller

From: Arnd Bergmann <[email protected]>
Date: Fri, 19 Apr 2013 15:06:21 +0200

Quoted 3 lines

When building ax88796 on an ARM platform with 64-bit resource_size_t, we currently get

Quoted 8 lines
Quoted 6 lines

drivers/net/ethernet/8390/ax88796.c:875: undefined reference to `__aeabi_uldivmod'

because we do a division on the length of the MMIO resource. Since we know that this resource is very short, using an "unsigned long" instead of "resource_size_t" is entirely sufficient, and avoids this link-time error.

Please provide a proper signoff with your patches, thanks.

Sorry about this, I have no idea how this slipped through. I'll send a new version right away.

Arnd

#3 lore raw

PATCH v2 1/1 net: ax88796: avoid 64 bit arithmetic

In reply to David Miller

When building ax88796 on an ARM platform with 64-bit resource_size_t, we currently get

drivers/net/ethernet/8390/ax88796.c:875: undefined reference to `__aeabi_uldivmod'

because we do a division on the length of the MMIO resource. Since we know that this resource is very short, using an "unsigned long" instead of "resource_size_t" is entirely sufficient, and avoids this link-time error.

---

drivers/net/ethernet/8390/ax88796.c +1 -1
index cab306a..e1d2643 100644
@@ -828,7 +828,7 @@ static int ax_probe(struct platform_device *pdev)
 	struct ei_device *ei_local;
 	struct ax_device *ax;
 	struct resource *irq, *mem, *mem2;
-	resource_size_t mem_size, mem2_size = 0;
+	unsigned long mem_size, mem2_size = 0;
 	int ret = 0;
 
 	dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
maintainer Applied
#4 lore raw

From: Arnd Bergmann <[email protected]>
Date: Fri, 19 Apr 2013 20:47:26 +0200

Quoted 5 lines

When building ax88796 on an ARM platform with 64-bit resource_size_t, we currently get

drivers/net/ethernet/8390/ax88796.c:875: undefined reference to `__aeabi_uldivmod'

Quoted 8 lines

because we do a division on the length of the MMIO resource. Since we know that this resource is very short, using an "unsigned long" instead of "resource_size_t" is entirely sufficient, and avoids this link-time error.

Applied.