From patchwork Sat May 11 11:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796223 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp1235802wra; Sat, 11 May 2024 04:54:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWZikqsrIuWvgRMpkPVreREk/TTsoasySeZiCGyEuxNiqVGzva1SbVY12Yvi+lUSQYkzRUP2cMn6+cHJYqYLNAS X-Google-Smtp-Source: AGHT+IFPxrS/K1tZhyg000BRHfARXo7wA7aHEHS0f5X5xNgVxjXlcLX4vTWJOIoxY8FWmUgaTid2 X-Received: by 2002:a05:620a:a93:b0:792:cd03:2fbc with SMTP id af79cd13be357-792cd032ffemr360579485a.8.1715428487165; Sat, 11 May 2024 04:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715428487; cv=none; d=google.com; s=arc-20160816; b=yUdWAE+Ppm3irTNkmF9bky6MqSVL+zFk0cB76BHsBWVDB+cTIC+nT8upOqGUpQ/Xo1 z6wrtT3XMYb1EROCE47s6QlCSC7Gx5hXQgyOpftnqp7Q67zQ/9wapDtZvwdo83MLLfXK FktekekyPtDey4pXbGrcTMCPgSYmmooJqfFYv2OjkvJd4Vg2xhdYLMyKxp3r70yDvA7w FHeLEROavZoXH0f/6KOpFIYhcbleAbEGD2p05OxnhuKXv3empHsEi62z5XuvqE8AtTmB zclak56xXdHPEkEll4jqKnv4uTzndwsB/m+KbiVKKpEs1kY88F5GbGZCB7Vab4ASszwW +eIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m32BdCDoIDtUZU97rjMJn0R/q9fXLMgEs1BlUjCyWs4=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=w6vocGklnDYByL/qb6kPDa2W41+w9BtS7uXEM1LHQbsvb8CaiO/9e0VmqV+ar2mwNr F4yHGpohyidR48wb4EYVU3B9qOPRldYYh4Z3Hn0NDxM7qyZAs3K9y3WXb3VKMkOx2tu8 ad/HWXKP7zeWMi8ysW8xI7SX6dp8NR1NyjA/savY33Ebu+oxLFYRKZHYM8+Ps3RJHOrb j6fER/Xm8dKXTK0ONQc3+KZIxxSuDmhqUVsi8t3BAJHeTccHkoD0g5ub7CIJCFIJQbw0 /CdvnVG+01tCeynB2O22LKcMbYVKkpRrhS8ZRDoIs/P/gfJi4WXamEhGsmId9srbLyXX oLBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oB1R5M0v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-792bf33b13dsi602958285a.451.2024.05.11.04.54.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 May 2024 04:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oB1R5M0v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5lIq-0000Ie-Oo; Sat, 11 May 2024 07:54:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5lIp-0000ID-3n for qemu-devel@nongnu.org; Sat, 11 May 2024 07:54:11 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5lIn-0006xZ-4B for qemu-devel@nongnu.org; Sat, 11 May 2024 07:54:10 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34c8592b8dbso2240539f8f.3 for ; Sat, 11 May 2024 04:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715428447; x=1716033247; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m32BdCDoIDtUZU97rjMJn0R/q9fXLMgEs1BlUjCyWs4=; b=oB1R5M0vWv1DO3FldvS07YuNfuU8aeyfYlmwc9TB1F9yOgj1Jz1bAf9bhnemvzR6wG OV1Sq5KWa3TlENtTuV5eAEkd9fqL+RublvRK2cEOvQD/UiXkvPaptMuJDn2xRHwkTxK4 Yp1Nxl9ptHCuRF5lbZGCATDXaHF8XZ85b9GvFIOUchBcb/c0W7EiRBDCCXGwpVILsFJL BBJrY0nS7an44P6X3ENm7BedLmye3a7mbO2J0jFzBQrOoY4cp1OUNRxdmo/7zYR7uRak WmGZhNE8eAbrX2ZFMHdt6lOgqcCPegVh7tkl+r3an55hiHA5rBraB3biDpUbtn+lCGDm a3zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715428447; x=1716033247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m32BdCDoIDtUZU97rjMJn0R/q9fXLMgEs1BlUjCyWs4=; b=HUtbRPihMnERShIcp+gppwSKG+0+ipcWNhsH+BiafaMogJvHxeMHiDjFeeppUUNtWh 2uBJi4cqlH3sKLHjbGyDYZEwNKuAnLv/GKEwqoyPTXVHwa9ZOzkuNek/DhDdMZ56EbLv uZauVKTUmrBYI9WrTSjWvjJgciu1lQ36HjIgcpYUfkfTb95WXMkn8OpvqeTfb2rkxls4 6nEHr2pz6Tn2pGj1ERAm+MhobF+0f1LsG3O0qXOkPZ4hF86rToqzv5/vx5FBgBlWnJ+h LclCzdOXXpyGjkn7GuB0FnoTFetFaa6UusHB67GLwDFyA9CuiP18ug29/q1M7ir9PBxr k3dg== X-Gm-Message-State: AOJu0YxxL5K39RBbfpQnvJbBxbjkBQZWNzcU69SIvYs4FSTIN9NEbIfb v6KS9+2PBG30VMbsb+rbOixc5gMOHG5ggy1rVNkfjiquK969dkpNsTzXlzlPkBpj2Ar50MMd/np 8IbU= X-Received: by 2002:a5d:698d:0:b0:34b:2a61:b3c9 with SMTP id ffacd0b85a97d-3504a73ece6mr3512221f8f.40.1715428447727; Sat, 11 May 2024 04:54:07 -0700 (PDT) Received: from stoup.. ([195.76.196.165]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502bbbbf20sm6764797f8f.93.2024.05.11.04.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 04:54:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH 05/17] Remove return value from reginfo_dump Date: Sat, 11 May 2024 13:53:48 +0200 Message-Id: <20240511115400.7587-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240511115400.7587-1-richard.henderson@linaro.org> References: <20240511115400.7587-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org No uses actually checked the error indication. Even if we wanted to check ferror on the stream, we should do that generically rather than per arch. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- risu.h | 4 ++-- risu_reginfo_aarch64.c | 8 +++----- risu_reginfo_arm.c | 6 ++---- risu_reginfo_i386.c | 6 ++---- risu_reginfo_loongarch64.c | 6 ++---- risu_reginfo_m68k.c | 6 ++---- risu_reginfo_ppc64.c | 6 ++---- risu_reginfo_s390x.c | 6 ++---- 8 files changed, 17 insertions(+), 31 deletions(-) diff --git a/risu.h b/risu.h index 1b87af2..aa8cc22 100644 --- a/risu.h +++ b/risu.h @@ -120,8 +120,8 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc, void *siaddr); /* return 1 if structs are equal, 0 otherwise. */ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); -/* print reginfo state to a stream, returns 1 on success, 0 on failure */ -int reginfo_dump(struct reginfo *ri, FILE * f); +/* print reginfo state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE *f); /* reginfo_dump_mismatch: print mismatch details to a stream */ void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c index da221d5..0161044 100644 --- a/risu_reginfo_aarch64.c +++ b/risu_reginfo_aarch64.c @@ -219,8 +219,8 @@ static void sve_dump_zreg_diff(FILE *f, int vq, const uint64_t *za, } } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE * f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE * f) { int i; fprintf(f, " faulting insn %08x\n", ri->faulting_insn); @@ -263,7 +263,7 @@ int reginfo_dump(struct reginfo *ri, FILE * f) sve_dump_preg(f, vq, p); fprintf(f, "\n"); } - return !ferror(f); + return; } for (i = 0; i < 32; i++) { @@ -271,8 +271,6 @@ int reginfo_dump(struct reginfo *ri, FILE * f) fprintf(f, " V%-2d : %016" PRIx64 "%016" PRIx64 "\n", i, v[1], v[0]); } - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE * f) diff --git a/risu_reginfo_arm.c b/risu_reginfo_arm.c index 221bd8a..0e179be 100644 --- a/risu_reginfo_arm.c +++ b/risu_reginfo_arm.c @@ -161,8 +161,8 @@ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2) return memcmp(r1, r2, sizeof(*r1)) == 0; /* ok since we memset 0 */ } -/* reginfo_dump: print the state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE *f) +/* reginfo_dump: print the state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE *f) { int i; if (ri->faulting_insn_size == 2) { @@ -179,8 +179,6 @@ int reginfo_dump(struct reginfo *ri, FILE *f) i, (unsigned long long) ri->fpregs[i]); } fprintf(f, " fpscr: %08x\n", ri->fpscr); - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_i386.c b/risu_reginfo_i386.c index 18d15ca..f4cf9a3 100644 --- a/risu_reginfo_i386.c +++ b/risu_reginfo_i386.c @@ -310,8 +310,8 @@ static char get_vecletter(uint64_t features) } } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE *f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE *f) { uint64_t features; int i, j, n, w; @@ -345,8 +345,6 @@ int reginfo_dump(struct reginfo *ri, FILE *f) fprintf(f, " k%-5d: %016" PRIx64 "\n", i, ri->kregs[i]); } } - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_loongarch64.c b/risu_reginfo_loongarch64.c index 630d6b2..060715f 100644 --- a/risu_reginfo_loongarch64.c +++ b/risu_reginfo_loongarch64.c @@ -159,8 +159,8 @@ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2) return !memcmp(r1, r2, sizeof(*r1)); } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE * f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE * f) { int i; fprintf(f, " faulting insn %08x\n", ri->faulting_insn); @@ -191,8 +191,6 @@ int reginfo_dump(struct reginfo *ri, FILE * f) fprintf(f, " vreg%-2d : %016lx\n", i, ri->vregs[4 * i]); } } - - return !ferror(f); } /* reginfo_dump_mismatch: print mismatch details to a stream */ diff --git a/risu_reginfo_m68k.c b/risu_reginfo_m68k.c index 18ae1d8..a53244d 100644 --- a/risu_reginfo_m68k.c +++ b/risu_reginfo_m68k.c @@ -92,8 +92,8 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a) return 1; } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE *f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE *f) { int i; fprintf(f, " pc \e[1;101;37m0x%08x\e[0m\n", ri->pc); @@ -114,8 +114,6 @@ int reginfo_dump(struct reginfo *ri, FILE *f) } fprintf(f, "\n"); - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c index 486bbf9..fc69805 100644 --- a/risu_reginfo_ppc64.c +++ b/risu_reginfo_ppc64.c @@ -103,8 +103,8 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a) return 1; } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE * f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE * f) { int i; @@ -143,8 +143,6 @@ int reginfo_dump(struct reginfo *ri, FILE * f) ri->vrregs.vrregs[i][0], ri->vrregs.vrregs[i][1], ri->vrregs.vrregs[i][2], ri->vrregs.vrregs[i][3]); } - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_s390x.c b/risu_reginfo_s390x.c index 9c8fcfd..cbf168e 100644 --- a/risu_reginfo_s390x.c +++ b/risu_reginfo_s390x.c @@ -82,8 +82,8 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a) memcmp(&m->fprs, &a->fprs, sizeof(m->fprs)) == 0; } -/* reginfo_dump: print state to a stream, returns nonzero on success */ -int reginfo_dump(struct reginfo *ri, FILE * f) +/* reginfo_dump: print state to a stream */ +void reginfo_dump(struct reginfo *ri, FILE * f) { int i; @@ -103,8 +103,6 @@ int reginfo_dump(struct reginfo *ri, FILE * f) i + 8, *(uint64_t *)&ri->fprs[i + 8]); } fprintf(f, "\tFPC: %8x\n\n", ri->fpc); - - return !ferror(f); } void reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f)