mb/google/brya: Create rull variant
[coreboot2.git] / src / lib / memcmp.c
bloba9690359b95a318e66ec0e635d8b7e920c76c472
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <string.h>
5 int memcmp(const void *src1, const void *src2, size_t bytes)
7 const unsigned char *s1, *s2;
8 int result;
9 s1 = src1;
10 s2 = src2;
11 result = 0;
12 while ((bytes > 0) && (result == 0)) {
13 result = *s1 - *s2;
14 bytes--;
15 s1++;
16 s2++;
18 return result;