Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

declance: Fix 64-bit compilation warnings

This fixes compiler warnings:

drivers/net/ethernet/amd/declance.c: In function 'lance_init_ring':
drivers/net/ethernet/amd/declance.c:478: warning: format '%8.8x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/net/ethernet/amd/declance.c:487: warning: format '%8.8x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/net/ethernet/amd/declance.c:503: warning: cast from pointer to integer of different size
drivers/net/ethernet/amd/declance.c:520: warning: cast from pointer to integer of different size

in 64-bit compilation. Where the value printed is an offset (whose range
will always fit) the cast uses a 32-bit type, otherwise, where it is a
host memory address, the pointer is output directly with %p. Also the
remaining `0x' prefix is dropped for consistency across these messages.

Tested with both 32-bit and 64-bit compilation, as well as at the run time
(with the debug messages affected enabled).

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Maciej W. Rozycki and committed by
David S. Miller
3d5baba0 92a129da

+6 -6
+6 -6
drivers/net/ethernet/amd/declance.c
··· 475 475 *lib_ptr(ib, rx_ptr, lp->type) = leptr; 476 476 if (ZERO) 477 477 printk("RX ptr: %8.8x(%8.8x)\n", 478 - leptr, lib_off(brx_ring, lp->type)); 478 + leptr, (uint)lib_off(brx_ring, lp->type)); 479 479 480 480 /* Setup tx descriptor pointer */ 481 481 leptr = offsetof(struct lance_init_block, btx_ring); ··· 484 484 *lib_ptr(ib, tx_ptr, lp->type) = leptr; 485 485 if (ZERO) 486 486 printk("TX ptr: %8.8x(%8.8x)\n", 487 - leptr, lib_off(btx_ring, lp->type)); 487 + leptr, (uint)lib_off(btx_ring, lp->type)); 488 488 489 489 if (ZERO) 490 490 printk("TX rings:\n"); ··· 499 499 /* The ones required by tmd2 */ 500 500 *lib_ptr(ib, btx_ring[i].misc, lp->type) = 0; 501 501 if (i < 3 && ZERO) 502 - printk("%d: 0x%8.8x(0x%8.8x)\n", 503 - i, leptr, (uint)lp->tx_buf_ptr_cpu[i]); 502 + printk("%d: %8.8x(%p)\n", 503 + i, leptr, lp->tx_buf_ptr_cpu[i]); 504 504 } 505 505 506 506 /* Setup the Rx ring entries */ ··· 516 516 0xf000; 517 517 *lib_ptr(ib, brx_ring[i].mblength, lp->type) = 0; 518 518 if (i < 3 && ZERO) 519 - printk("%d: 0x%8.8x(0x%8.8x)\n", 520 - i, leptr, (uint)lp->rx_buf_ptr_cpu[i]); 519 + printk("%d: %8.8x(%p)\n", 520 + i, leptr, lp->rx_buf_ptr_cpu[i]); 521 521 } 522 522 iob(); 523 523 }