From patchwork Thu Jan 9 22:47:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3463421 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 2D1B8C02DD for ; Thu, 9 Jan 2014 22:48:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CB0220108 for ; Thu, 9 Jan 2014 22:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D161200F3 for ; Thu, 9 Jan 2014 22:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756216AbaAIWsA (ORCPT ); Thu, 9 Jan 2014 17:48:00 -0500 Received: from mtv-iport-2.cisco.com ([173.36.130.13]:50543 "EHLO mtv-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756085AbaAIWr5 (ORCPT ); Thu, 9 Jan 2014 17:47:57 -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=1389307677; x=1390517277; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=1fl8dD+7U+rUfmmSMFYgX2Ou1X7lwZPajjeBPtEh1V0=; b=AVcOr9gE379J63jj+xkuo0NW+nv+i7we5lwCjgvhgwv84H8TbeOZ7Pp2 Ynk4U+piMydSiZPhC/5IM3UthuquWriMvQm5twXF7GE1w2akf/GUd4pyG lvOdhjRdJysk6KXofwieLoJDE/9v/Ilv3qHP0k9tcbEuim43JiQ2V/JTe s=; X-IronPort-AV: E=Sophos;i="4.95,634,1384300800"; d="scan'208";a="102511253" Received: from mtv-core-1.cisco.com ([171.68.58.6]) by mtv-iport-2.cisco.com with ESMTP; 09 Jan 2014 22:47:57 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id s09MlvY9030673; Thu, 9 Jan 2014 22:47:57 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id 1AC8B3F58E; Thu, 9 Jan 2014 14:47:57 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH v1 for-next 07/15] IB/usnic: Fix printk format warnings Date: Thu, 9 Jan 2014 14:47:35 -0800 Message-Id: <1389307663-11296-8-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1389307663-11296-1-git-send-email-umalhi@cisco.com> References: <1389307663-11296-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=-14.5 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);