From: H Hartley Sweeten Date: Tue, 20 Sep 2011 18:06:17 +0000 (-0700) Subject: spi: spi-dw: fix all sparse warnings X-Git-Tag: v3.2-rc1~123^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7eb187b3cd3f6f285d91a196dbefac9b6adbb07c;p=pandora-kernel.git spi: spi-dw: fix all sparse warnings The dw_{read,write}[lw] macros produce sparse warnings everytime they are used. The "read" ones cause: warning: cast removes address space of expression warning: incorrect type in argument 1 (different address spaces) expected void const volatile [noderef] *addr got unsigned int * And the "write" ones: warning: cast removes address space of expression warning: incorrect type in argument 2 (different address spaces) expected void volatile [noderef] *addr got unsigned int * Fix this by removing struct dw_spi_reg and converting all the register offsets to #defines. Then convert the macros into inlined functions so that proper type checking can occur. While here, also fix the three sparse warnings in spi-dw-mid.c due to the return value of ioremap_nocache being stored in a u32 * not a void __iomem *. With these changes the spi-dw* files all build with no sparse warnings. Signed-off-by: H Hartley Sweeten Acked-by: Feng Tang Signed-off-by: Grant Likely --- Reading git-diff-tree failed