diff options
-rw-r--r-- | arch/microblaze/lib/memset.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/microblaze/lib/memset.c b/arch/microblaze/lib/memset.c index 615a2f8f53cb..7c2352d56bb0 100644 --- a/arch/microblaze/lib/memset.c +++ b/arch/microblaze/lib/memset.c @@ -74,8 +74,19 @@ void *memset(void *v_src, int c, __kernel_size_t n) } /* Simple, byte oriented memset or the rest of count. */ - while (n--) + switch (n) { + case 3: *src++ = c; + fallthrough; + case 2: + *src++ = c; + fallthrough; + case 1: + *src++ = c; + break; + default: + break; + } return v_src; } |