aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug4
-rw-r--r--lib/devres.c10
-rw-r--r--lib/kobject_uevent.c6
-rw-r--r--lib/string.c18
4 files changed, 31 insertions, 7 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 819ac51202c0..99c8bfee1b00 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -575,8 +575,8 @@ config DEBUG_HIGHMEM
575 bool "Highmem debugging" 575 bool "Highmem debugging"
576 depends on DEBUG_KERNEL && HIGHMEM 576 depends on DEBUG_KERNEL && HIGHMEM
577 help 577 help
578 This options enables addition error checking for high memory systems. 578 This option enables additional error checking for high memory
579 Disable for production systems. 579 systems. Disable for production systems.
580 580
581config HAVE_DEBUG_STACKOVERFLOW 581config HAVE_DEBUG_STACKOVERFLOW
582 bool 582 bool
diff --git a/lib/devres.c b/lib/devres.c
index 2f16c133fd36..f562bf6ff71d 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -157,12 +157,12 @@ EXPORT_SYMBOL(devm_ioremap_resource);
157 * if (!base) 157 * if (!base)
158 * return -EADDRNOTAVAIL; 158 * return -EADDRNOTAVAIL;
159 */ 159 */
160void __iomem *devm_request_and_ioremap(struct device *device, 160void __iomem *devm_request_and_ioremap(struct device *dev,
161 struct resource *res) 161 struct resource *res)
162{ 162{
163 void __iomem *dest_ptr; 163 void __iomem *dest_ptr;
164 164
165 dest_ptr = devm_ioremap_resource(device, res); 165 dest_ptr = devm_ioremap_resource(dev, res);
166 if (IS_ERR(dest_ptr)) 166 if (IS_ERR(dest_ptr))
167 return NULL; 167 return NULL;
168 168
@@ -194,7 +194,7 @@ static int devm_ioport_map_match(struct device *dev, void *res,
194 * Managed ioport_map(). Map is automatically unmapped on driver 194 * Managed ioport_map(). Map is automatically unmapped on driver
195 * detach. 195 * detach.
196 */ 196 */
197void __iomem * devm_ioport_map(struct device *dev, unsigned long port, 197void __iomem *devm_ioport_map(struct device *dev, unsigned long port,
198 unsigned int nr) 198 unsigned int nr)
199{ 199{
200 void __iomem **ptr, *addr; 200 void __iomem **ptr, *addr;
@@ -265,7 +265,7 @@ static void pcim_iomap_release(struct device *gendev, void *res)
265 * be safely called without context and guaranteed to succed once 265 * be safely called without context and guaranteed to succed once
266 * allocated. 266 * allocated.
267 */ 267 */
268void __iomem * const * pcim_iomap_table(struct pci_dev *pdev) 268void __iomem * const *pcim_iomap_table(struct pci_dev *pdev)
269{ 269{
270 struct pcim_iomap_devres *dr, *new_dr; 270 struct pcim_iomap_devres *dr, *new_dr;
271 271
@@ -290,7 +290,7 @@ EXPORT_SYMBOL(pcim_iomap_table);
290 * Managed pci_iomap(). Map is automatically unmapped on driver 290 * Managed pci_iomap(). Map is automatically unmapped on driver
291 * detach. 291 * detach.
292 */ 292 */
293void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen) 293void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen)
294{ 294{
295 void __iomem **tbl; 295 void __iomem **tbl;
296 296
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 4e3bd71bd949..9ebf9e20de53 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -29,7 +29,9 @@
29 29
30 30
31u64 uevent_seqnum; 31u64 uevent_seqnum;
32#ifdef CONFIG_UEVENT_HELPER
32char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH; 33char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH;
34#endif
33#ifdef CONFIG_NET 35#ifdef CONFIG_NET
34struct uevent_sock { 36struct uevent_sock {
35 struct list_head list; 37 struct list_head list;
@@ -109,6 +111,7 @@ static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data)
109} 111}
110#endif 112#endif
111 113
114#ifdef CONFIG_UEVENT_HELPER
112static int kobj_usermode_filter(struct kobject *kobj) 115static int kobj_usermode_filter(struct kobject *kobj)
113{ 116{
114 const struct kobj_ns_type_operations *ops; 117 const struct kobj_ns_type_operations *ops;
@@ -147,6 +150,7 @@ static void cleanup_uevent_env(struct subprocess_info *info)
147{ 150{
148 kfree(info->data); 151 kfree(info->data);
149} 152}
153#endif
150 154
151/** 155/**
152 * kobject_uevent_env - send an uevent with environmental data 156 * kobject_uevent_env - send an uevent with environmental data
@@ -323,6 +327,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
323#endif 327#endif
324 mutex_unlock(&uevent_sock_mutex); 328 mutex_unlock(&uevent_sock_mutex);
325 329
330#ifdef CONFIG_UEVENT_HELPER
326 /* call uevent_helper, usually only enabled during early boot */ 331 /* call uevent_helper, usually only enabled during early boot */
327 if (uevent_helper[0] && !kobj_usermode_filter(kobj)) { 332 if (uevent_helper[0] && !kobj_usermode_filter(kobj)) {
328 struct subprocess_info *info; 333 struct subprocess_info *info;
@@ -347,6 +352,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
347 env = NULL; /* freed by cleanup_uevent_env */ 352 env = NULL; /* freed by cleanup_uevent_env */
348 } 353 }
349 } 354 }
355#endif
350 356
351exit: 357exit:
352 kfree(devpath); 358 kfree(devpath);
diff --git a/lib/string.c b/lib/string.c
index 9b1f9062a202..e0c20eb362f0 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -301,6 +301,24 @@ char *strchr(const char *s, int c)
301EXPORT_SYMBOL(strchr); 301EXPORT_SYMBOL(strchr);
302#endif 302#endif
303 303
304#ifndef __HAVE_ARCH_STRCHRNUL
305/**
306 * strchrnul - Find and return a character in a string, or end of string
307 * @s: The string to be searched
308 * @c: The character to search for
309 *
310 * Returns pointer to first occurrence of 'c' in s. If c is not found, then
311 * return a pointer to the null byte at the end of s.
312 */
313char *strchrnul(const char *s, int c)
314{
315 while (*s && *s != (char)c)
316 s++;
317 return (char *)s;
318}
319EXPORT_SYMBOL(strchrnul);
320#endif
321
304#ifndef __HAVE_ARCH_STRRCHR 322#ifndef __HAVE_ARCH_STRRCHR
305/** 323/**
306 * strrchr - Find the last occurrence of a character in a string 324 * strrchr - Find the last occurrence of a character in a string