X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcfbcopyarea.c;h=032210f45be37a539831030b63d64c1a5d3df61a;hb=5b58e21a27028a9f0399449d8bc8494fd9d9ff70;hp=cdc71572cf356d26955ec256d42e6c1149663108;hpb=3b621ee5df437d3f332a635ab6421aaa61a7dc2b;p=powerpc.git diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c index cdc71572cf..032210f45b 100644 --- a/drivers/video/cfbcopyarea.c +++ b/drivers/video/cfbcopyarea.c @@ -22,9 +22,6 @@ * help moving some redundant computations and branches out of the loop, too. */ - - -#include #include #include #include @@ -32,6 +29,7 @@ #include #include #include +#include "fb_draw.h" #if BITS_PER_LONG == 32 # define FB_WRITEL fb_writel @@ -41,17 +39,6 @@ # define FB_READL fb_readq #endif - /* - * Compose two values, using a bitmask as decision value - * This is equivalent to (a & mask) | (b & ~mask) - */ - -static inline unsigned long -comp(unsigned long a, unsigned long b, unsigned long mask) -{ - return ((a ^ b) & mask) ^ b; -} - /* * Generic bitwise copy algorithm */ @@ -64,8 +51,8 @@ bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src int const shift = dst_idx-src_idx; int left, right; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx+n) % bits)); + first = FB_SHIFT_HIGH(~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); if (!shift) { // Same alignment for source and dest @@ -216,8 +203,8 @@ bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem shift = dst_idx-src_idx; - first = ~0UL << (bits - 1 - dst_idx); - last = ~(~0UL << (bits - 1 - ((dst_idx-n) % bits))); + first = FB_SHIFT_LOW(~0UL, bits - 1 - dst_idx); + last = ~(FB_SHIFT_LOW(~0UL, bits - 1 - ((dst_idx-n) % bits))); if (!shift) { // Same alignment for source and dest