From patchwork Mon Apr 4 14:38:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 556013 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp245587map; Mon, 4 Apr 2022 07:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNBgliPcKTEKekpcSHHf//zHswa8lktJH5dOlwfp4CQnnFzwvdY/5ART9kDBFAMuQnhyy8 X-Received: by 2002:a0d:c6c4:0:b0:2d6:f343:fa99 with SMTP id i187-20020a0dc6c4000000b002d6f343fa99mr240192ywd.142.1649083187173; Mon, 04 Apr 2022 07:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649083187; cv=none; d=google.com; s=arc-20160816; b=JBQj/WMBjjsODtJSagUMMTojg6ZqKz8LvQB7WZnVYGe8qf3GHkC8snpGFhZOt2sHKl AAaFfqa8Y9ScY6KVL/Lnuf6V6BzMXvX09zEkD96ZmU+yboZFuVDBQuWAAHS+GaDrXDpT +5UGg6X2pDc5tJYCuhghGE0yw2YDckIFaeDwNetm/p1BbkMAQyOHhq452+PeosgAIMzE kvf+6mFs1uiwqmizYrSQoio5NhCX2bqpfky5M6cVBPweX+2g3LaMykj0FY83TpqdihNQ m5oKl0nPg2SRnvDo2WkzPuH86xhkjWFAl0wdOClfD2X22MiA/qM+r/06mzmNJGzFd+XH lp0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from; bh=9/iJG3myFqfHK5E13LVnynziDKklPWT5ezHIb5uiPmA=; b=XT7Cd+MtQXID1WNYEaHDlEi3bz5WXiDuxUYl1/NLfGqNCUz8bmDCat+Kgq6ba6Io4A d/hKCDXEXlGIE3EaUO6tPuUYTPc0avf3QmmsuGjMpHfbBwbQyfxXGfEy4tmWg6mbYtrN CKHZ27zA3ZjAgpvdix2Xfw3qpOZka8Tnjg/Cj/dMIKp+V7OBAhT4h9nS1hMBLbXnuT9u PHiWF+z8rBKZ3emak+81cwwPj+iqLImSQ5WgWSD6rh48RPqCQpCTHMkEMXFykbqbGY1v bat1ciAwOlVacQeI9a0Jx0+y13e60I7kUfocwQEGw4shOwThPBccWIjmXhsrBs00XmZp KYjQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e23-20020a253717000000b00633b6745fb0si9008450yba.167.2022.04.04.07.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Apr 2022 07:39: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; 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" Received: from localhost ([::1]:60738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbNru-0005s4-Mh for patch@linaro.org; Mon, 04 Apr 2022 10:39:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbNqa-0005lA-CZ for qemu-devel@nongnu.org; Mon, 04 Apr 2022 10:38:25 -0400 Received: from smtpout4.mo529.mail-out.ovh.net ([217.182.185.173]:52565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbNqW-0006ct-HT for qemu-devel@nongnu.org; Mon, 04 Apr 2022 10:38:24 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.146.241]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 5E0FAF31DA76; Mon, 4 Apr 2022 16:38:19 +0200 (CEST) Received: from kaod.org (37.59.142.95) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 4 Apr 2022 16:38:18 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-95G001bd1f45ca-9d3b-4555-81ab-23d7e9471efa, 193BEDB8EED17CFBFC1316EE01F9191BF107EB6B) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: , Subject: [PULL 3/3] linux-user/ppc: Narrow type of ccr in save_user_regs Date: Mon, 4 Apr 2022 16:38:13 +0200 Message-ID: <20220404143813.673262-4-clg@kaod.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220404143813.673262-1-clg@kaod.org> References: <20220404143813.673262-1-clg@kaod.org> MIME-Version: 1.0 X-Originating-IP: [37.59.142.95] X-ClientProxiedBy: DAG6EX1.mxp5.local (172.16.2.51) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 1cf1bbb2-afd7-40fb-987f-bf07f370554d X-Ovh-Tracer-Id: 205758210895612835 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudejvddgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfhisehtkeertdertdejnecuhfhrohhmpeevrogurhhitgcunfgvucfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepheehfeegjeeitdfffeetjeduveejueefuefgtdefueelueetveeliefhhffgtdelnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopegtlhhgsehkrghougdrohhrgh Received-SPF: pass client-ip=217.182.185.173; envelope-from=clg@kaod.org; helo=smtpout4.mo529.mail-out.ovh.net 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Cc: Peter Maydell , Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Coverity warns that we shift a 32-bit value by N, and then accumulate it into a 64-bit type (target_ulong on ppc64). The ccr is always 8 * 4-bit fields, and thus is always a 32-bit quantity; narrow the type to avoid the warning. Fixes: Coverity CID 1487223 Signed-off-by: Richard Henderson Reviewed-by: Cédric Le Goater Message-Id: <20220401191643.330393-1-richard.henderson@linaro.org> Signed-off-by: Cédric Le Goater --- linux-user/ppc/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index ec0b9c0df3da..ce5a4682cdfd 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame) { target_ulong msr = env->msr; int i; - target_ulong ccr = 0; + uint32_t ccr = 0; /* In general, the kernel attempts to be intelligent about what it needs to save for Altivec/FP/SPE registers. We don't care that