util: Make qemu_oom_check() a static function
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 26 Feb 2022 18:07:16 +0000 (18:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 7 Mar 2022 13:09:20 +0000 (13:09 +0000)
The qemu_oom_check() function, which we define in both oslib-posix.c
and oslib-win32.c, is now used only locally in that file; make it
static.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220226180723.1706285-3-peter.maydell@linaro.org

include/qemu-common.h
util/oslib-posix.c
util/oslib-win32.c

index 68b2e3bc109132954920c5d1313209bc1cf29aaf..8c0d9ab0f77134b83603b7802bf5c3926358c956 100644 (file)
@@ -26,8 +26,6 @@
 int qemu_main(int argc, char **argv, char **envp);
 #endif
 
-void *qemu_oom_check(void *ptr);
-
 ssize_t qemu_write_full(int fd, const void *buf, size_t count)
     QEMU_WARN_UNUSED_RESULT;
 
index f2be7321c59f707d9364b410797ebd3efb754969..ed5974d38457c6446e4a1ec52467aadd252af423 100644 (file)
@@ -199,7 +199,7 @@ fail_close:
     return false;
 }
 
-void *qemu_oom_check(void *ptr)
+static void *qemu_oom_check(void *ptr)
 {
     if (ptr == NULL) {
         fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno));
index af559ef3398dc3473da4cdc22f7a1028bc5912bc..c87e6977246da9eeb98428a12f103b5ea36f9a31 100644 (file)
@@ -44,7 +44,7 @@
 /* this must come after including "trace.h" */
 #include <shlobj.h>
 
-void *qemu_oom_check(void *ptr)
+static void *qemu_oom_check(void *ptr)
 {
     if (ptr == NULL) {
         fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError());