Lines Matching +full:value +full:- +full:start

1 // SPDX-License-Identifier: GPL-2.0
11 * found in <asm-xx/string.h>), or get overloaded by FORTIFY_SOURCE.
31 #include <asm/word-at-a-time.h>
35 * strncasecmp - Case insensitive, length-limited string comparison
59 } while (--len); in strncasecmp()
60 return (int)c1 - (int)c2; in strncasecmp()
74 return c1 - c2; in strcasecmp()
100 count--; in strncpy()
120 return -E2BIG; in sized_strscpy()
127 if ((long)src & (sizeof(long) - 1)) { in sized_strscpy()
128 size_t limit = PAGE_SIZE - ((long)src & (PAGE_SIZE - 1)); in sized_strscpy()
133 /* If src or dest is unaligned, don't do word-at-a-time. */ in sized_strscpy()
134 if (((long) dest | (long) src) & (sizeof(long) - 1)) in sized_strscpy()
156 count -= sizeof(unsigned long); in sized_strscpy()
160 return -E2BIG; in sized_strscpy()
164 max -= sizeof(unsigned long); in sized_strscpy()
175 count--; in sized_strscpy()
178 /* Force NUL-termination. */ in sized_strscpy()
182 return src[res] ? -E2BIG : res; in sized_strscpy()
187 * stpcpy - copy a string from src to dest returning a pointer to the new end
188 * of dest, including src's %NUL-terminator. May overrun dest.
194 * stpcpy differs from strcpy in a key way: the return value is a pointer
195 * to the new %NUL-terminating character in @dest. (For strcpy, the return
196 * value is a pointer to the start of @dest). This interface is considered
206 return --dest; in stpcpy()
233 if (--count == 0) { in strncat()
255 count -= dsize; in strlcat()
257 len = count-1; in strlcat()
267 * strcmp - Compare two strings
279 return c1 < c2 ? -1 : 1; in strcmp()
290 * strncmp - Compare two length-limited strings
303 return c1 < c2 ? -1 : 1; in strncmp()
306 count--; in strncmp()
315 * strchr - Find the first occurrence of a character in a string
319 * Note that the %NUL-terminator is considered part of the string, and can
334 * strchrnul - Find and return a character in a string, or end of string
351 * strnchrnul - Find and return a character in a length limited string,
362 while (count-- && *s && *s != (char)c) in strnchrnul()
369 * strrchr - Find the last occurrence of a character in a string
387 * strnchr - Find a character in a length limited string
392 * Note that the %NUL-terminator is considered part of the string, and can
397 while (count--) { in strnchr()
415 return sc - s; in strlen()
425 for (sc = s; count-- && *sc != '\0'; ++sc) in strnlen()
427 return sc - s; in strnlen()
434 …* strspn - Calculate the length of the initial substring of @s which only contain letters in @acce…
446 return p - s; in strspn()
453 …* strcspn - Calculate the length of the initial substring of @s which does not contain letters in …
465 return p - s; in strcspn()
472 * strpbrk - Find the first occurrence of a set of characters
491 * strsep - Split a string into tokens
498 * of that name. In fact, it was stolen from glibc2 and de-fancy-fied.
520 * memset - Fill a region of memory with the given value
521 * @s: Pointer to the start of the area.
531 while (count--) in memset()
540 * memset16() - Fill a memory area with a uint16_t
541 * @s: Pointer to the start of the area.
542 * @v: The value to fill the area with
553 while (count--) in memset16()
562 * memset32() - Fill a memory area with a uint32_t
563 * @s: Pointer to the start of the area.
564 * @v: The value to fill the area with
575 while (count--) in memset32()
584 * memset64() - Fill a memory area with a uint64_t
585 * @s: Pointer to the start of the area.
586 * @v: The value to fill the area with
597 while (count--) in memset64()
606 * memcpy - Copy one area of memory to another
619 while (count--) in memcpy()
628 * memmove - Copy one area of memory to another
643 while (count--) in memmove()
650 while (count--) in memmove()
651 *--tmp = *--s; in memmove()
660 * memcmp - Compare two areas of memory
680 count -= sizeof(unsigned long); in memcmp()
686 for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) in memcmp()
687 if ((res = *su1 - *su2) != 0) in memcmp()
696 * bcmp - returns 0 if and only if the buffers have identical contents.
701 * The sign or magnitude of a non-zero return value has no particular
704 * not rely on anything but whether the return value is zero or non-zero.
715 * memscan - Find a character in an area of memory.
731 size--; in memscan()
740 * strstr - Find the first substring in a %NUL terminated string
753 l1--; in strstr()
765 * strnstr - Find the first substring in a length-limited string
778 len--; in strnstr()
790 * memchr - Find a character in an area of memory.
801 while (n-- != 0) { in memchr()
803 return (void *)(p - 1); in memchr()
811 static void *check_bytes8(const u8 *start, u8 value, unsigned int bytes) in check_bytes8() argument
814 if (*start != value) in check_bytes8()
815 return (void *)start; in check_bytes8()
816 start++; in check_bytes8()
817 bytes--; in check_bytes8()
823 * memchr_inv - Find an unmatching character in an area of memory.
824 * @start: The memory area
831 void *memchr_inv(const void *start, int c, size_t bytes) in memchr_inv() argument
833 u8 value = c; in memchr_inv() local
838 return check_bytes8(start, value, bytes); in memchr_inv()
840 value64 = value; in memchr_inv()
852 prefix = (unsigned long)start % 8; in memchr_inv()
856 prefix = 8 - prefix; in memchr_inv()
857 r = check_bytes8(start, value, prefix); in memchr_inv()
860 start += prefix; in memchr_inv()
861 bytes -= prefix; in memchr_inv()
867 if (*(u64 *)start != value64) in memchr_inv()
868 return check_bytes8(start, value, 8); in memchr_inv()
869 start += 8; in memchr_inv()
870 words--; in memchr_inv()
873 return check_bytes8(start, value, bytes % 8); in memchr_inv()