Re: [PATCH V5] staging: goldfish: Fix pointer cast for 32 bits
From: Greg KH
Date: Sat May 09 2015 - 12:27:59 EST
On Mon, May 04, 2015 at 03:11:18PM +0200, Peter Senna Tschudin wrote:
> As the first argument of gf_write64() was of type unsigned long, and as
> some calls to gf_write64() were casting the first argument from void *
> to u64 the compiler and/or sparse were printing warnings for casts of
> wrong sizes when compiling for i386.
>
> This patch changes the type of the first argument of gf_write64() to
> void *, and update calls to the function. This change fixed the
> warnings and allowed to remove casts from 6 calls to gf_write64().
>
> In addition gf_write64() was renamed to gf_write_ptr() as the name was
> misleading because it only writes 32 bits on 32 bit systems.
>
> gf_write_dma_addr() was added to handle dma_addr_t values which is
> used at drivers/staging/goldfish/goldfish_audio.c.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Peter Senna Tschudin <peter.senna@xxxxxxxxx>
> ---
> Tested by compilation only for x86 and for x86_64.
This adds two build warnings:
drivers/tty/goldfish.c: In function âgoldfish_tty_do_writeâ:
drivers/tty/goldfish.c:62:15: warning: passing argument 1 of âgf_write_ptrâ discards âconstâ qualifier from pointer target type
gf_write_ptr(buf, base + GOLDFISH_TTY_DATA_PTR,
^
In file included from drivers/tty/goldfish.c:24:0:
include/linux/goldfish.h:6:20: note: expected âvoid *â but argument is of type âconst char *â
static inline void gf_write_ptr(void *ptr, void __iomem *portl,
^
So I can't take this. Please fix up and resend, and always test build your
patches...
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/