public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cyblafb: portability fixes, sanitized work with pointers
@ 2005-09-28 23:07 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2005-09-28 23:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Knut Petersen, linux-kernel

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
----
diff -urN RC14-rc2-git6-i810/drivers/video/cyblafb.c RC14-rc2-git6-cyblafb/drivers/video/cyblafb.c
--- RC14-rc2-git6-i810/drivers/video/cyblafb.c	2005-09-10 15:41:34.000000000 -0400
+++ RC14-rc2-git6-cyblafb/drivers/video/cyblafb.c	2005-09-28 13:02:18.000000000 -0400
@@ -410,20 +410,21 @@
 	out32(GE0C,point(image->dx+image->width-1,image->dy+image->height-1));
 
 	while(index < index_end) {
+		const char *p = image->data + index;
 		for(i=0;i<width_dds;i++) {
-			out32(GE9C,*((u32*) ((u32)image->data + index)));
+			out32(GE9C,*(u32*)p);
+			p+=4;
 			index+=4;
 		}
 		switch(width_dbs) {
 		case 0: break;
-		case 8:	out32(GE9C,*((u8*)((u32)image->data+index)));
+		case 8:	out32(GE9C,*(u8*)p);
 			index+=1;
 			break;
-		case 16: out32(GE9C,*((u16*)((u32)image->data+index)));
+		case 16: out32(GE9C,*(u16*)p);
 			index+=2;
 			break;
-		case 24: out32(GE9C,(u32)(*((u16*)((u32)image->data+index))) |
-			       (u32)(*((u8*)((u32)image->data+index+2)))<<16);
+		case 24: out32(GE9C,*(u16*)p | *(u8*)(p+2)<<16);
 			index+=3;
 			break;
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-28 23:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-28 23:07 [PATCH] cyblafb: portability fixes, sanitized work with pointers Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox