From patchwork Sun Jan 14 23:44:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Cain X-Patchwork-Id: 1886497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ZxeigbQw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TCsNq11Z3z1yPY for ; Mon, 15 Jan 2024 10:46:18 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPAAF-0003X8-RL; Sun, 14 Jan 2024 18:45:15 -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 1rPAAE-0003Ws-Bi for qemu-devel@nongnu.org; Sun, 14 Jan 2024 18:45:14 -0500 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPAAC-0006ng-8q for qemu-devel@nongnu.org; Sun, 14 Jan 2024 18:45:14 -0500 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40ENUVUw023944; Sun, 14 Jan 2024 23:45:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=qcppdkim1; bh=g+BLs7JcrxxPDqLBfXVt iL5D26+lGpsjpTwKgc8Oo9s=; b=ZxeigbQww9soFvhjfzFPFbsVmx+dXIl9zPEE Zyr7v78SuzxYyi224P3CYcHAUt0QNccSomRUYffzeXsvh5c+Dc69UeW4/IXehg8T UjiwrPT/TQd/FXEdsnWJ290blC6PpIAzUK5D/shtamtjDivSDi/Dgv3UCF9jbz1v Zx8asAHHUaozPWZwgzrO1yAwlMQzPArk3mnzP7K76SblpGivQ5nROosdv5xPXoGQ TdC5qbogP3023MJAGJ132k7wV4ohXz8tUA/5+XqwTa3XOBbA4rYzx6sgu3/mnK0d NllWKtpnOdnR9L+iE7h8nNjlVpFWoxKMjhC+6Fj8cmBXjOUd+g== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vkmjc2872-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 14 Jan 2024 23:45:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40ENj6Ef019174 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 14 Jan 2024 23:45:06 GMT Received: from hu-bcain-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sun, 14 Jan 2024 15:45:05 -0800 From: Brian Cain To: CC: , , , , , , Subject: [PATCH] Reduce scope of def_regnum, remove dead assignment Date: Sun, 14 Jan 2024 15:44:53 -0800 Message-ID: <20240114234453.4114587-1-bcain@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: bJJEcwDofUmrmzJ1toGUnTpEW5GDNxf7 X-Proofpoint-ORIG-GUID: bJJEcwDofUmrmzJ1toGUnTpEW5GDNxf7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 mlxlogscore=457 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401140186 Received-SPF: pass client-ip=205.220.168.131; envelope-from=bcain@quicinc.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is intended to address a coverity finding: CID 1527408. Signed-off-by: Brian Cain Reviewed-by: Matheus Tavares Bernardino --- target/hexagon/mmvec/decode_ext_mmvec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hexagon/mmvec/decode_ext_mmvec.c b/target/hexagon/mmvec/decode_ext_mmvec.c index 174eb3b78b..202d84c7c0 100644 --- a/target/hexagon/mmvec/decode_ext_mmvec.c +++ b/target/hexagon/mmvec/decode_ext_mmvec.c @@ -33,7 +33,6 @@ check_new_value(Packet *pkt) const char *dststr = NULL; uint16_t def_opcode; char letter; - int def_regnum; for (i = 1; i < pkt->num_insns; i++) { uint16_t use_opcode = pkt->insn[i].opcode; @@ -78,7 +77,6 @@ check_new_value(Packet *pkt) } } if ((dststr == NULL) && GET_ATTRIB(def_opcode, A_CVI_GATHER)) { - def_regnum = 0; pkt->insn[i].regno[use_regidx] = def_oreg; pkt->insn[i].new_value_producer_slot = pkt->insn[def_idx].slot; } else { @@ -86,7 +84,7 @@ check_new_value(Packet *pkt) /* still not there, we have a bad packet */ g_assert_not_reached(); } - def_regnum = pkt->insn[def_idx].regno[dststr - reginfo]; + int def_regnum = pkt->insn[def_idx].regno[dststr - reginfo]; /* Now patch up the consumer with the register number */ pkt->insn[i].regno[use_regidx] = def_regnum ^ def_oreg; /* special case for (Vx,Vy) */