mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions
[linux-2.6-block.git] / lib / strnlen_user.c
index 1c1a1b0e38a5f5c853cf935ed06eb9abb2b56ef2..7f2db3fe311fdd49613912174b69e952413fa1a8 100644 (file)
@@ -28,7 +28,7 @@
 static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
 {
        const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
-       long align, res = 0;
+       unsigned long align, res = 0;
        unsigned long c;
 
        /*
@@ -42,7 +42,7 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count,
         * Do everything aligned. But that means that we
         * need to also expand the maximum..
         */
-       align = (sizeof(long) - 1) & (unsigned long)src;
+       align = (sizeof(unsigned long) - 1) & (unsigned long)src;
        src -= align;
        max += align;