From patchwork Mon Mar 9 07:35:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 5965091 Return-Path: X-Original-To: patchwork-linux-fbdev@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 00C5FBF440 for ; Mon, 9 Mar 2015 07:35:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F27F720254 for ; Mon, 9 Mar 2015 07:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A978E2024F for ; Mon, 9 Mar 2015 07:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbbCIHfV (ORCPT ); Mon, 9 Mar 2015 03:35:21 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:40001 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbbCIHfV (ORCPT ); Mon, 9 Mar 2015 03:35:21 -0400 Received: by padfb1 with SMTP id fb1so61455866pad.7; Mon, 09 Mar 2015 00:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=BJr1tlIcQazZpei1RKCpOvMxsfNycYD03OjFocrR8hc=; b=sf1PkZp4K9g13K95Tdq97b8/mp0zMmeczlYpxZHtDCSNRjdHZo8w6Tv+AE5pBWeLxf 1EzO8gSH3Gu1JtLJemvESy6VWyODKt60umQ+b+IWVQtYG9/pJy2crQX15Ix5A9brN4MG 7MIc1ZVQHJ0wwUhf2a7svIeDVUx8zFZ4x2lAZhSOekRcDMOculEPPA6iIZhBspvEkFrp J2sY5ksRom+E82JTBS1eXKEP2bJ9teyE7d2P6lpAErRGANWv1Tj2kFe8mGfqavJp0ir6 FwongmDcMMXSx4nQ6LGwmOksuumm7o9Er2a/LI/poqhznvn8IrKXZCnelInCzuzvILiK wnOg== X-Received: by 10.66.149.106 with SMTP id tz10mr51149185pab.90.1425886520056; Mon, 09 Mar 2015 00:35:20 -0700 (PDT) Received: from localhost.localdomain ([122.169.145.94]) by mx.google.com with ESMTPSA id a4sm17553024pdf.57.2015.03.09.00.35.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Mar 2015 00:35:19 -0700 (PDT) From: Sudip Mukherjee To: Tomi Valkeinen , Greg Kroah-Hartman Cc: Sudip Mukherjee , linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] staging: sm750fb: wrong type for print Date: Mon, 9 Mar 2015 13:05:03 +0530 Message-Id: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 mention correct format specifier while printing. fixes all the build warnings about incorrect argument type while printing. Signed-off-by: Sudip Mukherjee --- V2: Giedrius commented resource_size_t can be either u64 or u32 depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i should have kept the datatype as resource_size_t and used %pa as the format specifier. But since this is a framebuffer device and it should follow what the framebuffer layer is suggesting in struct fb_fix_screeninfo at smem_start and mmio_start. adding Tomi for his comments. this patch will give checkpatch warnings about use of printk. this patch was mainly to fix the build warnings. printk will be converted to pr_* and dev_* in a later patch. drivers/staging/sm750fb/sm750.c | 24 ++++++++++++------------ drivers/staging/sm750fb/sm750.h | 8 ++++---- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 520c69e..753869e 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -530,20 +530,20 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma) if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) return -EINVAL; off = vma->vm_pgoff << PAGE_SHIFT; - printk("lynxfb mmap pgoff: %x\n", vma->vm_pgoff); - printk("lynxfb mmap off 1: %x\n", off); + printk("lynxfb mmap pgoff: %lx\n", vma->vm_pgoff); + printk("lynxfb mmap off 1: %lx\n", off); /* frame buffer memory */ start = info->fix.smem_start; len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); - printk("lynxfb mmap start 1: %x\n", start); + printk("lynxfb mmap start 1: %lx\n", start); printk("lynxfb mmap len 1: %x\n", len); if (off >= len) { /* memory mapped io */ off -= len; - printk("lynxfb mmap off 2: %x\n", off); + printk("lynxfb mmap off 2: %lx\n", off); if (info->var.accel_flags) { printk("lynxfb mmap accel flags true"); return -EINVAL; @@ -551,28 +551,28 @@ static int lynxfb_ops_mmap(struct fb_info * info, struct vm_area_struct * vma) start = info->fix.mmio_start; len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len); - printk("lynxfb mmap start 2: %x\n", start); + printk("lynxfb mmap start 2: %lx\n", start); printk("lynxfb mmap len 2: %x\n", len); } start &= PAGE_MASK; - printk("lynxfb mmap start 3: %x\n", start); - printk("lynxfb mmap vm start: %x\n", vma->vm_start); - printk("lynxfb mmap vm end: %x\n", vma->vm_end); + printk("lynxfb mmap start 3: %lx\n", start); + printk("lynxfb mmap vm start: %lx\n", vma->vm_start); + printk("lynxfb mmap vm end: %lx\n", vma->vm_end); printk("lynxfb mmap len: %x\n", len); - printk("lynxfb mmap off: %x\n", off); + printk("lynxfb mmap off: %lx\n", off); if ((vma->vm_end - vma->vm_start + off) > len) { return -EINVAL; } off += start; - printk("lynxfb mmap off 3: %x\n", off); + printk("lynxfb mmap off 3: %lx\n", off); vma->vm_pgoff = off >> PAGE_SHIFT; /* This is an IO map - tell maydump to skip this VMA */ vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); fb_pgprotect(file, vma, off); - printk("lynxfb mmap off 4: %x\n", off); - printk("lynxfb mmap pgprot: %x\n", vma->vm_page_prot); + printk("lynxfb mmap off 4: %lx\n", off); + printk("lynxfb mmap pgprot: %lx\n", (unsigned long) pgprot_val(vma->vm_page_prot)); if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 711676c..d39968c 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -59,10 +59,10 @@ struct lynx_share{ }mtrr; #endif /* all smi graphic adaptor got below attributes */ - resource_size_t vidmem_start; - resource_size_t vidreg_start; - resource_size_t vidmem_size; - resource_size_t vidreg_size; + unsigned long vidmem_start; + unsigned long vidreg_start; + __u32 vidmem_size; + __u32 vidreg_size; volatile unsigned char __iomem * pvReg; unsigned char __iomem * pvMem; /* locks*/ diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index cd971bd..ec2d499 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -36,7 +36,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev) share->vidreg_start = pci_resource_start(pdev,1); share->vidreg_size = MB(2); - pr_info("mmio phyAddr = %x\n",share->vidreg_start); + pr_info("mmio phyAddr = %lx\n", share->vidreg_start); /* reserve the vidreg space of smi adaptor * if you do this, u need to add release region code @@ -73,7 +73,7 @@ int hw_sm750_map(struct lynx_share* share,struct pci_dev* pdev) * @hw_sm750_getVMSize function can be safe. * */ share->vidmem_size = hw_sm750_getVMSize(share); - pr_info("video memory phyAddr = %x, size = %d bytes\n", + pr_info("video memory phyAddr = %lx, size = %u bytes\n", share->vidmem_start,share->vidmem_size); /* reserve the vidmem space of smi adaptor */