Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5582517img; Wed, 27 Mar 2019 11:07:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIZteIHF4WIsfK+p9UDBjrkmfhk5MaJp9HivLfzdW/vzRoZ4FoTxLcsU1CWpMFI/lkwBZi X-Received: by 2002:a17:902:2848:: with SMTP id e66mr39123794plb.181.1553710039985; Wed, 27 Mar 2019 11:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710039; cv=none; d=google.com; s=arc-20160816; b=tB4AV6fpHjFLTzsVD5UNi+lsZEvCXAHcJsi6DYxQysEJp5fLNvetpbuHypiaZ9c4UK 4nb60vS8mSOGMalpAQ0onlnhpHD4sQR05hL6vfrIjwcMnbUvn/PvchKjXyahl41OajOA ihmU2ACLgc9SGLw4d6us6fopShPTnmIxGd2VN8hmDDt0FIcycr7yZJUsTKetsEl4DVuK po9YB2UhzNr/IdA+Y6dDAcacUtgnTXJI847039dSFJmyFNct/42TWcYXIor+Ltu19mN/ RDF4lByzxK5G5+9MFooT1Oyz5D9utoQ/aIkQkPC9S9Oep6nrxInLQ88K+hvwYYGJML6o +3vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W5Gx+iH7KGwPMdA5BlDHDXa/AB5jxlf8R92idXa1twM=; b=MAzwbP76Q2EQJOxveG5G5AZEFhQgb4zvweFPZrE7IX23OSWCLiDkV5iGZh/zZA6zWF QOb2L+SwPpz4Xf4yxE2ZZH72CT7XJQiriMs0JDGJ+T3UY52Nrnbyjav80qdD3KdYy7Kp b5yxhe39mrJat5v4Ff/vVG+hgc0NDEVrrPIrcoS0aAihJKv+ZHh1KHXtH1cLAuk9UADn tuWBrVN1xRmS9OWgcERuDcxlPVK+zDSIjklD42yUH036QuKyiqdNieksRJyekSsYD6Zi geShMxxHX2/9rAl7WZWfRTpxAsh8i754Ypcc0V4y2fqdP6E27B11ctV2suXGtmK9RtnE BiFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kHmygAqs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60si21216752plf.122.2019.03.27.11.07.04; Wed, 27 Mar 2019 11:07:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kHmygAqs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733280AbfC0SEb (ORCPT + 99 others); Wed, 27 Mar 2019 14:04:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:45174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733266AbfC0SE3 (ORCPT ); Wed, 27 Mar 2019 14:04:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA87121734; Wed, 27 Mar 2019 18:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709868; bh=MZB3QHZIQZ81aY5ro+0DEani9OJGE+4Jsl/jlOkcpLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHmygAqsB3gQft2S2fbhvGiAoZ/wzrE0Ywc558rAjgDLt2aaHEZAcRTvPd21kmi6i 00SFZk9WcRj9C5z4LFOYbgLfsHIh3cYG3up6cu+iTMKYEcC/MIpjFjrYGDzitn8rRa OKowAz17GqGro/WtGX8WbwdztReyxxIv8VfHju94= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.0 080/262] powerpc/xmon: Fix opcode being uninitialized in print_insn_powerpc Date: Wed, 27 Mar 2019 13:58:55 -0400 Message-Id: <20190327180158.10245-80-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit e7140639b1de65bba435a6bd772d134901141f86 ] When building with -Wsometimes-uninitialized, Clang warns: arch/powerpc/xmon/ppc-dis.c:157:7: warning: variable 'opcode' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (cpu_has_feature(CPU_FTRS_POWER9)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/xmon/ppc-dis.c:167:7: note: uninitialized use occurs here if (opcode == NULL) ^~~~~~ arch/powerpc/xmon/ppc-dis.c:157:3: note: remove the 'if' if its condition is always true if (cpu_has_feature(CPU_FTRS_POWER9)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/xmon/ppc-dis.c:132:38: note: initialize the variable 'opcode' to silence this warning const struct powerpc_opcode *opcode; ^ = NULL 1 warning generated. This warning seems to make no sense on the surface because opcode is set to NULL right below this statement. However, there is a comma instead of semicolon to end the dialect assignment, meaning that the opcode assignment only happens in the if statement. Properly terminate that line so that Clang no longer warns. Fixes: 5b102782c7f4 ("powerpc/xmon: Enable disassembly files (compilation changes)") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/xmon/ppc-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c index 9deea5ee13f6..27f1e6415036 100644 --- a/arch/powerpc/xmon/ppc-dis.c +++ b/arch/powerpc/xmon/ppc-dis.c @@ -158,7 +158,7 @@ int print_insn_powerpc (unsigned long insn, unsigned long memaddr) dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_HTM | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 - | PPC_OPCODE_VSX | PPC_OPCODE_VSX3), + | PPC_OPCODE_VSX | PPC_OPCODE_VSX3); /* Get the major opcode of the insn. */ opcode = NULL; -- 2.19.1