From patchwork Wed Mar 27 04:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13605555 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65309CD11DD for ; Wed, 27 Mar 2024 04:51:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B3F76B00A3; Wed, 27 Mar 2024 00:51:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 166AC6B00A4; Wed, 27 Mar 2024 00:51:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F20166B00A5; Wed, 27 Mar 2024 00:51:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D5A616B00A3 for ; Wed, 27 Mar 2024 00:51:01 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B76B91604BF for ; Wed, 27 Mar 2024 04:51:01 +0000 (UTC) X-FDA: 81941594322.02.CF0EE66 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) by imf26.hostedemail.com (Postfix) with ESMTP id 059D0140011 for ; Wed, 27 Mar 2024 04:50:59 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=sifive.com header.s=google header.b="V/E56ar9"; spf=pass (imf26.hostedemail.com: domain of samuel.holland@sifive.com designates 209.85.161.53 as permitted sender) smtp.mailfrom=samuel.holland@sifive.com; dmarc=pass (policy=reject) header.from=sifive.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711515060; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; b=IZSn08tZn/nqXYbHB48w2c6c9UyaI7punNATcqUDuyeBP66WmtGrOLpc27pndO47lUp0bP k6u935odLlXLNimVAGf/9rojwy0A8LL/Ci5Tep56cxsvqaVMoyJygtjpIrNLKJ1W+EGxzb 1YxdRtI7Y/P03p6cRXGP19mX+GWEPic= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711515060; a=rsa-sha256; cv=none; b=ioEgNYtQYjdR1Wxle9lKjJCDyswIu6Tw4+RLhX0K4l6lqpqD26fIS+7jknXkF3cFv55qra uPFUDT/cmeAuzQ00PyXbyRAlMjGa+uqdw9Jifx9mqpKG+kXU4Mm+ebELZ06EWet71Cd7y9 drVkDm6s90O9yRSuCBHOMuA/qqAwTDY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=sifive.com header.s=google header.b="V/E56ar9"; spf=pass (imf26.hostedemail.com: domain of samuel.holland@sifive.com designates 209.85.161.53 as permitted sender) smtp.mailfrom=samuel.holland@sifive.com; dmarc=pass (policy=reject) header.from=sifive.com Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-5a4f608432bso3402264eaf.2 for ; Tue, 26 Mar 2024 21:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1711515059; x=1712119859; darn=kvack.org; 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=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; b=V/E56ar98qUUlViAtm8vQI3s/LcuVvYoAqwzyDlV31Ykb+nykT0zGbW6plsNWh00C+ MfGpu4dZfHhj7+19ghRkAIIK/JLY16ILE9aF+YEO1oXQ3eQwGk/hiUTPqmk/+VDeZwoq evRDeFXNnEpVDm5mQ8D5r/I79wAIkEqXdwExz87k9+eFyYDog0c382mR5Jp4CdJCo4gX Do6om8Kneq3ITL2HxinLDORIVeg4NYDNS5y6Ql6FkNc88GbVPwmFfqNjSNKApSA+uJ87 5Tsd/cA5kVbB1YHhrigpJx6n/e93hoRfiCktjP+mRXWpPxADagW+lgvrVcV6jFaxWV6i GRTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711515059; x=1712119859; 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=4wFLc5gcnBs285NRnicKVmmQVV53EnA/2rANcUM2uCA=; b=E10/ZaqwewNl7mfB53qRfXj1jUWOSFJY0u9cfT5DuxBFJPyNioB+VrUq52tSgXDDAT ymoDXN6gZeZF/OxkySBD88p3MAtuk9D3Y0EaB2RVjAzlxNacJH8FDk2eocsyUF13/KCf U/h3tE52d77EiphZNm/1/ZXZwiCIiXVxm7YzGg62RkITrUDaeRv9OvCqOqwlux1j+PFP ykup073jYx0ujlfTaiQCfKIJvc56qIPY7eurzmdxRqIAnx5NdpAiekLckw6z37YUCBG1 aB/nzVvd/DXLl6el9mDacj5lVc5XQg9G9eqbcZSpQsh1uOSIbP7YxmpqRwF9Lvf7WnjY eLcw== X-Forwarded-Encrypted: i=1; AJvYcCV383Po3ZDi+B3egVjeMULClPVG3MbjiIDzG+W9nCgoEcQrS94RpDgOHoFOlDTMdOgjMav0RtBMBIDisSAO0BBNbKk= X-Gm-Message-State: AOJu0YyS2UqgHJgfhUJUCZvBXlE8CAGSm9IhldVb1v88TDN3RIZmSsUo DTsSa6cm9B7jb4uAicS0EKY9APu8bbaLLjA6JeFuo9uSmZA5F2cOK3UflxFC52M= X-Google-Smtp-Source: AGHT+IFmC6K+A8yipt+L5BT3VYhAZMjFopo36khv4UzVVH+BHr/EbytiKBlOS5fSbYkXOITYtqGpvA== X-Received: by 2002:a05:6358:320c:b0:17e:bb52:927f with SMTP id a12-20020a056358320c00b0017ebb52927fmr1922247rwe.1.1711515059146; Tue, 26 Mar 2024 21:50:59 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id e31-20020a63501f000000b005e4666261besm8351500pgb.50.2024.03.26.21.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 21:50:58 -0700 (PDT) From: Samuel Holland To: Palmer Dabbelt , linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexandre Ghiti , Jisheng Zhang , Yunhui Cui , Samuel Holland Subject: [PATCH v6 11/13] riscv: mm: Make asid_bits a local variable Date: Tue, 26 Mar 2024 21:49:52 -0700 Message-ID: <20240327045035.368512-12-samuel.holland@sifive.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240327045035.368512-1-samuel.holland@sifive.com> References: <20240327045035.368512-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 059D0140011 X-Rspam-User: X-Stat-Signature: jigw3y9y1nbryzt8en9codtixbtiume6 X-Rspamd-Server: rspam03 X-HE-Tag: 1711515059-731061 X-HE-Meta: U2FsdGVkX199j1I343cMA7WGxv1nf33gRNLuiS4amJAkYUw7SqMsOkUQ7ZJdOzGJKNZHyOMgYjbm/qaouVmBVh0/arJxjwstpu3lZ0KzRPoAVzj8qnIZ/0SGoEkvMYlnzYavzDK7ueoUO9rXvIxBozoASsZWEDjF8untQcDTyGWUs4jX5Cc35CMNxAd0PfuqAwXmuh5JSzbER5oaEsmcuCfB/IeJVlsDbxZA/qH72srArPA6zn/UcCGDTE6fWtfc/icFgiccmYY++Mk0fw/lvOoktk4Ave/iXwxiN1K+J9IdieB2UeQmWBRam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jsfnypP6IUZmDpofxW4SeSUvUK96qV+GvFitwDJW0EDkGs57PvO0wpTukmlacVfAOnW+hWI3qxXdZToMIzXu1vQQEdA2H5N+VhmUO1Rw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000134, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This variable is only used inside asids_init(). Reviewed-by: Alexandre Ghiti Signed-off-by: Samuel Holland --- (no changes since v1) arch/riscv/mm/context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index 5315af06cd4d..0bf6d0070a14 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -20,7 +20,6 @@ DEFINE_STATIC_KEY_FALSE(use_asid_allocator); -static unsigned long asid_bits; static unsigned long num_asids; static atomic_long_t current_version; @@ -226,7 +225,7 @@ static inline void set_mm(struct mm_struct *prev, static int __init asids_init(void) { - unsigned long old; + unsigned long asid_bits, old; /* Figure-out number of ASID bits in HW */ old = csr_read(CSR_SATP);