Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9529C76196 for ; Thu, 23 Mar 2023 18:38:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6C5C85764; Thu, 23 Mar 2023 19:38:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="C7VwnrRr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 957C58576A; Thu, 23 Mar 2023 19:38:28 +0100 (CET) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 12A4485720 for ; Thu, 23 Mar 2023 19:38:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pf1-x42c.google.com with SMTP id s8so13742454pfk.5 for ; Thu, 23 Mar 2023 11:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679596704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SQgtghHdpk/rPsLMf64wSUxw0b2ro0mZZtdqmBwCW98=; b=C7VwnrRrD/Jaxt3Zq0IAPXdCCaGu8HGZee5WUDaHw/N9BZRhE5zwErj5+hn3tC6/FJ MWZPW4y9C/JkW4BO2lYpAwk/W1VyYYkQEKpDJ8TLyNmyQo8iOBhAsb/HshgYMPlJY5MY afg+C6Ha9OW7Qps+DSwndo+6XSwN0kdhLruDc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679596704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SQgtghHdpk/rPsLMf64wSUxw0b2ro0mZZtdqmBwCW98=; b=HdGd5LTqU1POJ0BLTOlWBBFt56EVOV3zsGkqB2qBCIxtOlRQjGMGJ2yS+MEXDWW3y6 XBiPO9QmAuna+j17XGnOYDe30O21NK1rhF1K4c8ggu7qiI/zq3Czw2kle3V4UDtwm+x9 2nC/A0SgaDW0oPj1jpiFCIcrSqVXW569vakRpfJpN9tS505e1IuA4ICdYo7EJPsN0YUi uYURWImyKxeP4OjvbYnecnMQW7plq/0939+PYKBc9fjXMjntPmLcBu23vI/iWDpUwuiq myOq32QE3G1ILX2xOi+5rcPE25voyrVcNAtA4Zr4oIuPAWvg3qD8S+pO7dfXYoIIFIFp B+cA== X-Gm-Message-State: AAQBX9eJRieXc27Nm4vV+ef8vU1hHQRJ9CG7QnbeqR88dNeHkeuUoa7b jDwoDpNtN1Xd5Ua9pROu1h5fBeIRPcJF5QfRBbk= X-Google-Smtp-Source: AKy350bDdYGvLu12K8JAnC1UOuMPfnz25GvS0zVwb3gtrrRG3JsWNXBGq0XTDK+1vuQeaTbU/xZ8UA== X-Received: by 2002:aa7:971c:0:b0:625:7acb:bf0e with SMTP id a28-20020aa7971c000000b006257acbbf0emr303327pfg.19.1679596704209; Thu, 23 Mar 2023 11:38:24 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id c18-20020a62e812000000b006227c3d5e29sm12733029pfi.16.2023.03.23.11.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 11:38:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 01/16] mtrr: Don't show an invalid CPU number Date: Fri, 24 Mar 2023 07:31:42 +1300 Message-Id: <20230323183157.1520223-2-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230323183157.1520223-1-sjg@chromium.org> References: <20230323183157.1520223-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When U-Boot did not do the MP init, we don't get an actual CPU number here. Skip printing it in that case. Signed-off-by: Simon Glass --- Changes in v2: - Don't show an invalid CPU number on error cmd/x86/mtrr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c index b213a942fde4..ff4be6b7bf5b 100644 --- a/cmd/x86/mtrr.c +++ b/cmd/x86/mtrr.c @@ -145,10 +145,12 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc, for (; i >= 0; i = mp_next_cpu(cpu_select, i)) { if (!first) printf("\n"); - printf("CPU %d:\n", i); + if (i < MP_SELECT_ALL) + printf("CPU %d:\n", i); ret = do_mtrr_list(reg_count, i); if (ret) { - printf("Failed to read CPU %d (err=%d)\n", i, + printf("Failed to read CPU %s (err=%d)\n", + i < MP_SELECT_ALL ? simple_itoa(i) : "", ret); return CMD_RET_FAILURE; } -- 2.40.0.348.gf938b09366-goog