From patchwork Mon Oct 30 09:31:50 2023 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: 739248 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c47:0:b0:32d:baff:b0ca with SMTP id n7csp1019479wrt; Mon, 30 Oct 2023 02:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy/7BImqAc0+n9bmcr5kbRkUV7DnXE04tzxfk1QeXzTWVn19pRceoIyrcwtUc8xwgvKbX7 X-Received: by 2002:a05:620a:9c9:b0:770:67e3:1fee with SMTP id y9-20020a05620a09c900b0077067e31feemr7737908qky.65.1698658373985; Mon, 30 Oct 2023 02:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698658373; cv=none; d=google.com; s=arc-20160816; b=ZOAJReakdVqV/kNTvrEM5JnhGWGiKNFBZl/UK537il7zTCawW1PRs6gOVHdbAyDkYg i/ChSfRMH72RC3PcDLOTnU0ycolkQZA6XifEORMv/mVLuM9FrdfZK1iEHaNZHOZ2h+HT LSwq6wJUxSMPuk4+dvP5qyxHjI9b6blQ1n/yfajRfjtRmTS1m/vormopr5sluHK0VblO 46xQDbeouSLhmos4iV/gA0KMeWfZnedCxDzPuyIlbFt5oS1E4osl3egyodbspVjwGbQs HjBiXtTlniB1h8Nq7/BDUHu494eZkg+mnyE128NggVNoBHkIQaTsFy9V3jCQHcPMndjB elKw== 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=RWD+Q1YVy6ObxkURlxo4Jv/GQ6fVH1MoEaeLTgb/P7k=; fh=pw9SLbDR0tlieQfxTxrdmy7WFdaKJRt0bANpXV4RKNU=; b=p6ucMGWy+wgvVuqS8SbbOS6cAuTny4V5rFTuTrWEAAnrI9WZnFe4YcpyilyFg5iCfX 1W5BwQqJ+UiwcDSLhbStZ+ZfFAXHENVewFthHMfCMju1V7DfnvXFZHjWhhUxINen8Ltn J9iNvrjtGV8QjZGOTwX/g9sHQ24HHj18yIGZ1kKg3fu7XkPaqL1w9iRNjpj5TF/wURaZ 15Q43qd61TcExA7iDwNkOkuolGAiiXZBWo+J91Yrs3i2+dBQrUve023rlTvGd6iq9Czp eo+X7wr2oVye4uCC3n8Pu/hPjq78HY7kHemubZXb4OYGXzHs3ssNCc+rxhEPThQV4Oru FozA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Et4PfBXf; 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 bq12-20020a05620a468c00b007765135d96asi5280415qkb.390.2023.10.30.02.32.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Oct 2023 02:32:53 -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=Et4PfBXf; 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 1qxOcz-00055S-M0; Mon, 30 Oct 2023 05:32:11 -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 1qxOcn-00053D-VL for qemu-devel@nongnu.org; Mon, 30 Oct 2023 05:31:59 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxOcl-00085f-T6 for qemu-devel@nongnu.org; Mon, 30 Oct 2023 05:31:57 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507bd64814fso5867995e87.1 for ; Mon, 30 Oct 2023 02:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698658313; x=1699263113; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RWD+Q1YVy6ObxkURlxo4Jv/GQ6fVH1MoEaeLTgb/P7k=; b=Et4PfBXfu0eoxKsaW1ShOQz2lwwRaZR1aq8tSj3jF5FGO1/Sb/idUz/C6q+DYNQOeW ojSLWet7C0sibU/7Sbe/iZe+x4HJx0pUiBr+HhfhHFk9pPUzwkWXtfkq9Z6IDCoB2Toj A6Dg2ZqHDR2ebt/4HYkyP+nO017MVPPPsuJ8oCx9zxEsX4qS3SK9BvqBgLPiNg0AkgN/ StR/FsuBVbfnuTpA/6yp+uYFfGbUHdiGR1yGI3s7LK6BUhtnJWc3xpt525zqjWcIqSZb CHY7rVlbnF9k4D8B/YAOKmbuz9BkvnXYAccgWvt7JS/9rwtuJQgZBXkGAGt7UZglcKgI aBuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698658313; x=1699263113; 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=RWD+Q1YVy6ObxkURlxo4Jv/GQ6fVH1MoEaeLTgb/P7k=; b=wvkBKGlHf5d8aEKAhhvcE7WlUDhC0jwffgvXizWgaycPtG601VR/QuuVTNMyQnCpi/ e9gBGV/0xEF083nzczFZyG3it2libAuKDqvliSO/6PFR1YNAKSzN1syNWE65gnwc3e/1 mHdm3Rl1q/midRd2nmVQrVW/8tH1+OzLRiY1idpSrn4t3trSEvlF2OiZqFyhcS+Ifq4Y eJQUB9hSgfiZlETyT/95FxhmfAIWl+kwaOfpFLofws13IHDmyKxtXJ8BNOGeeVXvnrP8 e/94Stu5CahS3LeeS7jBNohSfFD0el7ak03Ko+1o1dua3JWgXB9I96F8VhX8OcCzFN6n fLwA== X-Gm-Message-State: AOJu0YzDZN5oT8SlLKDj54VPh4Lku+tQxy+Mm7fP2qlTbBgwPsUYg784 a+GjjweIv7lOOBMgoIPBhL2UGYM3/3M3Th13hS0= X-Received: by 2002:a05:6512:3991:b0:507:b911:6706 with SMTP id j17-20020a056512399100b00507b9116706mr8252977lfu.25.1698658313425; Mon, 30 Oct 2023 02:31:53 -0700 (PDT) Received: from m1x-phil.lan ([176.170.212.50]) by smtp.gmail.com with ESMTPSA id m11-20020a05600c4f4b00b0040651505684sm8730647wmq.29.2023.10.30.02.31.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Oct 2023 02:31:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Richard Henderson , Ilya Leoshkevich , qemu-s390x@nongnu.org, David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH] target/s390x/cpu_models: Use 'first_cpu' in s390_get_feat_block() Date: Mon, 30 Oct 2023 10:31:50 +0100 Message-ID: <20231030093150.65297-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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 We already have a global 'first_cpu' variable storing a pointer to the first CPU, no need to use a static one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand --- target/s390x/cpu_models.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 4dead48650..540d445023 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -196,11 +196,7 @@ uint32_t s390_get_ibc_val(void) void s390_get_feat_block(S390FeatType type, uint8_t *data) { - static S390CPU *cpu; - - if (!cpu) { - cpu = S390_CPU(qemu_get_cpu(0)); - } + S390CPU *cpu = S390_CPU(first_cpu); if (!cpu || !cpu->model) { return;