lkml.org 
[lkml]   [2015]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5] staging: goldfish: Fix pointer cast for 32 bits
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@oracle.com>
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
> 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


\
 
 \ /
  Last update: 2015-05-09 18:41    [W:0.064 / U:21.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site