From patchwork Fri Dec 20 20:26:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3391711 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1882BC0D4B for ; Fri, 20 Dec 2013 20:27:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0AB620666 for ; Fri, 20 Dec 2013 20:27:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBEB220704 for ; Fri, 20 Dec 2013 20:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753820Ab3LTU1P (ORCPT ); Fri, 20 Dec 2013 15:27:15 -0500 Received: from mtv-iport-3.cisco.com ([173.36.130.14]:27865 "EHLO mtv-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753569Ab3LTU1M (ORCPT ); Fri, 20 Dec 2013 15:27:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=5502; q=dns/txt; s=iport; t=1387571232; x=1388780832; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=1fl8dD+7U+rUfmmSMFYgX2Ou1X7lwZPajjeBPtEh1V0=; b=d/guadleXLtafUJIBBOapljZFdCZoY2FXaLSCYJcaSTvStb1xvTmFmoY 46Y3A/3ASOupwIBMgTWca1NScuYXt/HBl5t5tyq1KaBBOTxZfA/rXf56o zEpSCDJiNCMZt9brK2U5CKeBulWC/RGAwaX/CzO/3mR/7BbJw8HyNPHv9 w=; X-IronPort-AV: E=Sophos;i="4.95,523,1384300800"; d="scan'208";a="98539122" Received: from mtv-core-3.cisco.com ([171.68.58.8]) by mtv-iport-3.cisco.com with ESMTP; 20 Dec 2013 20:27:11 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id rBKKRAPs001726; Fri, 20 Dec 2013 20:27:10 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id C9FD93F5BD; Fri, 20 Dec 2013 12:27:09 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH for-next 07/15] IB/usnic: Fix printk format warnings Date: Fri, 20 Dec 2013 12:26:38 -0800 Message-Id: <1387571206-8043-8-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1387571206-8043-1-git-send-email-umalhi@cisco.com> References: <1387571206-8043-1-git-send-email-umalhi@cisco.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL 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 dma_addr_t is formatted as %llx and size_t as %lx at few places in usNIC. Change these to %pa and %zx, respectively. Signed-off-by: Upinder Malhi --- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 6 +++--- drivers/infiniband/hw/usnic/usnic_uiom.c | 32 ++++++++++++++++------------ drivers/infiniband/hw/usnic/usnic_vnic.c | 4 ++-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index 9f0945a..8f8dfa2 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -592,7 +592,7 @@ int usnic_ib_dereg_mr(struct ib_mr *ibmr) { struct usnic_ib_mr *mr = to_umr(ibmr); - usnic_dbg("va 0x%lx length 0x%lx\n", mr->umem->va, mr->umem->length); + usnic_dbg("va 0x%lx length 0x%zx\n", mr->umem->va, mr->umem->length); usnic_uiom_reg_release(mr->umem, ibmr->pd->uobject->context->closing); kfree(mr); @@ -667,8 +667,8 @@ int usnic_ib_mmap(struct ib_ucontext *context, } bus_addr = bar->bus_addr; len = bar->len; - usnic_dbg("bus: 0x%llx vaddr: %p size: %ld\n", - bus_addr, bar->vaddr, bar->len); + usnic_dbg("bus: %pa vaddr: %p size: %ld\n", + &bus_addr, bar->vaddr, bar->len); mutex_unlock(&us_ibdev->usdev_lock); return remap_pfn_range(vma, diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c index 359897d..0477d70 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -81,15 +81,16 @@ static void usnic_uiom_put_pages(struct list_head *chunk_list, int dirty) struct usnic_uiom_chunk *chunk, *tmp; struct page *page; int i; + dma_addr_t pa; list_for_each_entry_safe(chunk, tmp, chunk_list, list) { for (i = 0; i < chunk->nents; i++) { page = sg_page(&chunk->page_list[i]); + pa = sg_phys(&chunk->page_list[i]); if (dirty) set_page_dirty_lock(page); put_page(page); - usnic_dbg("pa: 0x%llx\n", - sg_phys(&chunk->page_list[i])); + usnic_dbg("pa: %pa\n", &pa); } kfree(chunk); } @@ -108,6 +109,7 @@ static int usnic_uiom_get_pages(unsigned long addr, size_t size, int writable, int off; int i; int flags; + dma_addr_t pa; DEFINE_DMA_ATTRS(attrs); if (dmasync) @@ -167,9 +169,9 @@ static int usnic_uiom_get_pages(unsigned long addr, size_t size, int writable, sg_set_page(&chunk->page_list[i], page_list[i + off], PAGE_SIZE, 0); - usnic_dbg("va: 0x%lx pa: 0x%llx\n", - cur_base + i*PAGE_SIZE, - sg_phys(&chunk->page_list[i])); + pa = sg_phys(&chunk->page_list[i]); + usnic_dbg("va: 0x%lx pa: %pa\n", + cur_base + i*PAGE_SIZE, &pa); } cur_base += chunk->nents * PAGE_SIZE; ret -= chunk->nents; @@ -247,7 +249,9 @@ static int usnic_uiom_map_sorted_intervals(struct list_head *intervals, size_t size; struct usnic_uiom_chunk *chunk; struct usnic_uiom_interval_node *interval_node; - long int pa, pa_start, pa_end; + dma_addr_t pa; + dma_addr_t pa_start = 0; + dma_addr_t pa_end = 0; long int va_start = -EINVAL; struct usnic_uiom_pd *pd = uiomr->pd; long int va = uiomr->va & PAGE_MASK; @@ -276,13 +280,13 @@ iter_chunk: (pa != pa_start)) { /* PAs are not contiguous */ size = pa_end - pa_start + PAGE_SIZE; - usnic_dbg("va 0x%lx pa 0x%lx size 0x%lx flags 0x%x", - va_start, pa_start, size, flags); + usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x", + va_start, &pa_start, size, flags); err = iommu_map(pd->domain, va_start, pa_start, size, flags); if (err) { - usnic_err("Failed to map va 0x%lx pa 0x%lx size 0x%zx with err %d\n", - va_start, pa_start, size, err); + usnic_err("Failed to map va 0x%lx pa 0x%pa size 0x%zx with err %d\n", + va_start, &pa_start, size, err); goto err_out; } va_start = va; @@ -293,13 +297,13 @@ iter_chunk: if ((va >> PAGE_SHIFT) == interval_node->last) { /* Last page of the interval */ size = pa - pa_start + PAGE_SIZE; - usnic_dbg("va 0x%lx pa 0x%lx size 0x%lx flags 0x%x\n", - va_start, pa_start, size, flags); + usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x\n", + va_start, &pa_start, size, flags); err = iommu_map(pd->domain, va_start, pa_start, size, flags); if (err) { - usnic_err("Failed to map va 0x%lx pa 0x%lx size 0x%zx with err %d\n", - va_start, pa_start, size, err); + usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", + va_start, &pa_start, size, err); goto err_out; } break; diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.c b/drivers/infiniband/hw/usnic/usnic_vnic.c index ff0b32d..02d66d9 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.c +++ b/drivers/infiniband/hw/usnic/usnic_vnic.c @@ -86,9 +86,9 @@ int usnic_vnic_dump(struct usnic_vnic *vnic, char *buf, offset = 0; bar0 = usnic_vnic_get_bar(vnic, 0); offset += scnprintf(buf + offset, buf_sz - offset, - "VF:%hu BAR0 bus_addr=0x%llx vaddr=0x%p size=%ld ", + "VF:%hu BAR0 bus_addr=%pa vaddr=0x%p size=%ld ", usnic_vnic_get_index(vnic), - bar0->bus_addr, + &bar0->bus_addr, bar0->vaddr, bar0->len); if (printtitle) offset += printtitle(hdr_obj, buf + offset, buf_sz - offset);