Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbbDLNsy (ORCPT ); Sun, 12 Apr 2015 09:48:54 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:34424 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbbDLNsv (ORCPT ); Sun, 12 Apr 2015 09:48:51 -0400 MIME-Version: 1.0 In-Reply-To: References: <1428830803-30896-1-git-send-email-peter.senna@gmail.com> Date: Sun, 12 Apr 2015 15:48:49 +0200 Message-ID: Subject: Re: [PATCH] Fix pointer cast for 32 bits arch From: Peter Senna Tschudin To: Geert Uytterhoeven Cc: Greg Kroah-Hartman , Loic Pefferkorn , Alan , Jun Tian , Octavian Purdila , Garret Kelly , =?UTF-8?Q?Kristina_Mart=C5=A1enko?= , Nick Kralevich , driverdevel , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2121 Lines: 56 On Sun, Apr 12, 2015 at 3:05 PM, Geert Uytterhoeven wrote: > On Sun, Apr 12, 2015 at 11:26 AM, Peter Senna Tschudin > wrote: >> Sparse compalins about casting void * to u64 on i386. >> Change the cast to resource_size_t. >> >> Signed-off-by: Peter Senna Tschudin >> --- >> >> Tested by compilation only. Tested for x86 and x86_64. >> >> drivers/staging/goldfish/goldfish_nand.c | 3 ++- >> include/linux/goldfish.h | 2 +- >> 2 files changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c >> index d68f216..738fdc4 100644 >> --- a/drivers/staging/goldfish/goldfish_nand.c >> +++ b/drivers/staging/goldfish/goldfish_nand.c >> @@ -87,7 +87,8 @@ static u32 goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd, >> writel((u32)(addr >> 32), base + NAND_ADDR_HIGH); >> writel((u32)addr, base + NAND_ADDR_LOW); >> writel(len, base + NAND_TRANSFER_SIZE); >> - gf_write64((u64)ptr, base + NAND_DATA, base + NAND_DATA_HIGH); >> + gf_write64((resource_size_t)ptr, base + NAND_DATA, >> + base + NAND_DATA_HIGH); > > I guess sparse still complains if CONFIG_X86_PAE=y, which makes > resource_size_t u64? Yes, when CONFIG_X86_PAE=y the patch doesn't fix the warning(gcc warning). What is the correct/portable way of fixing this? > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds -- Peter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/