public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
To: Jan-Benedict Glaw <jbglaw@lug-owl.de>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Cc: Geoff Keating <geoffk@geoffk.org>, Alan Modra <amodra@gmail.com>,
	Peter Bergner <bergner@vnet.ibm.com>
Subject: RE: [PATCH] PPC + ARC: Fix calloc() call
Date: Tue, 21 Nov 2023 13:49:56 +0000	[thread overview]
Message-ID: <MW2PR12MB23461C0FB3DAB1CC5A6E6E74CABBA@MW2PR12MB2346.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20231121134012.GA21972@lug-owl.de>

Hi,

Ok. Please commit it.

Thank you,
Claudiu

-----Original Message-----
From: Jan-Benedict Glaw <jbglaw@lug-owl.de> 
Sent: Tuesday, November 21, 2023 3:40 PM
To: binutils@sourceware.org
Cc: Claudiu Zissulescu <claziss@synopsys.com>; Geoff Keating <geoffk@geoffk.org>; Alan Modra <amodra@gmail.com>; Peter Bergner <bergner@vnet.ibm.com>
Subject: [PATCH] PPC + ARC: Fix calloc() call

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
-    = calloc (sizeof (*arc_infop), 1);
+    = calloc (1, sizeof (*arc_infop));
 
   if (arc_infop == 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 = 0;
   ppc_cpu_t sticky = 0;
-  struct dis_private *priv = calloc (sizeof (*priv), 1);
+  struct dis_private *priv = calloc (1, sizeof (*priv));
 
   if (priv == NULL)
     return;



Ok to commit?

MfG, JBG

-- 

  reply	other threads:[~2023-11-21 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 13:40 Jan-Benedict Glaw
2023-11-21 13:49 ` Claudiu Zissulescu [this message]
2023-11-21 15:19 ` Peter Bergner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW2PR12MB23461C0FB3DAB1CC5A6E6E74CABBA@MW2PR12MB2346.namprd12.prod.outlook.com \
    --to=claudiu.zissulescu@synopsys.com \
    --cc=amodra@gmail.com \
    --cc=bergner@vnet.ibm.com \
    --cc=binutils@sourceware.org \
    --cc=geoffk@geoffk.org \
    --cc=jbglaw@lug-owl.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).