1 From 3d229cc0f8dc81335c53b1f7471ef82ef2f6e570 Mon Sep 17 00:00:00 2001
2 From: Marcin Niestroj <m.niestroj@grinn-global.com>
3 Date: Fri, 23 Jun 2017 11:11:04 +0200
4 Subject: [PATCH] common: Rename strlcpy to DT_strlcpy
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 strlcpy function is defined in uClibc library, causing "static
10 declaration of ‘strlcpy’ follows non-static declaration" build
13 Rename internal strlcpy function to DT_strlcpy to avoid conflicts.
15 Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
17 src/dt/common.h | 4 ++--
19 2 files changed, 3 insertions(+), 3 deletions(-)
21 diff --git a/src/dt/common.h b/src/dt/common.h
22 index f6bad44..992e28f 100644
25 @@ -168,7 +168,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
26 #define basprintf(fmt, arg...) barebox_asprintf(fmt, ##arg)
29 - * strlcpy - Copy a %NUL terminated string into a sized buffer
30 + * DT_strlcpy - Copy a %NUL terminated string into a sized buffer
31 * @dest: Where to copy the string to
32 * @src: Where to copy the string from
33 * @size: size of destination buffer
34 @@ -178,7 +178,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
35 * of course, the buffer size is zero). It does not pad
36 * out the result like strncpy() does.
38 -static inline size_t strlcpy(char *dest, const char *src, size_t size)
39 +static inline size_t DT_strlcpy(char *dest, const char *src, size_t size)
41 size_t ret = strlen(src);
43 diff --git a/src/libdt.c b/src/libdt.c
44 index 4db5160..3adeed2 100644
47 @@ -1503,7 +1503,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
48 if (!compatible || strlen(compatible) > cplen)
50 p = strchr(compatible, ',');
51 - strlcpy(modalias, p ? p + 1 : compatible, len);
52 + DT_strlcpy(modalias, p ? p + 1 : compatible, len);