diff options
| author | Ingo Molnar <mingo@kernel.org> | 2013-01-24 12:47:48 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2013-01-24 12:47:48 +0100 |
| commit | befddb21c845f8fb49e637997891ef97c6a869dc (patch) | |
| tree | 0e7629123184f2dd50291ad6d477b894175f0f26 /include/linux/string.h | |
| parent | e716efde75267eab919cdb2bef5b2cb77f305326 (diff) | |
| parent | 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff) | |
Merge tag 'v3.8-rc4' into irq/core
Merge Linux 3.8-rc4 before pulling in new commits - we were on an old v3.7 base.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 630125818ca8..ac889c5ea11b 100644 --- a/include/linux/string.h +++ b/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_ */ |
