summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/string.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b4d2f09081..ab713f20e9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -33,6 +33,7 @@
#define S64_MIN ((s64)(-S64_MAX - 1))
#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
+#define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a))
#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
diff --git a/include/linux/string.h b/include/linux/string.h
index 5df8c50e57..ed4eeb5519 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -80,6 +80,9 @@ extern __kernel_size_t strnlen(const char *,__kernel_size_t);
#ifndef __HAVE_ARCH_STRDUP
extern char * strdup(const char *);
#endif
+#ifndef __HAVE_ARCH_STRNDUP
+extern char *strndup(const char *, size_t);
+#endif
#ifndef __HAVE_ARCH_STRSWAB
extern char * strswab(const char *);
#endif