From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753945AbbJ0VLT (ORCPT ); Tue, 27 Oct 2015 17:11:19 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34267 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753385AbbJ0VLQ (ORCPT ); Tue, 27 Oct 2015 17:11:16 -0400 Date: Tue, 27 Oct 2015 21:11:13 +0000 From: Matt Fleming To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, izumi.taku@jp.fujitsu.com, linux-kernel@vger.kernel.org, mingo@kernel.org, kamezawa.hiroyu@jp.fujitsu.com Subject: Re: [PATCH 2/2] efi: Fix warning of int-to-pointer-cast on x86 32-bit builds Message-ID: <20151027211113.GD8973@codeblueprint.co.uk> References: <20151023085011.GB21631@gmail.com> <1445593697-1342-1-git-send-email-ard.biesheuvel@linaro.org> <1445593697-1342-2-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445593697-1342-2-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Oct, at 11:48:17AM, Ard Biesheuvel wrote: > From: Taku Izumi > > Commit 0f96a99dab36 ("efi: Add "efi_fake_mem" boot option") > introduces the following warning message: > > drivers/firmware/efi/fake_mem.c:186:20: warning: cast to pointer > from integer of different size [-Wint-to-pointer-cast] > > new_memmap_phy was defined as a u64 value and cast to void*, causing > a int-to-pointer-cast warning on x86 32-bit builds. > However, since the void* type is inappropriate for a physical > address, the definition of struct efi_memory_map::phys_map has been > changed to phys_addr_t in the previous patch, and so the cast can be > dropped entirely. > > This patch also changes the type of the "new_memmap_phy" variable > from "u64" to "phys_addr_t" to align with the types of > memblock_alloc() and struct efi_memory_map::phys_map. > > Reported-by: Ingo Molnar > Signed-off-by: Taku Izumi > [ard.biesheuvel: removed void* cast, updated commit log] > Signed-off-by: Ard Biesheuvel > --- > drivers/firmware/efi/fake_mem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Matt Fleming