From patchwork Thu Apr 6 15:37:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 670761 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp918889wrt; Thu, 6 Apr 2023 08:38:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZIjABJVtUi3346GM5Zlxg2tsGki0GsDFd8ItKf/14OyG7BsJmL++7YhgEaVBpK+eq9lBbN X-Received: by 2002:a05:622a:15c5:b0:3e6:35d9:2c23 with SMTP id d5-20020a05622a15c500b003e635d92c23mr12371292qty.58.1680795522029; Thu, 06 Apr 2023 08:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680795522; cv=none; d=google.com; s=arc-20160816; b=zh2xFpMPGhUJqmtRNmy0Io0w3h0YryTfSdgPnD9/M/Kv0hEQSc/C2s7Wd077/9MYK1 mBClyEqXgChHoJAau8JHY3xH5YGOuQQu7IoImLSgfTUUok++A1BM7UIa8BAhk2+IPrAw ovP3QqZ1lxc5hM3Q+yCbM0Takek7dsXhxsqMbtFUR2biAM8DRN+AFoDF5WpLvrjKrJi7 kVtLPJD0kB2+kHDBWKdtHgdxoMbp1KxhgBKWrTNvKx398wdSkA6ZUnJhqqvRwsrIl5s6 jg8eS0ItY7QQ9AOTiGis/2GeroEupBafjE/bjLJlSt4IlNBaPvf6yYy1HR9wgDx2GzFz mbaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=rDPB0Vrze01poFSd6DQd6uFNtL1bRE0xGzVa5dYm2B4=; b=s38nTvLUJ5/r5nUKGPXwGWNmwif0PM1QNma/tjEwPUVrHbVjyBwf2fKCYKhpBYkWXS 2Sf1rMrZShAGnRz1O+EqQyqyioHX6U4bBOfhLOLhrCYxgvA5/ejbG3H6/437dFs/1cwc 5/6efByJBGFkMemSPxe3phFvEbJ+/6KTmymKDJOPAFjRl7DvtwkLCvlqGkK2P6Hb3oyY dMzwyizABaXCmYMMZl2ER2m/dEsOLqNavnVm9jSQ3hFmmKAKNPZ0c9eDKUpuLEouYjl1 UcSImEEf52T1EIGIIdosbqdC7k+iPWj3FboKisM3kP7PmRk5Vc5AeGTGQ5UZxu58qtrc ufEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4SI3FBG; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s14-20020ac85cce000000b003dd3143c1absi1033404qta.751.2023.04.06.08.38.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Apr 2023 08:38:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=G4SI3FBG; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkRgF-0004Je-SY; Thu, 06 Apr 2023 11:37:49 -0400 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 1pkRg7-0004II-K0 for qemu-devel@nongnu.org; Thu, 06 Apr 2023 11:37:36 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkRg1-0003G0-1a for qemu-devel@nongnu.org; Thu, 06 Apr 2023 11:37:35 -0400 Received: by mail-wr1-x42d.google.com with SMTP id i9so39944454wrp.3 for ; Thu, 06 Apr 2023 08:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680795443; x=1683387443; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rDPB0Vrze01poFSd6DQd6uFNtL1bRE0xGzVa5dYm2B4=; b=G4SI3FBGs6ofYg2TWylLzqJKDdTPQ/yTOL8UkTvWHZmzY+tw75WvscXkMcOucwNx4Q CRSKWQjGN6ILxQPXty7o1jCXiXs8IMEYiEdKjttluHb0gQDGiECww65arQMPgW13GBZw oYl3BcIKqn3yv7h3oxid0HNV851g8Qs5YiM02tQ2lvW4b13MDsnVInXl/UjDB3EKBApm VTDo8U1BrJ1FpS151XHidYLPv29NQyil/DYwTsHGM4dAwUrr96BuTEpGQOvPPEOSZGK6 QWQXkQg9fzHXt/4aZYV/nt9NxgV62uel2Dnn+vHjmniqCkfu13wfI/1U0LobvbQDFnGB pY7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795443; x=1683387443; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rDPB0Vrze01poFSd6DQd6uFNtL1bRE0xGzVa5dYm2B4=; b=b+2yJtkZ4Te8hjxgSJKZkwNZPwRiBfyCBVxgyrRQqJzgziBQXzgHh7/fJHoRRTiAWN QM94gffrpY6QOd4EpVnTDpjITlF7JuekfEvGEmtNS0v99VUH9jJ9XDfKqOtxC5hMkDRS RrqZ8KSV5moDOi1ZUJKOcWAAbgfYiBgg3dpDgvIFXc4de52UQRzkjDZ67LClTRdGrkwY 7rgp6y5Q/9sVQmQfgsGr4dCHvxqMyJ+chYJlKlX90d4g0pFrhk8QDQNdCjyJKzeGey2L qeaam2j6I3HQAhKbqmPSUQlmwcwCZ1fD2YHBIlGMFdI7DrS/ad2yNUJENdjoW7HczG3H 26mQ== X-Gm-Message-State: AAQBX9cVTxP2DztsyVENG4AFXc9qwwPgnHT8Z9k1U6jGooAPUbL+STTS OcjsDmlnmgpN1e0QjmXfzht8cM6ut1znmVSNKdE= X-Received: by 2002:a5d:6145:0:b0:2ef:4bea:b032 with SMTP id y5-20020a5d6145000000b002ef4beab032mr1069244wrt.64.1680795443157; Thu, 06 Apr 2023 08:37:23 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id o18-20020a5d6712000000b002ef349e73cbsm1366226wru.19.2023.04.06.08.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:37:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jiaxun Yang Subject: [PATCH] hw/mips/malta: Fix minor dead code issue Date: Thu, 6 Apr 2023 16:37:21 +0100 Message-Id: <20230406153721.3349647-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Coverity points out (in CID 1508390) that write_bootloader has some dead code, where we assign to 'p' and then in the following line assign to it again. This happened as a result of the refactoring in commit cd5066f8618b. Fix the dead code by removing the 'void *v' variable entirely and instead adding a cast when calling bl_setup_gt64120_jump_kernel(), as we do at its other callsite in write_bootloader_nanomips(). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af9021316de..e3be2eea563 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -748,7 +748,6 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, uint64_t kernel_entry) { uint32_t *p; - void *v; /* Small bootloader */ p = (uint32_t *)base; @@ -785,9 +784,7 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, * */ - v = p; - bl_setup_gt64120_jump_kernel(&v, run_addr, kernel_entry); - p = v; + bl_setup_gt64120_jump_kernel((void **)&p, run_addr, kernel_entry); /* YAMON subroutines */ p = (uint32_t *) (base + 0x800);