aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 00:00:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 00:00:19 -0400
commit45b583b10a8b438b970e95a7d1d4db22c9e35004 (patch)
tree14fa481598289df0459580c582b48a9d95db51f6 /lib
parent154dd78d30b56ffb8b447f629bfcceb14150e5c4 (diff)
parentf19da2ce8ef5e49b8b8ea199c3601dd45d71b262 (diff)
Merge 'akpm' patch series
* Merge akpm patch series: (122 commits) drivers/connector/cn_proc.c: remove unused local Documentation/SubmitChecklist: add RCU debug config options reiserfs: use hweight_long() reiserfs: use proper little-endian bitops pnpacpi: register disabled resources drivers/rtc/rtc-tegra.c: properly initialize spinlock drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in twl_rtc_set_time() drivers/rtc: add support for Qualcomm PMIC8xxx RTC drivers/rtc/rtc-s3c.c: support clock gating drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200 init: skip calibration delay if previously done misc/eeprom: add eeprom access driver for digsy_mtc board misc/eeprom: add driver for microwire 93xx46 EEPROMs checkpatch.pl: update $logFunctions checkpatch: make utf-8 test --strict checkpatch.pl: add ability to ignore various messages checkpatch: add a "prefer __aligned" check checkpatch: validate signature styles and To: and Cc: lines checkpatch: add __rcu as a sparse modifier checkpatch: suggest using min_t or max_t ... Did this as a merge because of (trivial) conflicts in - Documentation/feature-removal-schedule.txt - arch/xtensa/include/asm/uaccess.h that were just easier to fix up in the merge than in the patch series.
Diffstat (limited to 'lib')
-rw-r--r--lib/devres.c2
-rw-r--r--lib/kstrtox.c5
-rw-r--r--lib/lcm.c1
-rw-r--r--lib/vsprintf.c23
4 files changed, 12 insertions, 19 deletions
diff --git a/lib/devres.c b/lib/devres.c
index 6efddf53b90c..7c0e953a7486 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -79,9 +79,9 @@ EXPORT_SYMBOL(devm_ioremap_nocache);
79 */ 79 */
80void devm_iounmap(struct device *dev, void __iomem *addr) 80void devm_iounmap(struct device *dev, void __iomem *addr)
81{ 81{
82 iounmap(addr);
83 WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match, 82 WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match,
84 (void *)addr)); 83 (void *)addr));
84 iounmap(addr);
85} 85}
86EXPORT_SYMBOL(devm_iounmap); 86EXPORT_SYMBOL(devm_iounmap);
87 87
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 2dbae88090ac..5e066759f551 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -19,11 +19,6 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21 21
22static inline char _tolower(const char c)
23{
24 return c | 0x20;
25}
26
27static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res) 22static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
28{ 23{
29 unsigned long long acc; 24 unsigned long long acc;
diff --git a/lib/lcm.c b/lib/lcm.c
index 157cd88a6ffc..10b5cfcacf6b 100644
--- a/lib/lcm.c
+++ b/lib/lcm.c
@@ -1,6 +1,7 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/gcd.h> 2#include <linux/gcd.h>
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/lcm.h>
4 5
5/* Lowest common multiple */ 6/* Lowest common multiple */
6unsigned long lcm(unsigned long a, unsigned long b) 7unsigned long lcm(unsigned long a, unsigned long b)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 75bace7acefb..d7222a9c8267 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -31,13 +31,10 @@
31#include <asm/div64.h> 31#include <asm/div64.h>
32#include <asm/sections.h> /* for dereference_function_descriptor() */ 32#include <asm/sections.h> /* for dereference_function_descriptor() */
33 33
34/* Works only for digits and letters, but small and fast */
35#define TOLOWER(x) ((x) | 0x20)
36
37static unsigned int simple_guess_base(const char *cp) 34static unsigned int simple_guess_base(const char *cp)
38{ 35{
39 if (cp[0] == '0') { 36 if (cp[0] == '0') {
40 if (TOLOWER(cp[1]) == 'x' && isxdigit(cp[2])) 37 if (_tolower(cp[1]) == 'x' && isxdigit(cp[2]))
41 return 16; 38 return 16;
42 else 39 else
43 return 8; 40 return 8;
@@ -59,13 +56,13 @@ unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int bas
59 if (!base) 56 if (!base)
60 base = simple_guess_base(cp); 57 base = simple_guess_base(cp);
61 58
62 if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x') 59 if (base == 16 && cp[0] == '0' && _tolower(cp[1]) == 'x')
63 cp += 2; 60 cp += 2;
64 61
65 while (isxdigit(*cp)) { 62 while (isxdigit(*cp)) {
66 unsigned int value; 63 unsigned int value;
67 64
68 value = isdigit(*cp) ? *cp - '0' : TOLOWER(*cp) - 'a' + 10; 65 value = isdigit(*cp) ? *cp - '0' : _tolower(*cp) - 'a' + 10;
69 if (value >= base) 66 if (value >= base)
70 break; 67 break;
71 result = result * base + value; 68 result = result * base + value;
@@ -1036,8 +1033,8 @@ precision:
1036qualifier: 1033qualifier:
1037 /* get the conversion qualifier */ 1034 /* get the conversion qualifier */
1038 spec->qualifier = -1; 1035 spec->qualifier = -1;
1039 if (*fmt == 'h' || TOLOWER(*fmt) == 'l' || 1036 if (*fmt == 'h' || _tolower(*fmt) == 'l' ||
1040 TOLOWER(*fmt) == 'z' || *fmt == 't') { 1037 _tolower(*fmt) == 'z' || *fmt == 't') {
1041 spec->qualifier = *fmt++; 1038 spec->qualifier = *fmt++;
1042 if (unlikely(spec->qualifier == *fmt)) { 1039 if (unlikely(spec->qualifier == *fmt)) {
1043 if (spec->qualifier == 'l') { 1040 if (spec->qualifier == 'l') {
@@ -1104,7 +1101,7 @@ qualifier:
1104 spec->type = FORMAT_TYPE_LONG; 1101 spec->type = FORMAT_TYPE_LONG;
1105 else 1102 else
1106 spec->type = FORMAT_TYPE_ULONG; 1103 spec->type = FORMAT_TYPE_ULONG;
1107 } else if (TOLOWER(spec->qualifier) == 'z') { 1104 } else if (_tolower(spec->qualifier) == 'z') {
1108 spec->type = FORMAT_TYPE_SIZE_T; 1105 spec->type = FORMAT_TYPE_SIZE_T;
1109 } else if (spec->qualifier == 't') { 1106 } else if (spec->qualifier == 't') {
1110 spec->type = FORMAT_TYPE_PTRDIFF; 1107 spec->type = FORMAT_TYPE_PTRDIFF;
@@ -1262,7 +1259,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
1262 if (qualifier == 'l') { 1259 if (qualifier == 'l') {
1263 long *ip = va_arg(args, long *); 1260 long *ip = va_arg(args, long *);
1264 *ip = (str - buf); 1261 *ip = (str - buf);
1265 } else if (TOLOWER(qualifier) == 'z') { 1262 } else if (_tolower(qualifier) == 'z') {
1266 size_t *ip = va_arg(args, size_t *); 1263 size_t *ip = va_arg(args, size_t *);
1267 *ip = (str - buf); 1264 *ip = (str - buf);
1268 } else { 1265 } else {
@@ -1549,7 +1546,7 @@ do { \
1549 void *skip_arg; 1546 void *skip_arg;
1550 if (qualifier == 'l') 1547 if (qualifier == 'l')
1551 skip_arg = va_arg(args, long *); 1548 skip_arg = va_arg(args, long *);
1552 else if (TOLOWER(qualifier) == 'z') 1549 else if (_tolower(qualifier) == 'z')
1553 skip_arg = va_arg(args, size_t *); 1550 skip_arg = va_arg(args, size_t *);
1554 else 1551 else
1555 skip_arg = va_arg(args, int *); 1552 skip_arg = va_arg(args, int *);
@@ -1855,8 +1852,8 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
1855 1852
1856 /* get conversion qualifier */ 1853 /* get conversion qualifier */
1857 qualifier = -1; 1854 qualifier = -1;
1858 if (*fmt == 'h' || TOLOWER(*fmt) == 'l' || 1855 if (*fmt == 'h' || _tolower(*fmt) == 'l' ||
1859 TOLOWER(*fmt) == 'z') { 1856 _tolower(*fmt) == 'z') {
1860 qualifier = *fmt++; 1857 qualifier = *fmt++;
1861 if (unlikely(qualifier == *fmt)) { 1858 if (unlikely(qualifier == *fmt)) {
1862 if (qualifier == 'h') { 1859 if (qualifier == 'h') {