diff mbox

shared: make scratchbuf_str static

Message ID 1478674346-29996-1-git-send-email-yauheni.kaliuta@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Yauheni Kaliuta Nov. 9, 2016, 6:52 a.m. UTC
It fixes linking problem

tools/depmod.o: In function `output_symbols_bin':
depmod.c:(.text.output_symbols_bin+0x135): undefined reference to `scratchbuf_str'

for -O0 build, where gcc doesn't actually inline it.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---
 shared/scratchbuf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lucas De Marchi Nov. 11, 2016, 12:14 a.m. UTC | #1
On Wed, 2016-11-09 at 08:52 +0200, Yauheni Kaliuta wrote:
> It fixes linking problem

> 

> tools/depmod.o: In function `output_symbols_bin':

> depmod.c:(.text.output_symbols_bin+0x135): undefined reference to

> `scratchbuf_str'

> 

> for -O0 build, where gcc doesn't actually inline it.

> 

> Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>

> ---


Applied, thanks

Lucas De Marchi
diff mbox

Patch

diff --git a/shared/scratchbuf.h b/shared/scratchbuf.h
index c12e4902528f..27ea9d9f6008 100644
--- a/shared/scratchbuf.h
+++ b/shared/scratchbuf.h
@@ -19,7 +19,7 @@  int scratchbuf_alloc(struct scratchbuf *buf, size_t sz);
 void scratchbuf_release(struct scratchbuf *buf);
 
 /* Return a C string */
-inline char *scratchbuf_str(struct scratchbuf *buf)
+static inline char *scratchbuf_str(struct scratchbuf *buf)
 {
 	return buf->bytes;
 }