Skip to contentSkip to conversation

fbdev/riva:change to use generice function to implement reverse_order()

RFC New yalin wang 1 participant 1 message Aug 21, 2015

Subsystems (2)
lore
Share & tools
lore

yalin wang

author
#0 lore raw

RFC v2 1/1 fbdev/riva:change to use generice function to implement reverse_order()

This change to use swab32(bitrev32()) to implement reverse_order() function, have better performance on some platforms.

---
 drivers/video/fbdev/riva/fbdev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/video/fbdev/riva/fbdev.c +2 -5
index f1ad274..ccf0f82 100644
@@ -40,6 +40,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/backlight.h>
+#include <linux/swab.h>
 #include <linux/bitrev.h>
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include <asm/machdep.h>
@@ -453,11 +454,7 @@ static inline unsigned char MISCin(struct riva_par *par)
 
 static inline void reverse_order(u32 *l)
 {
-	u8 *a = (u8 *)l;
-	a[0] = bitrev8(a[0]);
-	a[1] = bitrev8(a[1]);
-	a[2] = bitrev8(a[2]);
-	a[3] = bitrev8(a[3]);
+	*l = swab32(bitrev32(*l));
 }
 
 /* ------------------------------------------------------------------------- *
Signature · 1 line
1.9.1