Skip to contentSkip to conversation

m68k: dmasound_paula.c lvalues abuse (from m68k CVS)

PATCH In review Al Viro 1 participant 1 message Dec 22, 2005 Sound

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 18/36 m68k: dmasound_paula.c lvalues abuse (from m68k CVS)

From: Roman Zippel <[email protected]>
Date: 1135191147 -0500

avoid warnings about use of cast expressions as lvalues

---

 sound/oss/dmasound/dmasound_paula.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

35e5bbe9630387309d6640ccedbbec134c3e6151

sound/oss/dmasound/dmasound_paula.c +4 -3
index f163868..5417815 100644
@@ -245,6 +245,7 @@ static ssize_t funcname(const u_char *us
 			u_char frame[], ssize_t *frameUsed,		\
 			ssize_t frameLeft)				\
 {									\
+	const u_short *ptr = (const u_short *)userPtr;			\
 	ssize_t count, used;						\
 	u_short data;							\
 									\
@@ -254,7 +255,7 @@ static ssize_t funcname(const u_char *us
 		count = min_t(size_t, userCount, frameLeft)>>1 & ~1;	\
 		used = count*2;						\
 		while (count > 0) {					\
-			if (get_user(data, ((u_short *)userPtr)++))	\
+			if (get_user(data, ptr++))			\
 				return -EFAULT;				\
 			data = convsample(data);			\
 			*high++ = data>>8;				\
@@ -269,12 +270,12 @@ static ssize_t funcname(const u_char *us
 		count = min_t(size_t, userCount, frameLeft)>>2 & ~1;	\
 		used = count*4;						\
 		while (count > 0) {					\
-			if (get_user(data, ((u_short *)userPtr)++))	\
+			if (get_user(data, ptr++))			\
 				return -EFAULT;				\
 			data = convsample(data);			\
 			*lefth++ = data>>8;				\
 			*leftl++ = (data>>2) & 0x3f;			\
-			if (get_user(data, ((u_short *)userPtr)++))	\
+			if (get_user(data, ptr++))			\
 				return -EFAULT;				\
 			data = convsample(data);			\
 			*righth++ = data>>8;				\
Signature · 1 line
0.99.9.GIT