From: Josh Triplett <josh@joshtriplett.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [tip:x86/efi 9/11] arch/x86/platform/efi/efi.c:801:11: warning: cast to pointer from integer of
Date: Fri, 28 Sep 2012 18:59:13 +0000 [thread overview]
Message-ID: <20120928185912.GC5202@jtriplet-mobl1> (raw)
In-Reply-To: <20120928023439.GA9155@localhost>
On Fri, Sep 28, 2012 at 10:34:39AM +0800, Fengguang Wu wrote:
> Hi Josh,
>
> FYI, there are new compile warnings show up in
>
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/efi
> head: ba49efa14f97ca6fe57390539e70a359aea779cd
> commit: 429c5a7fa9294e9792116d6ba1016b2cf39572e4 [9/11] efi: Add a function to look up existing IO memory mappings
> config: i386-randconfig-b084 (attached as .config)
>
> All warnings:
>
> arch/x86/platform/efi/efi.c: In function 'efi_lookup_mapped_addr':
> arch/x86/platform/efi/efi.c:801:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>
> vim +801 arch/x86/platform/efi/efi.c
>
> 429c5a7f (Josh Triplett 2012-09-08 785) {
> 429c5a7f (Josh Triplett 2012-09-08 786) void *p;
> 429c5a7f (Josh Triplett 2012-09-08 787) if (WARN_ON(!memmap.map))
> 429c5a7f (Josh Triplett 2012-09-08 788) return NULL;
> 429c5a7f (Josh Triplett 2012-09-08 789) for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
> 429c5a7f (Josh Triplett 2012-09-08 790) efi_memory_desc_t *md = p;
> 429c5a7f (Josh Triplett 2012-09-08 791) u64 size = md->num_pages << EFI_PAGE_SHIFT;
> 429c5a7f (Josh Triplett 2012-09-08 792) u64 end = md->phys_addr + size;
> 429c5a7f (Josh Triplett 2012-09-08 793) if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
> 429c5a7f (Josh Triplett 2012-09-08 794) md->type != EFI_BOOT_SERVICES_CODE &&
> 429c5a7f (Josh Triplett 2012-09-08 795) md->type != EFI_BOOT_SERVICES_DATA)
> 429c5a7f (Josh Triplett 2012-09-08 796) continue;
> 429c5a7f (Josh Triplett 2012-09-08 797) if (!md->virt_addr)
> 429c5a7f (Josh Triplett 2012-09-08 798) continue;
> 429c5a7f (Josh Triplett 2012-09-08 799) if (phys_addr >= md->phys_addr && phys_addr < end) {
> 429c5a7f (Josh Triplett 2012-09-08 800) phys_addr += md->virt_addr - md->phys_addr;
> 429c5a7f (Josh Triplett 2012-09-08 @801) return (__force void __iomem *)phys_addr;
> 429c5a7f (Josh Triplett 2012-09-08 802) }
> 429c5a7f (Josh Triplett 2012-09-08 803) }
> 429c5a7f (Josh Triplett 2012-09-08 804) return NULL;
> 429c5a7f (Josh Triplett 2012-09-08 805) }
> 429c5a7f (Josh Triplett 2012-09-08 806)
> 429c5a7f (Josh Triplett 2012-09-08 807) /*
> 5b83683f (Huang, Ying 2008-01-30 808) * This function will switch the EFI runtime services to virtual mode.
> 5b83683f (Huang, Ying 2008-01-30 809) * Essentially, look through the EFI memmap and map every region that
Ah; I hadn't tried compiling this for 32-bit x86, and I'd forgotten the
ridiculous need for a double cast. Line 801 needs a cast to (unsigned
long) before the cast to (__force void __iomem *).
- Josh Triplett
prev parent reply other threads:[~2012-09-28 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 2:34 [tip:x86/efi 9/11] arch/x86/platform/efi/efi.c:801:11: warning: cast to pointer from integer of diff Fengguang Wu
2012-09-28 18:59 ` Josh Triplett [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120928185912.GC5202@jtriplet-mobl1 \
--to=josh@joshtriplett.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox