Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[pandora-kernel.git] / arch / microblaze / lib / memset.c
index 4df851d..ecfb663 100644 (file)
 #ifdef __HAVE_ARCH_MEMSET
 void *memset(void *v_src, int c, __kernel_size_t n)
 {
-
        char *src = v_src;
 #ifdef CONFIG_OPT_LIB_FUNCTION
        uint32_t *i_src;
-       uint32_t w32;
+       uint32_t w32 = 0;
 #endif
        /* Truncate c to 8 bits */
        c = (c & 0xFF);
 
 #ifdef CONFIG_OPT_LIB_FUNCTION
-       /* Make a repeating word out of it */
-       w32 = c;
-       w32 |= w32 << 8;
-       w32 |= w32 << 16;
+       if (unlikely(c)) {
+               /* Make a repeating word out of it */
+               w32 = c;
+               w32 |= w32 << 8;
+               w32 |= w32 << 16;
+       }
 
-       if (n >= 4) {
+       if (likely(n >= 4)) {
                /* Align the destination to a word boundary */
                /* This is done in an endian independant manner */
                switch ((unsigned) src & 3) {