| .. | .. |
|---|
| 3 | 3 | #include <linux/export.h> |
|---|
| 4 | 4 | #include <linux/uaccess.h> |
|---|
| 5 | 5 | #include <linux/mm.h> |
|---|
| 6 | +#include <linux/bitops.h> |
|---|
| 6 | 7 | |
|---|
| 7 | 8 | #include <asm/word-at-a-time.h> |
|---|
| 8 | | - |
|---|
| 9 | | -/* Set bits in the first 'n' bytes when loaded from memory */ |
|---|
| 10 | | -#ifdef __LITTLE_ENDIAN |
|---|
| 11 | | -# define aligned_byte_mask(n) ((1ul << 8*(n))-1) |
|---|
| 12 | | -#else |
|---|
| 13 | | -# define aligned_byte_mask(n) (~0xfful << (BITS_PER_LONG - 8 - 8*(n))) |
|---|
| 14 | | -#endif |
|---|
| 15 | 9 | |
|---|
| 16 | 10 | /* |
|---|
| 17 | 11 | * Do a strnlen, return length of string *with* final '\0'. |
|---|
| .. | .. |
|---|
| 115 | 109 | if (max > count) |
|---|
| 116 | 110 | max = count; |
|---|
| 117 | 111 | |
|---|
| 118 | | - if (user_access_begin(VERIFY_READ, str, max)) { |
|---|
| 112 | + if (user_read_access_begin(str, max)) { |
|---|
| 119 | 113 | retval = do_strnlen_user(str, count, max); |
|---|
| 120 | | - user_access_end(); |
|---|
| 114 | + user_read_access_end(); |
|---|
| 121 | 115 | return retval; |
|---|
| 122 | 116 | } |
|---|
| 123 | 117 | } |
|---|