From 43d16e46782adce0eb791d80878474ed463e4432 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Fri, 27 Aug 2004 05:10:42 -0700 Subject: [PATCH] [PATCH] casts are not lvalues Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/smc91x.h | 9 +++++---- drivers/scsi/arm/eesox.c | 30 ++++++++++++++++++++---------- include/math-emu/op-common.h | 6 +++--- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 7679022c07295..427fb0272a556 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h @@ -809,9 +809,10 @@ static const char * chip_ids[ 16 ] = { do { \ char *__ptr = (p); \ int __len = (l); \ - if (__len >= 2 && (long)__ptr & 2) { \ + if (__len >= 2 && (unsigned long)__ptr & 2) { \ __len -= 2; \ - SMC_outw( *((u16 *)__ptr)++, ioaddr, DATA_REG );\ + SMC_outw( *(u16 *)__ptr, ioaddr, DATA_REG ); \ + __ptr += 2; \ } \ SMC_outsl( ioaddr, DATA_REG, __ptr, __len >> 2); \ if (__len & 2) { \ @@ -823,7 +824,7 @@ static const char * chip_ids[ 16 ] = { do { \ char *__ptr = (p); \ int __len = (l); \ - if ((long)__ptr & 2) { \ + if ((unsigned long)__ptr & 2) { \ /* \ * We want 32bit alignment here. \ * Since some buses perform a full 32bit \ @@ -831,7 +832,7 @@ static const char * chip_ids[ 16 ] = { * SMC_inw() here. Back both source (on chip \ * and destination) pointers of 2 bytes. \ */ \ - (long)__ptr &= ~2; \ + __ptr -= 2; \ __len += 2; \ SMC_SET_PTR( 2|PTR_READ|PTR_RCV|PTR_AUTOINC ); \ } \ diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c index 530b59c012c1a..5f037d24caeec 100644 --- a/drivers/scsi/arm/eesox.c +++ b/drivers/scsi/arm/eesox.c @@ -231,7 +231,8 @@ static void eesoxscsi_buffer_in(void *buf, int length, void *base) * Align buffer. */ if (((u32)buf) & 2 && status >= 2) { - *((u16 *)buf)++ = readl(reg_dmadata); + *(u16 *)buf = readl(reg_dmadata); + buf += 2; status -= 2; length -= 2; } @@ -243,8 +244,10 @@ static void eesoxscsi_buffer_in(void *buf, int length, void *base) l1 |= readl(reg_dmadata) << 16; l2 = readl(reg_dmadata) & mask; l2 |= readl(reg_dmadata) << 16; - *((u32 *)buf)++ = l1; - *((u32 *)buf)++ = l2; + *(u32 *)buf = l1; + buf += 4; + *(u32 *)buf = l2; + buf += 4; length -= 8; continue; } @@ -255,13 +258,15 @@ static void eesoxscsi_buffer_in(void *buf, int length, void *base) l1 = readl(reg_dmadata) & mask; l1 |= readl(reg_dmadata) << 16; - *((u32 *)buf)++ = l1; + *(u32 *)buf = l1; + buf += 4; length -= 4; continue; } if (status >= 2) { - *((u16 *)buf)++ = readl(reg_dmadata); + *(u16 *)buf = readl(reg_dmadata); + buf += 2; length -= 2; } } while (length); @@ -305,7 +310,8 @@ static void eesoxscsi_buffer_out(void *buf, int length, void *base) * Align buffer. */ if (((u32)buf) & 2 && status >= 2) { - writel(*((u16 *)buf)++ << 16, reg_dmadata); + writel(*(u16 *)buf << 16, reg_dmadata); + buf += 2; status -= 2; length -= 2; } @@ -313,8 +319,10 @@ static void eesoxscsi_buffer_out(void *buf, int length, void *base) if (status >= 8) { unsigned long l1, l2; - l1 = *((u32 *)buf)++; - l2 = *((u32 *)buf)++; + l1 = *(u32 *)buf; + buf += 4; + l2 = *(u32 *)buf; + buf += 4; writel(l1 << 16, reg_dmadata); writel(l1, reg_dmadata); @@ -327,7 +335,8 @@ static void eesoxscsi_buffer_out(void *buf, int length, void *base) if (status >= 4) { unsigned long l1; - l1 = *((u32 *)buf)++; + l1 = *(u32 *)buf; + buf += 4; writel(l1 << 16, reg_dmadata); writel(l1, reg_dmadata); @@ -336,7 +345,8 @@ static void eesoxscsi_buffer_out(void *buf, int length, void *base) } if (status >= 2) { - writel(*((u16 *)buf)++ << 16, reg_dmadata); + writel(*(u16 *)buf << 16, reg_dmadata); + buf += 2; length -= 2; } } while (length); diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index 8c54bf6b956cb..93780abd01bc6 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h @@ -769,9 +769,9 @@ do { \ X##_c = FP_CLS_NORMAL; \ \ if ((X##_s = (r < 0))) \ - r = -r; \ - \ - ur_ = (unsigned rtype) r; \ + ur_ = (unsigned rtype) -r; \ + else \ + ur_ = (unsigned rtype) r; \ if (rsize <= _FP_W_TYPE_SIZE) \ __FP_CLZ(X##_e, ur_); \ else \ -- 2.53.0