From patchwork Sat Mar 4 18:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 9604227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2486B60414 for ; Sat, 4 Mar 2017 19:00:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B1DA2839C for ; Sat, 4 Mar 2017 19:00:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FA372844C; Sat, 4 Mar 2017 19:00:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8577B2839C for ; Sat, 4 Mar 2017 19:00:28 +0000 (UTC) Received: from localhost ([::1]:36303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckEup-0000Ub-8L for patchwork-qemu-devel@patchwork.kernel.org; Sat, 04 Mar 2017 14:00:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckErt-0006jw-CA for qemu-devel@nongnu.org; Sat, 04 Mar 2017 13:57:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckErq-0008A9-AF for qemu-devel@nongnu.org; Sat, 04 Mar 2017 13:57:25 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:35549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckErq-0008A1-6F for qemu-devel@nongnu.org; Sat, 04 Mar 2017 13:57:22 -0500 Received: by mail-qk0-x241.google.com with SMTP id n127so35021506qkf.2 for ; Sat, 04 Mar 2017 10:57:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+5B40VakQzH/npqj/ZH8G8pC+QMY2u8Mh7U71XsFK5Y=; b=ktfdAF4BPu02oHm8uviaTJdiHnaWh1RVs79ib3MzPE1f57NVql1FA/1xlVml1Spn68 a0ui/xcKdST6qSaONZp61EUBZ7PZTfi0DtEiF6JPKxcuBVM1EOQ/10TZCp/dVAwZIv9o QnxYmqTFns7E3fqAtH0dtfs9shOgPZ1FgJ8/6WnD0Ycagxt9kzww1HXvbx7+BHzbUX5m +uTy78khLivYn7RxFPPrMSBceojm5pCkJgpE8dMw3t4+lX513YJ2ka+K1IP78RIV0J5T 0TwDSBlfet1q3imG9Y8hNXi6YEKSgcs/2Hcfms9tPIh969fD6f5hoMRvIgmoG6jr4VRz x/Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+5B40VakQzH/npqj/ZH8G8pC+QMY2u8Mh7U71XsFK5Y=; b=KrLaoeqvqTYNFha2PqXeN7oE+UfbpHj8oZIbFyQ2YHmBPElozuvIdnxtS/edNjoFZf LUp8Vq+1r4JFrm85t/pY8E8Jt2y/TTwX3LTcJiik7UoEE8Seg11Ek+7e84MyfGu4WWWM rVmtXSWAbJCfGyZRRRgjeOY7F2D7xTxm2jUuuTEU87152g73SZg0amZifCQEC+OJ2G/A ZmLDrU53wS95E+XkyLvrZQx/pj5k8hIomot51az825+mvUSc7DnVfmtkx2dVdCc1x2Lm sZlwMjq5rNE10x+qWNP8bVwLoeeekxS4fgmCtZGSUKxu7qGFOxm6N6xqYS3mVD4Xbp2+ 6l9Q== X-Gm-Message-State: AMke39nHHRE4rqfzmfbkwr9tyOfmalzWwWXMnm8GMZwID5GXg4z4J+TkR3+O7S31xBVnJg== X-Received: by 10.55.212.199 with SMTP id s68mr8629047qks.245.1488653841687; Sat, 04 Mar 2017 10:57:21 -0800 (PST) Received: from yoga.lan ([138.117.48.226]) by smtp.gmail.com with ESMTPSA id k8sm10048006qke.54.2017.03.04.10.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2017 10:57:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Aurelien Jarno , Yongbok Kim Date: Sat, 4 Mar 2017 15:56:48 -0300 Message-Id: <20170304185652.10675-2-f4bug@amsat.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170304185652.10675-1-f4bug@amsat.org> References: <20170304185652.10675-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 1/5] target-mips: fix compiler warnings (clang 5) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP static code analyzer complain: target/mips/helper.c:453:5: warning: Function call argument is an uninitialized value qemu_log_mask(CPU_LOG_MMU, ^~~~~~~~~~~~~~~~~~~~~~~~~~ 'physical' and 'prot' are uninitialized if 'ret' is not TLBRET_MATCH. Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yongbok Kim --- target/mips/helper.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/target/mips/helper.c b/target/mips/helper.c index d2e77958fd..e359ca3b44 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -450,10 +450,18 @@ int mips_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, access_type = ACCESS_INT; ret = get_physical_address(env, &physical, &prot, address, rw, access_type); - qemu_log_mask(CPU_LOG_MMU, - "%s address=%" VADDR_PRIx " ret %d physical " TARGET_FMT_plx - " prot %d\n", - __func__, address, ret, physical, prot); + switch (ret) { + case TLBRET_MATCH: + qemu_log_mask(CPU_LOG_MMU, + "%s address=%" VADDR_PRIx " physical " TARGET_FMT_plx + " prot %d\n", __func__, address, physical, prot); + break; + default: + qemu_log_mask(CPU_LOG_MMU, + "%s address=%" VADDR_PRIx " ret %d\n", __func__, address, + ret); + break; + } if (ret == TLBRET_MATCH) { tlb_set_page(cs, address & TARGET_PAGE_MASK, physical & TARGET_PAGE_MASK, prot | PAGE_EXEC,