diff options
| -rw-r--r-- | include/asm-generic/gpio.h | 3 | ||||
| -rw-r--r-- | include/asm-generic/unistd.h | 10 | ||||
| -rw-r--r-- | lib/checksum.c | 14 |
3 files changed, 18 insertions, 9 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 66d6106a2067..204bed37e82d 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -28,6 +28,7 @@ static inline int gpio_is_valid(int number) | |||
| 28 | return ((unsigned)number) < ARCH_NR_GPIOS; | 28 | return ((unsigned)number) < ARCH_NR_GPIOS; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | struct device; | ||
| 31 | struct seq_file; | 32 | struct seq_file; |
| 32 | struct module; | 33 | struct module; |
| 33 | 34 | ||
| @@ -181,6 +182,8 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) | |||
| 181 | 182 | ||
| 182 | #ifndef CONFIG_GPIO_SYSFS | 183 | #ifndef CONFIG_GPIO_SYSFS |
| 183 | 184 | ||
| 185 | struct device; | ||
| 186 | |||
| 184 | /* sysfs support is only available with gpiolib, where it's optional */ | 187 | /* sysfs support is only available with gpiolib, where it's optional */ |
| 185 | 188 | ||
| 186 | static inline int gpio_export(unsigned gpio, bool direction_may_change) | 189 | static inline int gpio_export(unsigned gpio, bool direction_may_change) |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 7c38c147e5e6..6a0b30f78a62 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
| @@ -622,9 +622,13 @@ __SYSCALL(__NR_move_pages, sys_move_pages) | |||
| 622 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | 622 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) |
| 623 | #define __NR_perf_event_open 241 | 623 | #define __NR_perf_event_open 241 |
| 624 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | 624 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) |
| 625 | #define __NR_accept4 242 | ||
| 626 | __SYSCALL(__NR_accept4, sys_accept4) | ||
| 627 | #define __NR_recvmmsg 243 | ||
| 628 | __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | ||
| 625 | 629 | ||
| 626 | #undef __NR_syscalls | 630 | #undef __NR_syscalls |
| 627 | #define __NR_syscalls 242 | 631 | #define __NR_syscalls 244 |
| 628 | 632 | ||
| 629 | /* | 633 | /* |
| 630 | * All syscalls below here should go away really, | 634 | * All syscalls below here should go away really, |
| @@ -802,7 +806,7 @@ __SYSCALL(__NR_fork, sys_ni_syscall) | |||
| 802 | #define __NR_statfs __NR3264_statfs | 806 | #define __NR_statfs __NR3264_statfs |
| 803 | #define __NR_fstatfs __NR3264_fstatfs | 807 | #define __NR_fstatfs __NR3264_fstatfs |
| 804 | #define __NR_truncate __NR3264_truncate | 808 | #define __NR_truncate __NR3264_truncate |
| 805 | #define __NR_ftruncate __NR3264_truncate | 809 | #define __NR_ftruncate __NR3264_ftruncate |
| 806 | #define __NR_lseek __NR3264_lseek | 810 | #define __NR_lseek __NR3264_lseek |
| 807 | #define __NR_sendfile __NR3264_sendfile | 811 | #define __NR_sendfile __NR3264_sendfile |
| 808 | #define __NR_newfstatat __NR3264_fstatat | 812 | #define __NR_newfstatat __NR3264_fstatat |
| @@ -818,7 +822,7 @@ __SYSCALL(__NR_fork, sys_ni_syscall) | |||
| 818 | #define __NR_statfs64 __NR3264_statfs | 822 | #define __NR_statfs64 __NR3264_statfs |
| 819 | #define __NR_fstatfs64 __NR3264_fstatfs | 823 | #define __NR_fstatfs64 __NR3264_fstatfs |
| 820 | #define __NR_truncate64 __NR3264_truncate | 824 | #define __NR_truncate64 __NR3264_truncate |
| 821 | #define __NR_ftruncate64 __NR3264_truncate | 825 | #define __NR_ftruncate64 __NR3264_ftruncate |
| 822 | #define __NR_llseek __NR3264_lseek | 826 | #define __NR_llseek __NR3264_lseek |
| 823 | #define __NR_sendfile64 __NR3264_sendfile | 827 | #define __NR_sendfile64 __NR3264_sendfile |
| 824 | #define __NR_fstatat64 __NR3264_fstatat | 828 | #define __NR_fstatat64 __NR3264_fstatat |
diff --git a/lib/checksum.c b/lib/checksum.c index b2e2fd468461..097508732f34 100644 --- a/lib/checksum.c +++ b/lib/checksum.c | |||
| @@ -37,7 +37,8 @@ | |||
| 37 | 37 | ||
| 38 | #include <asm/byteorder.h> | 38 | #include <asm/byteorder.h> |
| 39 | 39 | ||
| 40 | static inline unsigned short from32to16(unsigned long x) | 40 | #ifndef do_csum |
| 41 | static inline unsigned short from32to16(unsigned int x) | ||
| 41 | { | 42 | { |
| 42 | /* add up 16-bit and 16-bit for 16+c bit */ | 43 | /* add up 16-bit and 16-bit for 16+c bit */ |
| 43 | x = (x & 0xffff) + (x >> 16); | 44 | x = (x & 0xffff) + (x >> 16); |
| @@ -49,16 +50,16 @@ static inline unsigned short from32to16(unsigned long x) | |||
| 49 | static unsigned int do_csum(const unsigned char *buff, int len) | 50 | static unsigned int do_csum(const unsigned char *buff, int len) |
| 50 | { | 51 | { |
| 51 | int odd, count; | 52 | int odd, count; |
| 52 | unsigned long result = 0; | 53 | unsigned int result = 0; |
| 53 | 54 | ||
| 54 | if (len <= 0) | 55 | if (len <= 0) |
| 55 | goto out; | 56 | goto out; |
| 56 | odd = 1 & (unsigned long) buff; | 57 | odd = 1 & (unsigned long) buff; |
| 57 | if (odd) { | 58 | if (odd) { |
| 58 | #ifdef __LITTLE_ENDIAN | 59 | #ifdef __LITTLE_ENDIAN |
| 59 | result = *buff; | ||
| 60 | #else | ||
| 61 | result += (*buff << 8); | 60 | result += (*buff << 8); |
| 61 | #else | ||
| 62 | result = *buff; | ||
| 62 | #endif | 63 | #endif |
| 63 | len--; | 64 | len--; |
| 64 | buff++; | 65 | buff++; |
| @@ -73,9 +74,9 @@ static unsigned int do_csum(const unsigned char *buff, int len) | |||
| 73 | } | 74 | } |
| 74 | count >>= 1; /* nr of 32-bit words.. */ | 75 | count >>= 1; /* nr of 32-bit words.. */ |
| 75 | if (count) { | 76 | if (count) { |
| 76 | unsigned long carry = 0; | 77 | unsigned int carry = 0; |
| 77 | do { | 78 | do { |
| 78 | unsigned long w = *(unsigned int *) buff; | 79 | unsigned int w = *(unsigned int *) buff; |
| 79 | count--; | 80 | count--; |
| 80 | buff += 4; | 81 | buff += 4; |
| 81 | result += carry; | 82 | result += carry; |
| @@ -102,6 +103,7 @@ static unsigned int do_csum(const unsigned char *buff, int len) | |||
| 102 | out: | 103 | out: |
| 103 | return result; | 104 | return result; |
| 104 | } | 105 | } |
| 106 | #endif | ||
| 105 | 107 | ||
| 106 | /* | 108 | /* |
| 107 | * This is a version of ip_compute_csum() optimized for IP headers, | 109 | * This is a version of ip_compute_csum() optimized for IP headers, |
