goldfish_pipe: Squash warnings on 32-bit systems
authorChristoffer Dall <christoffer.dall@linaro.org>
Thu, 30 Oct 2014 10:25:59 +0000 (11:25 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Sat, 13 Dec 2014 15:13:46 +0000 (16:13 +0100)
commit064fb5d8f10e6bfdec2f17c107de02d2b5adaece
tree6a734ca27adf19099b7c317d1e3d6503127820ed
parent6cccaefe71eff057c54fa73fa1cd2b78770df0a5
goldfish_pipe: Squash warnings on 32-bit systems

The goldfish_pipe driver casts a pointer to a (u64), but this will
generate a warning on 32-bit systems, because we are casting a pointer
to a type with a different size.  Instead, cast the pointer to an
unsigned long, which will work on both 32-bit and 64-bit systems, and
then cast that to a 32-bit value which the backend expects.

Also wrap this in a pipe_id() function to make it clear that we are not
expecting the backend to use the pointer for anything but that we are
merely using it as an identifier.  Perhaps it would be possible to use a
simple running allocation scheme of IDs instead.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
drivers/platform/goldfish/goldfish_pipe.c