On Tue, Oct 09, 2018 at 10:37:56AM -0700, Andrey Smirnov wrote: > Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> > --- > include/linux/string.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/string.h b/include/linux/string.h > index 3418b4fbe..c9823dab8 100644 > --- a/include/linux/string.h > +++ b/include/linux/string.h > @@ -111,6 +111,18 @@ extern char *strim(char *); > > void *memchr_inv(const void *start, int c, 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; > +} We already have basename() and posix_basename(). How does this one differ or could this be an alias for one of them? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox