usb: musb: use %pad format string from dma_addr_t
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Jan 2016 16:23:14 +0000 (17:23 +0100)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:30 +0000 (15:14 +0200)
commit3ec08ddf13d50ad188ac5122d74284df67beb02e
tree3656bb4ad6b841e5682f3692b1cce8e5afc6755d
parent5b35becce78fd0640c16e66a4741e3441d257d11
usb: musb: use %pad format string from dma_addr_t

The musb driver prints DMA addresses in a few places, using the
0x%x format string. This is wrong on 64-bit architectures (which
need %lx) and 32-bit ARM with CONFIG_LPAE set (which needs
%llx), otherwise we print the wrong data, as gcc warns:

musb/musbhsdma.c: In function 'configure_channel':
musb/musbhsdma.c:120:53: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
  dev_dbg(musb->controller, "%p, pkt_sz %d, addr 0x%x, len %d, mode %d\n",
musb/musbhsdma.c: In function 'dma_channel_program':
musb/musbhsdma.c:155:53: error: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
  dev_dbg(musb->controller, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n",
musb/tusb6010_omap.c: In function 'tusb_omap_dma_program':
musb/tusb6010_omap.c:313:53: error: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
  dev_dbg(musb->controller, "ep%i %s dma ch%i dma: %08x len: %u(%u) packet_sz: %i(%i)\n",

This uses the %pad format string, which prints a dma_addr_t that
gets passed by reference, which works for all combinations.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/musb/musbhsdma.c
drivers/usb/musb/tusb6010_omap.c
This page took 0.024992 seconds and 5 git commands to generate.