From patchwork Tue Nov 21 13:40:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Benedict Glaw X-Patchwork-Id: 167747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp626300vqb; Tue, 21 Nov 2023 05:40:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3cQzLrGHTZLPMFClq1BYeCdEsXj84p9Brqg2XCI7119ZqLCv7tUrf51pQsoB5YcbtALle X-Received: by 2002:a05:620a:8b0e:b0:77d:5d1a:b4a9 with SMTP id qw14-20020a05620a8b0e00b0077d5d1ab4a9mr1232727qkn.39.1700574022004; Tue, 21 Nov 2023 05:40:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700574021; cv=pass; d=google.com; s=arc-20160816; b=zKwu2yrIjsF6WlY0xnVQZetvp55TF8R+2BGBisJB+8D4X5wSiMqNePSlJGPr+D/qh/ QFYkOg9xoIWlIC3Q8y3pmr7xNIMEArsfAXrbFadk5z0k9QrobLYgdmfo4lq7Lumx2Zvt rQm2hyiHeTzmIObinaJuUDf1ITz3EbDBjGtMlsxwjE+bpp01LlEnE+45Gza0B25Ub9Zw /D4ad2vs/Ba/04+KVLT2bkJv/mwFwIbzVWLp1WXKO1qScAWh5vj5Qi6xZO8utS+uZTJH Bf6KHxKUZfkg7AjkZMcV0a/xRTSBA5XOGo0bbBUU5SQQop6CHulgsFpzCXtH3FJy+hV2 +GzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:arc-filter :dmarc-filter:delivered-to; bh=5bOVYlq3px+CyNzsjNZtekUE8qRae4PAWBmYO1l6LFQ=; fh=m9aFdTbHTwUr0GiwSrjs1qI/usvs1uKuJOyn81jig9A=; b=yiEsm582+tkOxQefSMgORhrEiakaYIadcwRnBFVdF0Md0pY0lABB5VMzekUwEWHXeF LCXRSKnr75EEeYm7p4/aHsEqBIyxvcqRKTFT4XtnuLZsC0UlODmVmMfi2qR2us6he7Ea FGjx1lDyiAdj/yfcGEpoAsI64l2fak+b2th35ajHs+2F3dMTm1WuKvuRwxRKbj5KiHki TXGGxt6o6oKKrab5Aj9FeVn215w66vE8zXywaOmviubrU1sNAeD1K0H/prlui1WczW8W HF99GZ6g0139b+bNx97J+g4QyfYs/6UPke5B0JmF67pvu3q0DHrNw865OLLgP/MWiqAX WO4g== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bs33-20020a05620a472100b0077583599c4esi9148311qkb.239.2023.11.21.05.40.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 05:40:21 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4A083857BB7 for ; Tue, 21 Nov 2023 13:40:21 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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-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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783181105421615317 X-GMAIL-MSGID: 1783181105421615317 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. Ok to commit? MfG, JBG 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;