[PATCH 5/4] Rewrite my_basename() as inline function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andreas Robinson <andr345@xxxxxxxxx>
---
 util.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/util.h b/util.h
index c73ad21..6329344 100644
--- a/util.h
+++ b/util.h
@@ -10,6 +10,11 @@ char *underscores(char *string);
 
 const char *next_string(const char *string, unsigned long *secsize);
 
+static inline char *my_basename(const char *path)
+{
+	return (char *) ((strrchr((path), '/') ?: (path) - 1) + 1);
+}
+
 /*
  * Change endianness of x if conv is true.
  */
@@ -40,6 +45,5 @@ void *get_section64(void *file, unsigned long filesize,
 
 #define streq(a,b) (strcmp((a),(b)) == 0)
 #define strstarts(a,start) (strncmp((a),(start), strlen(start)) == 0)
-#define my_basename(path) ((strrchr((path), '/') ?: (path) - 1) + 1)
 
 #endif
-- 
1.5.6.3


--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux