From patchwork Thu Jan 28 16:23:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8152181 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A88F9BEEE5 for ; Thu, 28 Jan 2016 16:25:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C101C2020F for ; Thu, 28 Jan 2016 16:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA73320122 for ; Thu, 28 Jan 2016 16:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161011AbcA1QYk (ORCPT ); Thu, 28 Jan 2016 11:24:40 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:58151 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967059AbcA1QYj (ORCPT ); Thu, 28 Jan 2016 11:24:39 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0MEwG2-1aHjx20Xuc-00G0IC; Thu, 28 Jan 2016 17:24:02 +0100 From: Arnd Bergmann To: Felipe Balbi Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Felipe Balbi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik , Haojian Zhuang , Daniel Mack , Imre Kaloz , Krzysztof Halasa , Greg Kroah-Hartman , linux-omap@vger.kernel.org Subject: [PATCH 6/7] usb: musb: use %pad format string from dma_addr_t Date: Thu, 28 Jan 2016 17:23:14 +0100 Message-Id: <1453998206-3490016-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453998206-3490016-1-git-send-email-arnd@arndb.de> References: <1453997722-3489596-1-git-send-email-arnd@arndb.de> <1453998206-3490016-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:qN/LfIfCHw+VvXvijpVDT4Zf8whM+EekeZqs/l2otbhRhqzrf7d ETfHfpDtymvaumB1NzgVkxoSt3weRnNbIHmbVemtlvOvbax6D3DGq3Ngzhw0WsxeJtSjn4H Ga8khRxnIgg0lNe6NkwZtTO76gzJPtdj2rpOA2BxtxFNGONGL/uqgYEvICDECrD/OhyldMn U1HbI/iken6nYoxksPybA== X-UI-Out-Filterresults: notjunk:1; V01:K0:PYwbjvpbtnY=:Tp/QWh6qVhVg+yhy6OCJMa jEF9P6CL7S6qOsm0brX7MHn/MuGYyNwBRx0gYxrQHfXzVAb3g5yaVzNx/7xiExvdFZaMYTbyE mBgPz7zNMLLl24ok2VkiCsI5e2aWI9lQOphwlNdWwNQUDxg+wGd8Vy5+lUPW0ZaJXNg2wQul6 C/93MwCE+7xnXA2gcLgqzq+T+wvkdb/BKeEejho4cvJuhV9fAkWpIKsYnAp5M5dWuHJTUzXM7 AsYoDflhz8UN6ACWCUfdNqs3D2oiPuNg9hlZZopjLMOtGFwXmAAFXxS09595jBHopR6m/zlYf QQ2t4rfRtAdZ/XX4XEa1ZjFq2TZnq52UVsL2Jly/OgvhIljuoyXPhgi+KhSxRkCmoIblARVbx PTkMMQZ5sOq/yc9iPLqi2FkqEraAwW4SRD1CQPMmTFDLKOjdIQaxYUa1S9HYPyl6TE3OoeWHg PN3CqK27MOJ7EO/Ed0rPYK/H36Q+sWlvcjIz4Ivvr3vFSdfI+jLjsI0u8NlmhIu0DD/h5PngJ 8MVB+qtnwzQhoA7XPQlyOkY/E66ifTWO+3CYv0nuul2um+uLYhXioWa1/40VOg7mAkKxrQAn3 Ro7zghOhM1pDU0ahAN8N9moj1dT5Jm18S+W72Tsul/lpDZmNSxURz/wWfeR7iw+zol6XnKCbr H+4REtk32VQ4BFsCLyNMsNBQYOTfcv68BiS/gf/QzUA8Z0TCjyamw+8WTCjIuQRQ/uQ4= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren --- drivers/usb/musb/musbhsdma.c | 8 ++++---- drivers/usb/musb/tusb6010_omap.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 7539c3188ffc..8abfe4ec62fb 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -117,8 +117,8 @@ static void configure_channel(struct dma_channel *channel, u8 bchannel = musb_channel->idx; u16 csr = 0; - dev_dbg(musb->controller, "%p, pkt_sz %d, addr 0x%x, len %d, mode %d\n", - channel, packet_sz, dma_addr, len, mode); + dev_dbg(musb->controller, "%p, pkt_sz %d, addr %pad, len %d, mode %d\n", + channel, packet_sz, &dma_addr, len, mode); if (mode) { csr |= 1 << MUSB_HSDMA_MODE1_SHIFT; @@ -152,10 +152,10 @@ static int dma_channel_program(struct dma_channel *channel, struct musb_dma_controller *controller = musb_channel->controller; struct musb *musb = controller->private_data; - dev_dbg(musb->controller, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n", + dev_dbg(musb->controller, "ep%d-%s pkt_sz %d, dma_addr %pad length %d, mode %d\n", musb_channel->epnum, musb_channel->transmit ? "Tx" : "Rx", - packet_sz, dma_addr, len, mode); + packet_sz, &dma_addr, len, mode); BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN || channel->status == MUSB_DMA_STATUS_BUSY); diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 4c82077da475..e6959ccb4453 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -310,9 +310,9 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, dma_params.frame_count = chdat->transfer_len / 32; /* Burst sz frame */ - dev_dbg(musb->controller, "ep%i %s dma ch%i dma: %08x len: %u(%u) packet_sz: %i(%i)\n", + dev_dbg(musb->controller, "ep%i %s dma ch%i dma: %pad len: %u(%u) packet_sz: %i(%i)\n", chdat->epnum, chdat->tx ? "tx" : "rx", - ch, dma_addr, chdat->transfer_len, len, + ch, &dma_addr, chdat->transfer_len, len, chdat->transfer_packet_sz, packet_sz); /*