string: allow override for strstarts()

A patch from »String optimizations and call support in alternatives« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Mon, 24 Oct 2022 14:06:26 +0200

Commit-Message

In some special cases it may be necessary to also override the inline strstarts() function, so move the relevant #ifdef in place. Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

include/linux/string.h | 2 ++ 1 file changed, 2 insertions(+)

Statistics

  • 2 lines added
  • 0 lines removed

Changes

---------------------------- include/linux/string.h ----------------------------
index cf7607b32102..2e5483238532 100644
@@ -206,6 +206,7 @@ extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
int ptr_to_hashval(const void *ptr, unsigned long *hashval_out);
+#ifndef __HAVE_ARCH_STRSTARTS
/**
* strstarts - does @str start with @prefix?
* @str: string to examine
@@ -215,6 +216,7 @@ static inline bool strstarts(const char *str, const char *prefix)
{
return strncmp(str, prefix, strlen(prefix)) == 0;
}
+#endif
size_t memweight(const void *ptr, size_t bytes);
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...