From nobody Wed Oct 29 09:06:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524586617250806.5872308703335; Tue, 24 Apr 2018 09:16:57 -0700 (PDT) Received: from localhost ([::1]:59413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB0ci-0006vf-Bb for importer@patchew.org; Tue, 24 Apr 2018 12:16:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB06J-0005PX-MN for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:43:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fB06E-0000j5-GB for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:43:27 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35177) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fB06E-0000ic-6M for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:43:22 -0400 Received: by mail-wr0-x243.google.com with SMTP id w3-v6so50431872wrg.2 for ; Tue, 24 Apr 2018 08:43:22 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t130sm10406118wmt.0.2018.04.24.08.43.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 08:43:15 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 65C113E0A5F; Tue, 24 Apr 2018 16:24:06 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EiFcVfhMjf9AXXl4rTHN8NJQbIPZJGrxc0yc25niYXM=; b=gpLZpS54gmYRnqFTG4dmzMtPkUIxna9R1Smj2lIq0Z62dSlM/z74wBnxO4jeNeL+ff cqlpzq8U5xTWwqSeRqI49Sz7vdtOcTfmJu4MsTjw58aUNHRV7EcNz+IguugfjXGjddiT vMJergS1VjQVVGYCU0sYjn+Fn+78bfyA74/WY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EiFcVfhMjf9AXXl4rTHN8NJQbIPZJGrxc0yc25niYXM=; b=Ny/hGlIapIGR5MVL+3CmjfUry1rKVjSA/y7zc/H2sEXq4E72C4Nf6QLHagwsMHT0P/ 1OmCsa0bwNTY5vj9M/flPlf2BoqWvMLZVVzI/AU4DsRgMSSF+xTDbGjlA7eDizXOdLSU ITOaq371kF6quMv9qebVzEOcye34VTmTxcnTY7WIXDDkBgrVdUu+wJfKORTODeWdM/b+ V3kVveLaxHLZ3+05Q4yCuzhMuU2+NG6pgvVkKBwOy5KjVXTvpL2ZW/T7WsSXYVw2RoVb QDHNuAYon9whJlD3xYFS/2C8hPh3lYLrUqZVtW1rGK3sgTWJpxqesW2l8o6j47SPufSw 6vyA== X-Gm-Message-State: ALQs6tDPm8iXxfThC8TZBzfMp0uYI/O8FwN5MN1oDnMwlFRFfIlzT3nB XalWwz4KJS1LTtzDmqUReHKEIQ== X-Google-Smtp-Source: AIpwx48AAQH63Ucqbi7B32c7g6/M26BweDfHwD8VNZgto5Jx7h84i/9ZUJH1LYBEIcuP9miqYrCBnQ== X-Received: by 2002:adf:8425:: with SMTP id 34-v6mr21863344wrf.254.1524584601024; Tue, 24 Apr 2018 08:43:21 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Tue, 24 Apr 2018 16:23:32 +0100 Message-Id: <20180424152405.10304-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424152405.10304-1-alex.bennee@linaro.org> References: <20180424152405.10304-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH v3 13/46] tests/tcg/multiarch: Build fix for linux-test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Fam Zheng To keep the compiler happy, and to fit in our buildsys flags: - Make local functions "static" - #ifdef out unused functions - drop cutils/osdep dependencies Signed-off-by: Fam Zheng [AJB: drop cutils/osdep dependencies] Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- tests/tcg/multiarch/linux-test.c | 68 ++++++++++---------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index 5070d31446..4457bd04ba 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -16,7 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ -#define _GNU_SOURCE #include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,13 +39,12 @@ #include #include #include -#include "qemu/cutils.h" =20 #define TESTPATH "/tmp/linux-test.tmp" #define TESTPORT 7654 #define STACK_SIZE 16384 =20 -void error1(const char *filename, int line, const char *fmt, ...) +static void error1(const char *filename, int line, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -56,7 +55,7 @@ void error1(const char *filename, int line, const char *f= mt, ...) exit(1); } =20 -int __chk_error(const char *filename, int line, int ret) +static int __chk_error(const char *filename, int line, int ret) { if (ret < 0) { error1(filename, line, "%m (ret=3D%d, errno=3D%d)", @@ -73,7 +72,7 @@ int __chk_error(const char *filename, int line, int ret) =20 #define FILE_BUF_SIZE 300 =20 -void test_file(void) +static void test_file(void) { int fd, i, len, ret; uint8_t buf[FILE_BUF_SIZE]; @@ -210,7 +209,7 @@ void test_file(void) chk_error(rmdir(TESTPATH)); } =20 -void test_fork(void) +static void test_fork(void) { int pid, status; =20 @@ -224,7 +223,7 @@ void test_fork(void) error("waitpid status=3D0x%x", status); } =20 -void test_time(void) +static void test_time(void) { struct timeval tv, tv2; struct timespec ts, rem; @@ -251,34 +250,7 @@ void test_time(void) error("getrusage"); } =20 -void pstrcpy(char *buf, int buf_size, const char *str) -{ - int c; - char *q =3D buf; - - if (buf_size <=3D 0) - return; - - for(;;) { - c =3D *str++; - if (c =3D=3D 0 || q >=3D buf + buf_size - 1) - break; - *q++ =3D c; - } - *q =3D '\0'; -} - -/* strcat and truncate. */ -char *pstrcat(char *buf, int buf_size, const char *s) -{ - int len; - len =3D strlen(buf); - if (len < buf_size) - pstrcpy(buf + len, buf_size - len, s); - return buf; -} - -int server_socket(void) +static int server_socket(void) { int val, fd; struct sockaddr_in sockaddr; @@ -298,7 +270,7 @@ int server_socket(void) =20 } =20 -int client_socket(void) +static int client_socket(void) { int fd; struct sockaddr_in sockaddr; @@ -312,9 +284,9 @@ int client_socket(void) return fd; } =20 -const char socket_msg[] =3D "hello socket\n"; +static const char socket_msg[] =3D "hello socket\n"; =20 -void test_socket(void) +static void test_socket(void) { int server_fd, client_fd, fd, pid, ret, val; struct sockaddr_in sockaddr; @@ -348,9 +320,10 @@ void test_socket(void) chk_error(close(server_fd)); } =20 +#if 0 #define WCOUNT_MAX 512 =20 -void test_pipe(void) +static void test_pipe(void) { fd_set rfds, wfds; int fds[2], fd_max, ret; @@ -391,10 +364,10 @@ void test_pipe(void) chk_error(close(fds[1])); } =20 -int thread1_res; -int thread2_res; +static int thread1_res; +static int thread2_res; =20 -int thread1_func(void *arg) +static int thread1_func(void *arg) { int i; for(i=3D0;i<5;i++) { @@ -404,7 +377,7 @@ int thread1_func(void *arg) return 0; } =20 -int thread2_func(void *arg) +static int thread2_func(void *arg) { int i; for(i=3D0;i<6;i++) { @@ -435,27 +408,28 @@ void test_clone(void) thread2_res !=3D 6) error("clone"); } +#endif =20 /***********************************/ =20 volatile int alarm_count; jmp_buf jmp_env; =20 -void sig_alarm(int sig) +static void sig_alarm(int sig) { if (sig !=3D SIGALRM) error("signal"); alarm_count++; } =20 -void sig_segv(int sig, siginfo_t *info, void *puc) +static void sig_segv(int sig, siginfo_t *info, void *puc) { if (sig !=3D SIGSEGV) error("signal"); longjmp(jmp_env, 1); } =20 -void test_signal(void) +static void test_signal(void) { struct sigaction act; struct itimerval it, oit; @@ -510,7 +484,7 @@ void test_signal(void) =20 #define SHM_SIZE 32768 =20 -void test_shm(void) +static void test_shm(void) { void *ptr; int shmid; --=20 2.17.0