Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4917d927809918f0070bd1077b41e3daf78643b2 Commit: 4917d927809918f0070bd1077b41e3daf78643b2 Parent: ad241528c4919505afccb022acbab3eeb0db4d80 Author: David Brownell <[EMAIL PROTECTED]> AuthorDate: Tue Jul 17 04:04:04 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Tue Jul 17 10:23:04 2007 -0700
spidev compiler warning gone Get rid of annoying GCC warning on 32-bit platforms. drivers/spi/spidev.c: In function 'spidev_message': drivers/spi/spidev.c:184: warning: cast to pointer from integer of different size drivers/spi/spidev.c:216: warning: cast to pointer from integer of different size The trick is to add an extra cast using "ptrdiff_t" to convert the u64 to the correct size integer, and only then casting it into a "void *" pointer. Signed-off-by: David Brownell <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/spi/spidev.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index d04242a..38b60ad 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -181,7 +181,8 @@ static int spidev_message(struct spidev_data *spidev, } if (u_tmp->tx_buf) { k_tmp->tx_buf = buf; - if (copy_from_user(buf, (const u8 __user *)u_tmp->tx_buf, + if (copy_from_user(buf, (const u8 __user *) + (ptrdiff_t) u_tmp->tx_buf, u_tmp->len)) goto done; } @@ -213,7 +214,8 @@ static int spidev_message(struct spidev_data *spidev, buf = spidev->buffer; for (n = n_xfers, u_tmp = u_xfers; n; n--, u_tmp++) { if (u_tmp->rx_buf) { - if (__copy_to_user((u8 __user *)u_tmp->rx_buf, buf, + if (__copy_to_user((u8 __user *) + (ptrdiff_t) u_tmp->rx_buf, buf, u_tmp->len)) { status = -EFAULT; goto done; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html