From patchwork Wed Jul 24 07:41:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 2832582 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8F74FC0319 for ; Wed, 24 Jul 2013 07:41:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43FBD201E6 for ; Wed, 24 Jul 2013 07:41:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 346B1201E2 for ; Wed, 24 Jul 2013 07:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751019Ab3GXHlk (ORCPT ); Wed, 24 Jul 2013 03:41:40 -0400 Received: from mail-ee0-f41.google.com ([74.125.83.41]:48260 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864Ab3GXHlk (ORCPT ); Wed, 24 Jul 2013 03:41:40 -0400 Received: by mail-ee0-f41.google.com with SMTP id d51so45119eek.28 for ; Wed, 24 Jul 2013 00:41:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=yGF5Rd9tPBc+GUaAsUBn00pyrgLAtKOJEvlhFxOlLsQ=; b=FEHCfcM87wO3jfXJNe8USLtVeDdBtTjbANAXsmXF04f8I5bMsN+InIihYQMLXZU7q9 qCJiypar4bj0SORmIP452IIzLWbdiBuPvilBh5ky82NGr6/z9HtVcSXbYAc2v44UFI7Z djTyFpsFZ+gmDdEGlLShkrF19JydG0RUqygpXr++u76KZtrS+YULx0qW2HWGIxDzihI9 Oi4u0N8GzfQ5abgqz5XX7bbCOCgLy/9Qfn93DOSqXErF8FGMym1o6yz+kUd5Mv2U+fbx cT/KAF5/IEYgVQ7Qf8k9w9fbpXkz+4qd1V9Cxp/pKqhx+6IDHDmYoSQnsNDYy/EI5nOy 9Vww== X-Received: by 10.15.63.8 with SMTP id l8mr36271168eex.23.1374651698529; Wed, 24 Jul 2013 00:41:38 -0700 (PDT) Received: from [192.168.0.100] (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id w43sm64029343eez.6.2013.07.24.00.41.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 00:41:37 -0700 (PDT) Message-ID: <51EF8530.90809@monstr.eu> Date: Wed, 24 Jul 2013 09:41:36 +0200 From: Michal Simek Reply-To: monstr@monstr.eu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: monstr@monstr.eu CC: Jingoo Han , 'Michal Simek' , 'Jean-Christophe Plagniol-Villard' , 'Tomi Valkeinen' , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, 'Stepan Moskovchenko' Subject: Re: [PATCH] video: xilinxfb: Fix compilation warning References: <007401ce8833$22ce0600$686a1200$@samsung.com> <51EF7FBD.8070103@monstr.eu> In-Reply-To: <51EF7FBD.8070103@monstr.eu> X-Enigmail-Version: 1.5.1 X-Gm-Message-State: ALoCoQlZqn8qGK//YZpYvoxpV5wc2ZaBuVtIYIfg2Z3L90Q14WvrEM9VRIiB7F//nHuwzKgv4yra 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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 On 07/24/2013 09:18 AM, Michal Simek wrote: > On 07/24/2013 08:00 AM, Jingoo Han wrote: >> On Wednesday, July 24, 2013 2:32 PM, Michal Simek wrote: >>> >>> regs_phys is phys_addr_t (u32 or u64). >>> Lets retype it to u64. >>> >>> Fixes compilation warning introduced by: >>> video: xilinxfb: Use drvdata->regs_phys instead of physaddr >>> (sha1: c88fafef0135e1e1c3e23c3e32ccbeeabc587f81) >> >> CC'ed Stepan Moskovchenko >> >> >> phys_addr_t is defined as below: >> >> #ifdef CONFIG_PHYS_ADDR_T_64BIT >> typedef u64 phys_addr_t; >> #else >> typedef u32 phys_addr_t; >> #endif >> >> According to 'Documentation/printk-formats.txt', >> Physical addresses: >> %pa 0x01234567 or 0x0123456789abcdef >> For printing a phys_addr_t type (and its derivatives, such as >> resource_size_t) which can vary based on build options, regardless of >> the width of the CPU data path. Passed by reference. >> >> Thus, '%pa' option looks proper, instead of casting (unsigned long long). >> >> dev_dbg(dev, "regs: phys=%pa, virt=%p\n", drvdata->regs_phys, >> drvdata->regs); >> > > Ah. Wasn't aware about that. > Will retest. On ppc44x_defconfig $ powerpc-unknown-linux-gnu-gcc --version powerpc-unknown-linux-gnu-gcc (crosstool-NG-svn_unknown@20110406.104745) 4.3.2 This fix Generates two warnings even it should be ok according to link to specification you sent. CC [M] drivers/video/xilinxfb.o drivers/video/xilinxfb.c: In function 'xilinxfb_assign': drivers/video/xilinxfb.c:344: warning: format '%p' expects type 'void *', but argument 4 has type 'phys_addr_t' drivers/video/xilinxfb.c:348: warning: format '%p' expects type 'void *', but argument 4 has type 'dma_addr_t' On microblaze toolchain I see the same warnings. (mmu_defconfig) I have also grepped the kernel and I see that it is used in 4 c files which seems to me weird because phy_addr_t or dma_addr_t are used on a lot of places. Thanks, Michal diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index 79175a6..a9a1167 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -341,12 +341,12 @@ static int xilinxfb_assign(struct platform_device *pdev, if (drvdata->flags & BUS_ACCESS_FLAG) { /* Put a banner in the log (for DEBUG) */ - dev_dbg(dev, "regs: phys=%llx, virt=%p\n", - (unsigned long long)drvdata->regs_phys, drvdata->regs); + dev_dbg(dev, "regs: phys=%pa, virt=%p\n", + drvdata->regs_phys, drvdata->regs); } /* Put a banner in the log (for DEBUG) */ - dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n", - (unsigned long long)drvdata->fb_phys, drvdata->fb_virt, fbsize); + dev_dbg(dev, "fb: phys=%pa, virt=%p, size=%x\n", + drvdata->fb_phys, drvdata->fb_virt, fbsize); return 0; /* success */