From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lug-owl.de (lug-owl.de [IPv6:2a03:4000:10:469::]) by sourceware.org (Postfix) with ESMTPS id 87CEA3858D37 for ; Tue, 21 Nov 2023 13:40:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87CEA3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87CEA3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a03:4000:10:469:: ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700574015; cv=none; b=TtQ0mTJYWxO598K1dOgt1EDw8BehwFNBSIMlVKPQJ14ZktKnM6A1mIU4CmulXu543CWzZEZOlvtrSQ6IVDsRP18Tov4yCKzaz5KoZj7Wj6s8FoVdXJpWcOZzSDh6yLwFs9rkt0VkLiqnuQW8GQKd88kMipWR5VNdk27tXI7xozs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700574015; c=relaxed/simple; bh=jm7g86ph/pZKxadj7PZ1w3wY5wBRLmgJPvkpemB82WU=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=UsPKbFPEwQ62nrRcda6aM+kEdVUeCYeH0iRxsyKcBErpgGpaXf1CN3DCTgctSYH3grSiG2F/hKPRYJ54lkAHUC7obLs3QJGzTcd9hf6SEtFk1oVl2tXmfK2NedqxYQ2utcHCpotJMISmkARzHO7l2hYsIDfV/ZaoE9V6AIGsNuI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by lug-owl.de (Postfix, from userid 1001) id 79F9D40DEE; Tue, 21 Nov 2023 14:40:12 +0100 (CET) Date: Tue, 21 Nov 2023 14:40:12 +0100 From: Jan-Benedict Glaw To: binutils@sourceware.org Cc: Claudiu Zissulescu , Geoff Keating , Alan Modra , Peter Bergner Subject: [PATCH] PPC + ARC: Fix calloc() call Message-ID: <20231121134012.GA21972@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q5wOvoHkaccQRDme" Content-Disposition: inline X-Operating-System: Linux chamaeleon 6.4.0-0.deb12.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --q5wOvoHkaccQRDme Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable H! Recently, -Walloc-size warnings started to kick in. Fix these two calloc() calls to match the intended usage pattern. opcodes/ChangeLog: * arc-dis.c (init_arc_disasm_info): Fix calloc() call. * ppc-dis.c (powerpc_init_dialect): Ditto. diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index 59b668ff64e..7498e75cee2 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -147,7 +147,7 @@ static bool init_arc_disasm_info (struct disassemble_info *info) { struct arc_disassemble_info *arc_infop - =3D calloc (sizeof (*arc_infop), 1); + =3D calloc (1, sizeof (*arc_infop)); =20 if (arc_infop =3D=3D NULL) return false; diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index d97137d8b71..4d5652ebfeb 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info) { ppc_cpu_t dialect =3D 0; ppc_cpu_t sticky =3D 0; - struct dis_private *priv =3D calloc (sizeof (*priv), 1); + struct dis_private *priv =3D calloc (1, sizeof (*priv)); =20 if (priv =3D=3D NULL) return; Ok to commit? MfG, JBG --=20 --q5wOvoHkaccQRDme Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCZVyzOgAKCRAdvV51g5nh uw88AJ0RsdYsecjx7JFBDWuI49QtWm26TgCeNvb92dXKrT+gCuVib1KpYT1zc1A= =G9su -----END PGP SIGNATURE----- --q5wOvoHkaccQRDme--