diff --git a/[refs] b/[refs] index 366ed7230b92..b788031e1b8c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0edd807dc96522d9a8e8b5298552cd8adf810cc5 +refs/heads/master: b18888ab256f05626193be955a7a03f01d676f8c diff --git a/trunk/include/linux/string.h b/trunk/include/linux/string.h index 630125818ca8..ac889c5ea11b 100644 --- a/trunk/include/linux/string.h +++ b/trunk/include/linux/string.h @@ -143,4 +143,15 @@ static inline bool strstarts(const char *str, const char *prefix) extern size_t memweight(const void *ptr, size_t bytes); +/** + * kbasename - return the last part of a pathname. + * + * @path: path to extract the filename from. + */ +static inline const char *kbasename(const char *path) +{ + const char *tail = strrchr(path, '/'); + return tail ? tail + 1 : path; +} + #endif /* _LINUX_STRING_H_ */