From nobody Tue Nov 26 06:28:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1709624226; cv=none; d=zohomail.com; s=zohoarc; b=LCL+3L/kwD6pF1SO2yGzqE2Jty0sDxzyt//2EwmOoJHcN6bsAhphwXPrgmLgrICCtjg7IHN501UnBouFgTp+bR/vt7hGzfoGkAL02J9u8KNCCKK45jLPLo83IJcnhrfBQrnSFam6ZWkSv6EJZPyAx2aq24tJrTyO4+Du3/j4i2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709624226; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cmLbJ+esOto+sw6Kux2WlDr6cZ4EBSoYVYY0hVqqE28=; b=eusbraaItNSJbWRZs0UuCd+P13Gl9fXRq6asPW3iO65v7VzZi1Y3c1NDEHgA2yx40QRKcN5GMjsixRwvelbhQvZRRyA5AsuNrwW1wSXcYxCdnxqM4b0Us5+O3i1LXRGgeFqACfq2dlqEIM2AvtTzGPhhoKx4Vn8EUC1KRR7HdFo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709624226508522.6486620483774; Mon, 4 Mar 2024 23:37:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhPM3-000692-1g; Tue, 05 Mar 2024 02:36:51 -0500 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 1rhPLn-00067B-Bj for qemu-devel@nongnu.org; Tue, 05 Mar 2024 02:36:38 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhPLl-0005ql-Gz for qemu-devel@nongnu.org; Tue, 05 Mar 2024 02:36:35 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1dc09556599so50923585ad.1 for ; Mon, 04 Mar 2024 23:36:33 -0800 (PST) Received: from localhost ([157.82.203.206]) by smtp.gmail.com with UTF8SMTPSA id g7-20020a170902868700b001dca9b21267sm9755313plo.186.2024.03.04.23.36.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Mar 2024 23:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1709624192; x=1710228992; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cmLbJ+esOto+sw6Kux2WlDr6cZ4EBSoYVYY0hVqqE28=; b=VRqTLIJgIZaTzYjhc+OfxD1OpRn8Ou+W6U5mkJXZLizwHGTwThrrKuptlJ5qjOW61/ aKKqC1QgyqJqjQmKqBxnl6fQ1CluB27lZSq/e0gOKOFWjdfiW1DWQHsoJ8a/vf7fBesM Of3vWrsZIHLHLu6hZJOedOegwmk/oqKmmlmF9K5MNxzcNsMIKjSH4ud6gJeDOH+srUnY sUCCyoYORyCJBhxN5Dc/734GuvU7j3ZILAta7gMtfKp1k5GLnKPqqh25/mKSjMZWXqhM nU86edkS+jKaZ15Jw1Eln3y4PppB54rsiv97WGPsR86lsMOwRtPp9klqzKiI4Rh9+fPe 9ObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709624192; x=1710228992; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cmLbJ+esOto+sw6Kux2WlDr6cZ4EBSoYVYY0hVqqE28=; b=RpIZvnTsjWJSmsjvHFz5Qggfbjgz3xe6GATUL5SHLwpce62QoFHsCOBBDS57QHHrby RaJEValACLvoCJV76xlflSTct4fl7TfUiS8RYeyjZCr5ZPt/g8SeKwzKEXbWv07QvKiK nXa+P2ejeOR/8dD5yxDY47aUSnhTmNvbgiMDckE0dlHgnXqIbdgh41Av/XwZQW5Wr/sJ iOZB2BTcHEvIVIgEFtzqNG+cVffAHr1HZvaZxKJB9sN6k0sJ1i/ShcV6qMfPyBECai3y l2YybrgsXmGePqlWBvWTLhtKKvEHOfo2t4c0o9+I5gJlajXt/bqHLzKm01Al+/t7+9Lc 6oHA== X-Gm-Message-State: AOJu0YzcoO7oGncUQWN6WwtkQYIcrbuluGxoQmxhjY2XkZ8Up8sfkKJ5 Nva0qMKfqTG/gv4s2JUNXDFme5YfQHFh1D6NvB8vSPZEJ/OImYUm+3m8u2+H8ABM8Ms2i9LWxks 8 X-Google-Smtp-Source: AGHT+IE8HDgHCaRHAIauPCvp7oS/+g+NrT7DNjoACgvxRHgyV6y40GQ3KNsimXRnX7lHDDqOadknOQ== X-Received: by 2002:a17:902:eb89:b0:1db:c90f:e189 with SMTP id q9-20020a170902eb8900b001dbc90fe189mr1027261plg.57.1709624191799; Mon, 04 Mar 2024 23:36:31 -0800 (PST) From: Akihiko Odaki Date: Tue, 05 Mar 2024 16:36:18 +0900 Subject: [PATCH v2 01/13] contrib/elf2dmp: Remove unnecessary err flags MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240305-elf2dmp-v2-1-86ff2163ad32@daynix.com> References: <20240305-elf2dmp-v2-0-86ff2163ad32@daynix.com> In-Reply-To: <20240305-elf2dmp-v2-0-86ff2163ad32@daynix.com> To: Viktor Prutyanov , Peter Maydell Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::631; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1709624228532100003 They are always evaluated to 1. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- contrib/elf2dmp/pdb.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c index 40991f5f4c34..abf17c2e7c12 100644 --- a/contrib/elf2dmp/pdb.c +++ b/contrib/elf2dmp/pdb.c @@ -177,7 +177,6 @@ static int pdb_init_segments(struct pdb_reader *r) =20 static int pdb_init_symbols(struct pdb_reader *r) { - int err =3D 0; PDB_SYMBOLS *symbols; =20 symbols =3D pdb_ds_read_file(r, 3); @@ -196,7 +195,6 @@ static int pdb_init_symbols(struct pdb_reader *r) /* Read global symbol table */ r->modimage =3D pdb_ds_read_file(r, symbols->gsym_file); if (!r->modimage) { - err =3D 1; goto out_symbols; } =20 @@ -205,7 +203,7 @@ static int pdb_init_symbols(struct pdb_reader *r) out_symbols: g_free(symbols); =20 - return err; + return 1; } =20 static int pdb_reader_ds_init(struct pdb_reader *r, PDB_DS_HEADER *hdr) @@ -228,7 +226,6 @@ static int pdb_reader_ds_init(struct pdb_reader *r, PDB= _DS_HEADER *hdr) =20 static int pdb_reader_init(struct pdb_reader *r, void *data) { - int err =3D 0; const char pdb7[] =3D "Microsoft C/C++ MSF 7.00"; =20 if (memcmp(data, pdb7, sizeof(pdb7) - 1)) { @@ -241,17 +238,14 @@ static int pdb_reader_init(struct pdb_reader *r, void= *data) =20 r->ds.root =3D pdb_ds_read_file(r, 1); if (!r->ds.root) { - err =3D 1; goto out_ds; } =20 if (pdb_init_symbols(r)) { - err =3D 1; goto out_root; } =20 if (pdb_init_segments(r)) { - err =3D 1; goto out_sym; } =20 @@ -264,7 +258,7 @@ out_root: out_ds: pdb_reader_ds_exit(r); =20 - return err; + return 1; } =20 static void pdb_reader_exit(struct pdb_reader *r) @@ -278,7 +272,6 @@ static void pdb_reader_exit(struct pdb_reader *r) int pdb_init_from_file(const char *name, struct pdb_reader *reader) { GError *gerr =3D NULL; - int err =3D 0; void *map; =20 reader->gmf =3D g_mapped_file_new(name, TRUE, &gerr); @@ -291,7 +284,6 @@ int pdb_init_from_file(const char *name, struct pdb_rea= der *reader) reader->file_size =3D g_mapped_file_get_length(reader->gmf); map =3D g_mapped_file_get_contents(reader->gmf); if (pdb_reader_init(reader, map)) { - err =3D 1; goto out_unmap; } =20 @@ -300,7 +292,7 @@ int pdb_init_from_file(const char *name, struct pdb_rea= der *reader) out_unmap: g_mapped_file_unref(reader->gmf); =20 - return err; + return 1; } =20 void pdb_exit(struct pdb_reader *reader) --=20 2.44.0