From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4C681CACE5 for ; Tue, 15 Oct 2024 19:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019430; cv=none; b=F7dQxVZK/3HnLOKffiakvwWWH0x0H8YG/YNWoxtTqJurgk8MQ9ZMuiBPkUdZn+/H+Lq33cBuTbiDFEz7QZMR3yw4bWjLdsiJvWZh7qqQso9S4Atn1QVCbnzpkNVIkapH2HhLf0hGsbQHCOS/6MDwMpbJ+rsAg1w+rcICuDqanu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019430; c=relaxed/simple; bh=RGN6xJBub6siG5dh9zPouMtM5TtvJmzA74YPri9Ychw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JZt4ktpxdOqMJmivNEGTqLH2UJD0JJS4VpcIeXvd0lOSXiVLlxMjtPfTJ3ttcVT/vgZNbb3qD4qDi0wNbvzepSxMgMCdvdraCsnnG/f5gp03VkWa5GemTuJYk+YhW3+t7IDMLIlFwv2lY2lkNXrwvQ0aji/6d2hb4exYLTTFBfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=17C437Oj; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="17C437Oj" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFb0ZrQzlgMVy; Tue, 15 Oct 2024 19:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019423; x=1731611424; bh=Euw5p 48mmCF3tyeddZlOyjeu2JGIv4T0JCbtH3vU/TI=; b=17C437Oj0oPhsrNgMEM0Y lWi3mlVyuA026iN+Ri6wuw0o6pHkhe6Po4gI7qbjqUReV0VtqEiZG0UAQIUen8pm vd8j2CrUf37drz2O11GzBdhpKTkHOK+UHrTgAxRPz7SzHP+zz4GTOF+wMNIqU4h/ /hAd0Boom8OQrAcDsprFHKgTkSqa4TUoXCi4GmzCixxE5fO+IgP1sIZMlQm0qiS5 fsOzcQ5zYfH2GmdfvASbCvgAAx56ZKaqlN4YzwKeBFmqTKN2P/4ckJBLttP0ISzo GwkJZaweIb25b/D1kd8jDBJTFFQ5p9JzNFPCBVx6kmtR+Vf6Sbe/Y6go8EqhlBOM g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 2nJppFLqZ9dS; Tue, 15 Oct 2024 19:10:23 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFW1WVHzlgMVs; Tue, 15 Oct 2024 19:10:23 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 01/22] genirq: Introduce irq_get_nr_irqs() and irq_set_nr_irqs() Date: Tue, 15 Oct 2024 12:09:32 -0700 Message-ID: <20241015190953.1266194-2-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. This will prevent accidental changes of assignments to a local variable 'nr_irqs' into assignments to the global 'nr_irqs' variable. Suppose that a patch would be submitted for review that removes a declaration of a local variable with the name 'nr_irqs' and that that patch does not remove all assignments to that local variable. Such a patch converts an assignment to a local variable into an assignment into a global variable. If the 'nr_irqs' assignment is more than three lines away from other changes, the assignment won't be included in the diff context lines and hence won't be visible without inspecting the modified file. With this patch series applied, such accidental conversions from assignments to a local variable into an assignment to a global variable are converted into a compilation error. Signed-off-by: Bart Van Assche --- include/linux/irqnr.h | 2 ++ kernel/irq/irqdesc.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 3496baa0b07f..7419b807b71b 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h @@ -6,6 +6,8 @@ =20 =20 extern int nr_irqs; +unsigned int irq_get_nr_irqs(void) __pure; +unsigned int irq_set_nr_irqs(unsigned int nr); extern struct irq_desc *irq_to_desc(unsigned int irq); unsigned int irq_get_next_irq(unsigned int offset); =20 diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 1dee88ba0ae4..b0733959f8ae 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -141,6 +141,29 @@ static void desc_set_defaults(unsigned int irq, struct= irq_desc *desc, int node, int nr_irqs =3D NR_IRQS; EXPORT_SYMBOL_GPL(nr_irqs); =20 +/** + * irq_get_nr_irqs() - Number of interrupts supported by the system. + */ +unsigned int irq_get_nr_irqs(void) +{ + return nr_irqs; +} +EXPORT_SYMBOL_GPL(irq_get_nr_irqs); + +/** + * irq_set_nr_irqs() - Set the number of interrupts supported by the syste= m. + * @nr: New number of interrupts. + * + * Return: @nr. + */ +unsigned int irq_set_nr_irqs(unsigned int nr) +{ + nr_irqs =3D nr; + + return nr; +} +EXPORT_SYMBOL_GPL(irq_set_nr_irqs); + static DEFINE_MUTEX(sparse_irq_lock); static struct maple_tree sparse_irqs =3D MTREE_INIT_EXT(sparse_irqs, MT_FLAGS_ALLOC_RANGE | From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0DDD189510 for ; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019431; cv=none; b=IoyD9FEqNKHM3mGWT2LbjnadBdx7oO84GZzMya/AC+TQ+yo4VJ+iKWXOD+Zllf8Vr+N53sgfulrgPdi/vg5P/hT1Cf/vjpYCrzJo7vOnrM65KvWpYM863CF+gFySqIkpNtq2bhX6uG3ureOrg88AKvcbHLuUAMhNF7A8X7K9Ml4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019431; c=relaxed/simple; bh=bQUB7pynh9jjkq7C2QfJNutdv3zPU7p53lT366Klq5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LHq16SuUs+kUlgWMx0sOTKFun6qmaxebz5JPGLOAjbHVSudp+bxflHxB8UUDM+LC9uApoQFtLl2Cz9aUOBtXjEUn5PcjED2ywdKHJC9yLGtCfYC9/iOXfFHzaumH7fJxrkfPR0x4i/sQe51qu0T7bPVwBTYKrWKcrX++kPTwWuE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=YOApN+Xd; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="YOApN+Xd" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFd200qzlgMW1; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019427; x=1731611428; bh=a8VVy ORugI65pZgJ4lsYDnzdi/YfbW579d1FONGibXE=; b=YOApN+Xd6ORuRC4Obgx59 zwffsbNNCOIBNH7tcD/DmSac8Ds+a0YEs8P7pmnYOXtHfTstw9dXyi7jgLioaraO x6uvel8TDyOqIDPwqjc847jEjb2/nl079jF1Y0wSae6Pnxqzaz1AlFx8qgdjZpbA VA4ec0bDQUnW8wjXaiVPvgrDVNn3DdrA+NMidzu2ZyOuCysy1YhnL59rfq5G1hWT D4oIpIZirDvbh3jbVqZJ0f0ybr89UjibKtM1BBEaAosBXSWvAN3BtQi1sMDmBD5y dsBTr3yc7KypmuIBksbiqT5Mev4YHktWYtQ/vS+y6DCLrSICmwjOKxezjRjG+VX3 A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id uWXsc0yOTolb; Tue, 15 Oct 2024 19:10:27 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFX1wmgzlgMVv; Tue, 15 Oct 2024 19:10:23 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 02/22] ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs() Date: Tue, 15 Oct 2024 12:09:33 -0700 Message-ID: <20241015190953.1266194-3-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() and irq_set_nr_irqs() functions instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Russell King Signed-off-by: Bart Van Assche --- arch/arm/kernel/irq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index dab42d066d06..e1993e28a9ec 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -111,7 +111,7 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs) * Some hardware gives randomly wrong interrupts. Rather * than crashing, do something sensible. */ - if (unlikely(!irq || irq >=3D nr_irqs)) + if (unlikely(!irq || irq >=3D irq_get_nr_irqs())) desc =3D NULL; else desc =3D irq_to_desc(irq); @@ -151,7 +151,6 @@ void __init init_IRQ(void) #ifdef CONFIG_SPARSE_IRQ int __init arch_probe_nr_irqs(void) { - nr_irqs =3D machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS; - return nr_irqs; + return irq_set_nr_irqs(machine_desc->nr_irqs ? : NR_IRQS); } #endif From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DA721D5152 for ; Tue, 15 Oct 2024 19:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019433; cv=none; b=f3n+eK4OSPEN/wEjfoaZoG4yHvfp2KJqOx941jKaPCoDhThVRI8HbyV2eJyVagB++sXUEUhVN4ws8MsU2Vmz58MWH5buHCvd246AI12SWWGYcUXsA32R+vjvPKJ/oWU6eOzPjlcHPHcvYe0IGPqIAYAAMXysoP85sHEK5nPzgyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019433; c=relaxed/simple; bh=ncsbuhfar7TrtH8vlM2b163FxnUgkhbVMQn0EibzUj8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wqc7iUvNNJ/9sdDf0zxpH4afN1J0gY+kCvNNjzSOafNqlbZeJSJsJefph+AZNGtkEtgmXVEQyq9bgaAUYyeFnpla3osAJz0qtBJEq5snRalKMYy0f6ivtzlHyfwET0mpjjpAPThACkRPECbqVNS4nu6Ea3KMbCenY2sq/C6oBDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=WE2KIG2q; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="WE2KIG2q" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFd67QWzlgMVh; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019427; x=1731611428; bh=HRueg HGqgyJbW5wMoC2dhYR76II1xukR2pgXVbmRNMA=; b=WE2KIG2qyzKstueSZkW1B VhbwdIW3BHcyWbMnBTSiP/tIezw+OizUrLggkF2+bwYP0Ub+4sTgPEdHlvPZ2l/F NTGopZRstnINCoDvB56DqlcZT7sj9Lt8i5dozWWmLBj1k4CVW706oX+dmSzIJnBB 8RUdJZ3yHPpGIEodmMRh709yrgGAHcGf9GL5hVllbWBkoBYZ8BqXovZ7/hFc/ZZH UUYZjOjAJjBQsNXhGltWhSpuMIzblq/TRfxfivk/6tiPtZDhHyCb5GdhCnxR0Bbs 7dcSEPsF51wvJi+wnijm+hyLBE1sR0lqQkiWzbMsmnzQOJ0GGLv0QVycBcqMrELM A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id EpjFfHSLstae; Tue, 15 Oct 2024 19:10:27 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFY43fnzlgMVw; Tue, 15 Oct 2024 19:10:25 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Huacai Chen , WANG Xuerui Subject: [PATCH v3 03/22] LoongArch: Switch to irq_set_nr_irqs() Date: Tue, 15 Oct 2024 12:09:34 -0700 Message-ID: <20241015190953.1266194-4-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_set_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Huacai Chen Cc: WANG Xuerui Signed-off-by: Bart Van Assche --- arch/loongarch/kernel/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/kernel/irq.c b/arch/loongarch/kernel/irq.c index d129039b368b..80946cafaec1 100644 --- a/arch/loongarch/kernel/irq.c +++ b/arch/loongarch/kernel/irq.c @@ -92,9 +92,9 @@ int __init arch_probe_nr_irqs(void) int nr_io_pics =3D bitmap_weight(loongson_sysconf.cores_io_master, NR_CPU= S); =20 if (!cpu_has_avecint) - nr_irqs =3D (64 + NR_VECTORS * nr_io_pics); + irq_set_nr_irqs(64 + NR_VECTORS * nr_io_pics); else - nr_irqs =3D (64 + NR_VECTORS * (nr_cpu_ids + nr_io_pics)); + irq_set_nr_irqs(64 + NR_VECTORS * (nr_cpu_ids + nr_io_pics)); =20 return NR_IRQS_LEGACY; } From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FE9B1F76D6 for ; Tue, 15 Oct 2024 19:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019434; cv=none; b=MVSAKOpZcW5jmprCQvMJtskcqYKp+qpxtsugbrKiSXB6zVT8wzGCJF59m9J3Z7E96GPMr5IT7UMa/qoY8/mw5+SM0m37uHHZGCuNvohK7x9aycr9rQ9jdF2GrsqdmOAouQURi48eIOd82ZEYYHilYngG1qAB1sWwfSdvyixWnQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019434; c=relaxed/simple; bh=zTPehKPiGJ8uc8eamsF4ApdZreywLo9KjOVlaMT8zCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HjfxcHns03vX2z/Ynp4k5fDJkOui4M+1nGTGU8PR8HhRsj4FBGQYitcfbZODiooNMT49SssmjWyRZd6saO9dq2zAsfTE+h2rEhRmSCYcQZaV4nf75IA1MvTtecr6B0rQyq1UHFWZfTIm56FrTxC2iX/cK5UsZXy+GlCLXxMLQxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=TvHB2qpI; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="TvHB2qpI" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFg2N9YzlgMW3; Tue, 15 Oct 2024 19:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019429; x=1731611430; bh=LlbN8 fEKFiaYt76DPdWX+8dI6iXGCc0rnW7U7UW4744=; b=TvHB2qpIFY3or6zxqZVm5 AIgtvaupXyI21cowk5v2WrBlRXGTsCK2nFuNfZgcA9uQp46LiQHGCQAmZNRaayo7 RqjOz/5gXuZ/KaFyBKTKQePQJl6SUBN3faqZGUXgWbpV4L+yBBFCVp5tPRF0uU5S 47o/HsFx0aWSqxJVcjYS6Ki7G0osoNdMaYiuo97rPXLpErG34792txxzeFrK1Kk7 hJiGQnHEencfzvDbh5pBaX/aTWvXxjg469DfK9Ub3d6zkFy+H+oL/1sR+S173A6V oYcTnTwwLr01fwJ/hp7rQJ8YcTPLOhcsVE56uQzGRcQht9JgQKok5jDZz9Pjhmyc g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 4r7H_nvKU7k8; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFZ6XhLzlgMVx; Tue, 15 Oct 2024 19:10:26 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 04/22] powerpc/cell: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:35 -0700 Message-ID: <20241015190953.1266194-5-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Bart Van Assche Acked-by: Michael Ellerman (powerpc) --- arch/powerpc/platforms/cell/axon_msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platform= s/cell/axon_msi.c index 28dc86744cac..d243f7fd8982 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -112,7 +112,7 @@ static void axon_msi_cascade(struct irq_desc *desc) pr_devel("axon_msi: woff %x roff %x msi %x\n", write_offset, msic->read_offset, msi); =20 - if (msi < nr_irqs && irq_get_chip_data(msi) =3D=3D msic) { + if (msi < irq_get_nr_irqs() && irq_get_chip_data(msi) =3D=3D msic) { generic_handle_irq(msi); msic->fifo_virt[idx] =3D cpu_to_le32(0xffffffff); } else { From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 208AD1F8198 for ; Tue, 15 Oct 2024 19:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019435; cv=none; b=jZZ3iGHopyevOt4grXXfuGHraYBSQ8IK36knYjzck+nIsiSHe9Zu0HyNZDBlaxzNCIvnZ2baP4FBnQ464aVZzacqM1Qxu3JBXopPoDgXlO1/zEwhnluDFCrGqgOLC0J9nIZ8S/eGrjkHacPyCzOz/nNOoOVF9smA1qMfVLuFUTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019435; c=relaxed/simple; bh=hdl7P3518Wa8B2pH+sfzuuxEBq3wpRU5CNH/4ln+ta0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DzyMVuQH7PRcrzAIhQEMr0yp/radG/dI4HrpEaPR/NXXYXSdMAAqw5ZVWxDhgpbabuv9g2kvm5RNpBdQsOUjT6IdQOixmHuBElkCVvVTPKAO6IUcgWRrryY4yZ4B3uPciZtE7RlWx5Iut7+173yngX3gnv24ohuBaQ93ex1Eu7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=YZjQMa5c; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="YZjQMa5c" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFh2D6rzlgMVx; Tue, 15 Oct 2024 19:10:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019429; x=1731611430; bh=E4Yda 0E0N/XZhjJiXkfg+hITaLxsQBgMMyd1Qzy18BY=; b=YZjQMa5cOdMJBezhcaOMe +ciEIpmbjc3T6GAxdNXNaZHHc2kiTI9GI1BjQ0ExmyDh8vLlWsOl45a1JJXyUJMq VxqJjOK9zKZqMzZJALRGxx78KRxvb+IcIRX5sOtmxMSPBh5UIvryiOgO7t9K6nxQ eZgv4EiP7iKoQY2V88qffOFW1AujYMiBKfRBVSs+jUdBHADD0LFQ12QSZ7xHm/W6 1KK+l10W5O/qTO47pFMnWFdW6s3PGnvisP8YZVoawMO/nrgqZsevUPo/UfOpWoFl vfHo3Zv3IPWF/K234T83BV8rtKXZ4kD7AI99fRz8WnsTH2p+fvDOP+wRCeX8LiZu Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id Gfc0b7DyCtZU; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFb6QB3zlgMVs; Tue, 15 Oct 2024 19:10:27 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Heiko Carstens Subject: [PATCH v3 05/22] s390/irq: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:36 -0700 Message-ID: <20241015190953.1266194-6-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Heiko Carstens Signed-off-by: Bart Van Assche --- arch/s390/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 2639a3d12736..a2c867181b5a 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -253,7 +253,7 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); goto out; } - if (index < nr_irqs) { + if (index < irq_get_nr_irqs()) { show_msi_interrupt(p, index); goto out; } From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBF7A1F81BE for ; Tue, 15 Oct 2024 19:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019437; cv=none; b=g5iXDbQvQGlx4PcXoMWhgfXMIb5oO08WMpZvJt8HaHm1/REjjxA8q44YLF+SPiDRvGB4BqYAhLNarnsyZcyC8a3gaAiF2On+870Z0+GAOt21zsk8B5NdrqjaVrxQu/BOYw9MWBw+L3hF822tc+CZYkEHBmkawziKtyZ3YW5ihSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019437; c=relaxed/simple; bh=G4rSFhV8V5M5z8r1yfy2hhDROYLKbS5fa5Y8orG4SRA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DKIJ6jJ4z1agOjp0dZvHBJvy7Fq1Y2rOcV9slS2TQhIyZGRLyRrHIhzMcub2YrtnuH1hX8C50zje8YoFjIeC+yqSvY33/E9HWU3KQlcv8PV+f7r5nKF4uBMS7vgvijCCyQDoqDk0dg/gDSHQ7lq6/pVfSkPC18EZkorbyu+k5yk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=XPZrGfRQ; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="XPZrGfRQ" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFk3TkRzlgMW5; Tue, 15 Oct 2024 19:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019429; x=1731611430; bh=kllgx Ol6bQ8oQUVdCzWxpp2VorZwc4sp4dvRdCTY4pU=; b=XPZrGfRQ6KRswZIKA3R1d mqhol+v1I4+YqWqzIKuwruPhtAT+ntMkQ+sGkukceMmsLF2vCcQVQvQGZS3F3717 TmR5nswC1eeqxixk+7LE1WCYzHIA7lfbjYSbK4fUt+sFa9PADs7YMw6kFkUxkDj5 4+VOjShcXpb29zTVO5VS1DBaKkWqOfQ/PMWlnGhmo93eWERAHhv1Qcqpc/ZniDzK jGh6ir8PErPbfYPzM2F63cb5KoekR4eVc1bfCDNjFFzLlTOeOazdLtg5CvxJj+Ek XJq5CsXdjLsGu/n848+kaHvrpnVEjkKNypePK0v8PGl4UkF3S/C2haBHT6z/aQKt A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id bgf1qY-tN5Ox; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFc5LNzzlgMW0; Tue, 15 Oct 2024 19:10:28 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Ingo Molnar , Borislav Petkov , "Rafael J. Wysocki" Subject: [PATCH v3 06/22] x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs() Date: Tue, 15 Oct 2024 12:09:37 -0700 Message-ID: <20241015190953.1266194-7-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() and irq_set_nr_irqs() functions instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Ingo Molnar Cc: Borislav Petkov Cc: Rafael J. Wysocki Signed-off-by: Bart Van Assche --- arch/x86/kernel/acpi/boot.c | 6 ++++-- arch/x86/kernel/apic/vector.c | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 4efecac49863..3a44a9dc3fb7 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -1171,7 +1171,8 @@ static int __init acpi_parse_madt_ioapic_entries(void) } =20 count =3D acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, - acpi_parse_int_src_ovr, nr_irqs); + acpi_parse_int_src_ovr, + irq_get_nr_irqs()); if (count < 0) { pr_err("Error parsing interrupt source overrides entry\n"); /* TBD: Cleanup to allow fallback to MPS */ @@ -1191,7 +1192,8 @@ static int __init acpi_parse_madt_ioapic_entries(void) mp_config_acpi_legacy_irqs(); =20 count =3D acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, - acpi_parse_nmi_src, nr_irqs); + acpi_parse_nmi_src, + irq_get_nr_irqs()); if (count < 0) { pr_err("Error parsing NMI SRC entry\n"); /* TBD: Cleanup to allow fallback to MPS */ diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 557318145038..736f62812f5c 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -712,8 +712,8 @@ int __init arch_probe_nr_irqs(void) { int nr; =20 - if (nr_irqs > (NR_VECTORS * nr_cpu_ids)) - nr_irqs =3D NR_VECTORS * nr_cpu_ids; + if (irq_get_nr_irqs() > NR_VECTORS * nr_cpu_ids) + irq_set_nr_irqs(NR_VECTORS * nr_cpu_ids); =20 nr =3D (gsi_top + nr_legacy_irqs()) + 8 * nr_cpu_ids; #if defined(CONFIG_PCI_MSI) @@ -725,8 +725,8 @@ int __init arch_probe_nr_irqs(void) else nr +=3D gsi_top * 16; #endif - if (nr < nr_irqs) - nr_irqs =3D nr; + if (nr < irq_get_nr_irqs()) + irq_set_nr_irqs(nr); =20 /* * We don't know if PIC is present at this point so we need to do From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA31F1F81B3 for ; Tue, 15 Oct 2024 19:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019437; cv=none; b=BGqzxasxLjhbsaUk5VHaVLGq+xvcl0kdMKk45cmM2OOOtFsvUCvW01OzzfQ7uANpbcs48T5JjdV3yeQYIhFI3UF5ynqoAeuNaV3Xyh/io3nEIAGlM+kcEW2/Ij6ughn25i2mgrnvs8SBfBKcYYUBfvAXNTf4oaRx/vyUuxFmIFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019437; c=relaxed/simple; bh=LYtuUylPHKKH+GlJhGmuWNWP5jskJZLyFB9n0vNCuKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q4w05x7ACjKnxgzpRDPBhxyHbuJSLQgNdkJJh+9Nj/hAJUvjU/jU4CqBXCsdKsMsdiyg7CIULNRkX9ktIDhpk0Mi1jmaZ6IF/dwkV2vn2pk5zY1ffChfleTSx6Yb57BI0Q1nfcx8xZFD0g+vAHFiyUAq7wsPzDUfn/UlHzIPTzk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=rHhJwuK3; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="rHhJwuK3" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFh3jzpzlgMW4; Tue, 15 Oct 2024 19:10:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019430; x=1731611431; bh=pbtGB NBQZN396qyjoB0E5v4HeTkStlGxTWnWL8M0RdM=; b=rHhJwuK3P2N+6IGECCSCF yZVCY1WOC7UtrLa+Hlnbl3eHKREjM5xGk6lm9trykFgc6MAykscP3QiU9vWHucNo o+lC7dma7BfM9oFrwhphCrOaR5O9iJ130XfGinFBKnFx3Nvmqt5i/bwgjUG3r9qM T2TrVEj+gAgFMTCwNx2KjcMW8tQQ2RcjCYm+PzKv4YchJsVz5EJzPlrTNy0etbo7 DoGHjY+sZ6HNykMfu3CrHWsKzRVj8BHNW1QjCeBTfrXudNw6H0jhI+9cWUYt1Tpl tMUQQBjaqJgmx6wn98GjnZySYvsl2dqTHaWeCu47apyZGjkgnZJro2EcB+xb5eqB A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id HT5k7WwQuqqz; Tue, 15 Oct 2024 19:10:30 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFf0KHqzlgMW2; Tue, 15 Oct 2024 19:10:29 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Clemens Ladisch Subject: [PATCH v3 07/22] hpet: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:38 -0700 Message-ID: <20241015190953.1266194-8-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Clemens Ladisch Signed-off-by: Bart Van Assche --- drivers/char/hpet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index e904e476e49a..48fe96ab4649 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -162,6 +162,7 @@ static irqreturn_t hpet_interrupt(int irq, void *data) =20 static void hpet_timer_set_irq(struct hpet_dev *devp) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); unsigned long v; int irq, gsi; struct hpet_timer __iomem *timer; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE8B21FBF47 for ; Tue, 15 Oct 2024 19:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019439; cv=none; b=Iaz4qQvCDH/0wbrqn56Pt6qEp4isCqYkWALwhUCRw8elr/xHv2Cfie85qWxXXcQG814v6f6FTGSkjojU2E9gl7DDSaKGPODILyGZvVmklUX3P+RDLonoutzw39/OKVbhDSfpho2VGh1zFgQnIvqAzXrU7zotudSdaK6MilKa06k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019439; c=relaxed/simple; bh=UB2jBVWQDmVnfC2RkzsAIuhOdwX7jnVvXPKnj7NwtBw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t7yTWFwbWGEvUbVB0dyeLv7ua6Ncy8vRB4wXDIL2ZzfgLTbJsaEAeJLilhqGjalXDteJUuPkq94Hs6twn3RZFbVVMfcS2dbI+5bodlPiseURe/Eo8l1XcwtVAt7UniohLd/2Upd/glEwNGic98yhzpprlSNHgT+S1op3kXwXzUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=kYFecuAb; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="kYFecuAb" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFl0JmLzlgMW6; Tue, 15 Oct 2024 19:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019432; x=1731611433; bh=ZYBxu f5NupBJUX+GVfcekz7nBMciH3P4e+lYjt6FhM0=; b=kYFecuAbUnrd1FHkYqrNk XDtEQ5SuI4ZfhmnCNfAQkalJgKlCo/8RDEnKl7EQePK7hF74Z3DkV1MjUI4hzkd4 xch2bGESx5RovWUa17wFtCt+ySOhSAyZXjptDtR8i6ccP4V91W8c/Ux1LzIdhOIx NwuNt5I0eg2TCZmtvuaxHUW7R6LMLRvRWuTLDjq7Y9vDsTyobD/33SWiST+kX8M3 qTjySrqekrRY6D4OKAgfpzXM95O+frt/3hdDYFikTKHj+HYbgYn+aGiiCu4Gk6wA 649jKzaftcd5aSqeb2fcDu//ahF/Y31O1oNLhxVm1VuRRS6QY0b6TGW1rOc2LFEt Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id fmHpLwORTUMd; Tue, 15 Oct 2024 19:10:32 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFf61JVzlgMVw; Tue, 15 Oct 2024 19:10:30 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Steffen Klassert Subject: [PATCH v3 08/22] net: 3com: 3c59x: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:39 -0700 Message-ID: <20241015190953.1266194-9-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Steffen Klassert Signed-off-by: Bart Van Assche --- drivers/net/ethernet/3com/3c59x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/= 3c59x.c index 082388bb6169..790270912913 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c @@ -1302,7 +1302,7 @@ static int vortex_probe1(struct device *gendev, void = __iomem *ioaddr, int irq, if (print_info) pr_cont(", IRQ %d\n", dev->irq); /* Tell them about an invalid IRQ. */ - if (dev->irq <=3D 0 || dev->irq >=3D nr_irqs) + if (dev->irq <=3D 0 || dev->irq >=3D irq_get_nr_irqs()) pr_warn(" *** Warning: IRQ %d is unlikely to work! ***\n", dev->irq); =20 From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18B941FBF55 for ; Tue, 15 Oct 2024 19:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019439; cv=none; b=lnbdS5XdxPJLdTbh7NgVsls1ZDPKCSkZhfdQlwpQ3Dx4pwHyc7FrPOm8Yj9lrUX5UUIiM/kD6vZDVTvj5iYi6LiDkq/PAhzMnUcA/Dv0G5KtlXebpBh8R01r0BvdvmbgO2/oqfJl6sRlHIrVF1P1iuqha0QPWnb5fecxRvglOOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019439; c=relaxed/simple; bh=Wdb264ThQ4BCaseNxKsy0gSk1vLf86xdw+b7swnHjjA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nzKALmxa3IeVkKlWpvWJcH5jGXi5M/OEeF5WQ7ldUU5+frH97GfDtcpYam2/UzF1OZEvbyonX1zRxGtTK309C1xcTSYwMpycb9mwkTyMuPANFEQFk2OHE6B+3y7WGgg/Zl5Oyj8+DxH54nsp2+ND+WEQY/dhT1gZiGETyPj/+GQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=xtOYXv9f; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="xtOYXv9f" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFl1mKPzlgMVw; Tue, 15 Oct 2024 19:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019433; x=1731611434; bh=9cB3M FiVxGQerHt+xMybJ3xvfoyIxIsDuExAmyjNsrM=; b=xtOYXv9fY7R26Tug5ZaNz Ox5SH60HTDDZYqzaGGTdrmyBLpPl4cdlmFx2NwtkUle6k9YHoeNoESfrPe82OLMG +3FsiqpDOdNvfhTZJJRTPbfai35Zh3vi/AI0+d0JtJ9iGChnWtswH/D242Wj9O+Z CdGD9Zt1wxy5W8DglO6ZIu9FnxmAQ2NHzU0hpfhUoJi0S+syOkXTbf5yyoCie/92 2BlaQ687p7QV6079+9nsHN5P7VtdLB6i1sO0hDvfugUAPfhiWg7yVvdJoWRJH/JV I/rN/qmTm2zCpySOnl0rmISYMzNGl3PRRgrD3YS9Hj7NwPqSxbGpUoO+yz/qhShU w== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id DeOA-sqmLoQy; Tue, 15 Oct 2024 19:10:33 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFh3FXyzlgMVs; Tue, 15 Oct 2024 19:10:32 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Thomas Sailer Subject: [PATCH v3 09/22] net: hamradio: baycom_ser_fdx: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:40 -0700 Message-ID: <20241015190953.1266194-10-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Thomas Sailer Signed-off-by: Bart Van Assche --- drivers/net/hamradio/baycom_ser_fdx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/b= aycom_ser_fdx.c index 646f605e358f..799f8ece7824 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c @@ -373,6 +373,7 @@ static enum uart ser12_check_uart(unsigned int iobase) =20 static int ser12_open(struct net_device *dev) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); struct baycom_state *bc =3D netdev_priv(dev); enum uart u; =20 From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 902161FBF77 for ; Tue, 15 Oct 2024 19:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019441; cv=none; b=DOooceRYUXoGtAhwGipuE73lPyGsoJNPYihPljM1te6vWTmzd2GJaC57t2L6UlOK2SpaWDJDuTjDXkOSfVmcobpcajB7lNHIbXaMnQe/AgT6UpnlBpdXoB87eb2RlmGODtsOWETTZxL5/9unpO8+ltzIR5Q6xjJ340nfsp4g/eM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019441; c=relaxed/simple; bh=i8+UMYwGt+Ax9MlFSymDPDEXPbgE3tjLLNQl/G6fieM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oaf9ZxunaIHGHbHBCxVOc8k6Cq+eYp73Bzeo99PG8ugDPn3gf9cvdHp8IsVIbE21zPhbd/rgsELaNt5VUlRh4NQ3c/bSVNCBkNisgb2S8hat3oUr/obYpp8OtQMvPN7BxAbEObIR8FUdT4WMAIwsuM4IcfTvttHkZ4paSV+ms8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=Hk9/x0th; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="Hk9/x0th" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFn0Bz4zlgMW7; Tue, 15 Oct 2024 19:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019434; x=1731611435; bh=A8gCo PSUc1XHIfuDt97q/U1JNeKk8hM+DU6sGZxR2qc=; b=Hk9/x0thrgT4HBisX2lq8 hRtMXQyA9ZmkTeA+TA/WeDDaq7wTf4+yaO8VWHrmeYIJnWWtOaIA0FvMb7iJ3flY KC/MtoYah+uUJ++YaR1tJXk6hOeHmM8RxCBTn+hD6suFOEWmF35c5R8fCzdbR/oL 5vsusrrzWLUL6Xv5vxHX7BfCwcMRdYwwPzFaJ8s9qlyaIBk6spnGhVAckskO35Qq anM6wdUhzcG2nBleimr91ZfL/1sMagfIaljb0bjP1pmBe5Re8yohRLBYpa6cDNe9 lTU8CpsmX3OpT3QGLCXX7OXhzPowfGr2oMKcM6Qt6+SRChVdkGYFQ9Fn/ZXiRzfV g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id TAflxTEG55PU; Tue, 15 Oct 2024 19:10:34 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFj3TgJzlgMW2; Tue, 15 Oct 2024 19:10:33 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Joerg Reuter Subject: [PATCH v3 10/22] net: hamradio: scc: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:41 -0700 Message-ID: <20241015190953.1266194-11-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Joerg Reuter Signed-off-by: Bart Van Assche --- drivers/net/hamradio/scc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index a9184a78650b..c71e52249289 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c @@ -1460,6 +1460,7 @@ scc_start_calibrate(struct scc_channel *scc, int dura= tion, unsigned char pattern =20 static void z8530_init(void) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); struct scc_channel *scc; int chip, k; unsigned long flags; @@ -1735,7 +1736,7 @@ static int scc_net_siocdevprivate(struct net_device *= dev, =20 if (hwcfg.irq =3D=3D 2) hwcfg.irq =3D 9; =20 - if (hwcfg.irq < 0 || hwcfg.irq >=3D nr_irqs) + if (hwcfg.irq < 0 || hwcfg.irq >=3D irq_get_nr_irqs()) return -EINVAL; =09 if (!Ivec[hwcfg.irq].used && hwcfg.irq) @@ -2117,6 +2118,7 @@ static int __init scc_init_driver (void) =20 static void __exit scc_cleanup_driver(void) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); io_port ctrl; int k; struct scc_channel *scc; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FAD21FE101 for ; Tue, 15 Oct 2024 19:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019443; cv=none; b=sAA4wQeFB0g7Mbmv+zJwSz0Z9G/COehPB98OMXL0777A7WMtq1nF51PuF0WV3lf9xijMXwTLXlyPWiu0sDqurxnZW7Tz4jrF5pJv3y8i1Zhcan1MO8OrCsb/4pprV/aVVN8GFqxtjP2Gav2/skVjm3QHfS7z10rayWxrN2/u9rY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019443; c=relaxed/simple; bh=vy7V4NIrdMOyXq6KgHzCKDSyegF8v/naaLxh0AwU07c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M6OiL5z0t36apqwZFoZAItqe2aGnmpMDmkq1HeD0JJOrAHA+jhkkQQEvP8DoYbLhmvay/zoswAR3T+pMfEbXVAHUgXTr4qccNm1K//y9c5dQLuoW2GH82x6NjjZ21lX3PoKYCGbY/Ijw/6xwPBJDqtavGTXEXaaNIOz8ZuRDumc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=L9w6FP2c; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="L9w6FP2c" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFp2kgtzlgMW8; Tue, 15 Oct 2024 19:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019436; x=1731611437; bh=vy7V4 NIrdMOyXq6KgHzCKDSyegF8v/naaLxh0AwU07c=; b=L9w6FP2cLH2zMTGEMCp1X caI8PwV+IabJYW84fXYV6hR8q5wMSNekOSSXd0RhDfGXl7CAoqGy9Oy0l3LHT8rN 6p3xSCyuQdeOT9lygCnM6YMsHxcAYEVuOlvDYk1do7tAmxBARLXWCIJ2U6wE6lyd L1J7nEY8A0fW0T7R6FMlTgSPPIwviGhQhereAefU84/s2khIoVgRBZigQyozF2Hk 5k3toF19pz7SsgPVbn4Z/vZLharf0x7xTTV3rhhF1uEBOmIx5F87lCGYpRGg0B8J kDN6oBnJdklllji0bgr+lacCL3Sf0gn3+TqKlPquHjZMsvoYWZRVIyXZ7WtspkBG Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id xV7KS3PWQd8N; Tue, 15 Oct 2024 19:10:36 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFl08d3zlgMW0; Tue, 15 Oct 2024 19:10:34 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , "Juergen E. Fischer" Subject: [PATCH v3 11/22] scsi: aha152x: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:42 -0700 Message-ID: <20241015190953.1266194-12-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Juergen E. Fischer Signed-off-by: Bart Van Assche --- drivers/scsi/aha152x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index a0fb330b8df5..4276f868cd91 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -295,7 +295,7 @@ CMD_INC_RESID(struct scsi_cmnd *cmd, int inc) #else #define IRQ_MIN 9 #if defined(__PPC) -#define IRQ_MAX (nr_irqs-1) +#define IRQ_MAX (irq_get_nr_irqs()-1) #else #define IRQ_MAX 12 #endif From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24FBA1FE103 for ; Tue, 15 Oct 2024 19:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019443; cv=none; b=X44UMIQNz54puEeEZzuNXK7RkA0UG9QdkfokA+J8NUZef103v1Na+HvI026ybSZvXUgD7ZCQu94etbIZ8R/+83FLMiS0r2oRLJa+0C2VTywPALSi/WyUYm/VDTaEMjdZz+RlhIWWyNmj8njjsWOjQhWrkM0+mfleSjMSNosD25w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019443; c=relaxed/simple; bh=SfhdFzHqVpx7LTAYXD6t5wjhqCtfwdF/aBqePt9e2c4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hlYBCLjS2HXavFgitMaf/YTQ21Yzvh03p/kj6gwlsBg3V+6JJIbKRxtuLo99Ju/MJuKkRc1OZIg8RUEITRvbmmHzyiDaUCr0BzEP7+M1CnNlYOGKhWvlcLfwys6qAspnTaPmpQS6udoHTl2DS6l7jYuqvroCjlxxIb4xT91kNE4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=qxziVxmK; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="qxziVxmK" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFq1JqxzlgMWB; Tue, 15 Oct 2024 19:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019437; x=1731611438; bh=IpggZ X0ctIGVK1RK1Frti8Qu/cg14Ny6ZZtM3yqVRXY=; b=qxziVxmKExuC4B7GcRGr4 uQUYqec2eplnHbXYoyuS+dN8MEf0Pew4owoCSw1VuCMtUlFvgDiVIbLFUWgrXM+9 5WtNR1CTVO4g2IhyVnjBqd+laEtFJVPQ5Mxn1dgCs7bCSwIv7reoJyGvKszMSlyJ vi/IFp610jq7lcwHjjOcC7v/Fx39sI53mZ2EFWRM1R4lM13fBUtSwYNOm1rThy6w ZrvWTs26kz2cmddo/fOg3eSvKfQp2Pp1+Yu+TipnQrhWW9eYlxTqSWN11uQkEzlm bShR/u/69G0YC+MLcqsxYkMNl6LuFY5pQKPzhtZL7D8em5mH8ckAgtB0GXoQAznd w== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id RFKZMll3aPIx; Tue, 15 Oct 2024 19:10:37 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFm4ffLzlgMVs; Tue, 15 Oct 2024 19:10:36 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 12/22] serial: core: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:43 -0700 Message-ID: <20241015190953.1266194-13-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Greg Kroah-Hartman Signed-off-by: Bart Van Assche --- drivers/tty/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index d94d73e45fb6..74fa02b23772 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -919,7 +919,7 @@ static int uart_set_info(struct tty_struct *tty, struct= tty_port *port, if (uport->ops->verify_port) retval =3D uport->ops->verify_port(uport, new_info); =20 - if ((new_info->irq >=3D nr_irqs) || (new_info->irq < 0) || + if ((new_info->irq >=3D irq_get_nr_irqs()) || (new_info->irq < 0) || (new_info->baud_base < 9600)) retval =3D -EINVAL; =20 From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 609941FF025 for ; Tue, 15 Oct 2024 19:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019445; cv=none; b=jQmxHVxD/DAIVnWmPx43+Lc8l6cv24/6Mey3eGYpRRq6PHvYMaWI+K4Alah1NixQAH2Esx0XB4PlaCBlZxOth8R/VnvuH9QHJw5vQ/Q6rjnVxfxLDmFdgC88g2Z7K9whvItLrpv1t7X1G8KdOOs7Awy7zGzxwM/9hojp7dO7Kjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019445; c=relaxed/simple; bh=2OGBgyd5ddxaB6oSbulKRQywvfKc2bUgYfm3df92ovQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GxHqnsmdXqPzpXtf+Fqh9AJxqLP5Hr/3+xzY8+qMqbYZIW34oAazkD0JgM599BCRVbv2OVdJvWGw52+QYAm36Y/1ZQdzkd+bY4WkiUii9SeLTRQxPzaM7bQv0pj0m5o7fzUde1CDtT/QWulzb/OQaYFHRf/VD0j+QTNpUAM3uco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=Np4eVw0V; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="Np4eVw0V" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFr027bzlgMVs; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019438; x=1731611439; bh=h9btA iRfDbRreRXsMKtJ+PkFCghGuPSwuuSslr3gXeg=; b=Np4eVw0VtqaMsnBOGWeBw M5HxJmqEsj9SlOtgJEoJQ3T0TqXQHbmc0r4/G0wrwyiziuj2RNi/0HMnFmUGDEXe jftquR11mc/vgUp/w6Lb5Vt7aT6J+sAzLZs6F5XPCJA0zWpVAWCdkqMXhlOOs6tN bbK/iLIHbLE4f1Y7cWI0NXz+Md5JR8KVRE0YYPF71O4cl4PUMdMuI5YWnteHRBjb /+8GPDz+HoKE1qSQTiKKmOkDB2gRgv9Tz4EA4OWdC3LVPORTR2sbzMxlnHFCmVUR sIiNiHOCepEO3VNbE3oxhAVx7IMnJoNzfY6b/aCnlxwbVey3nQuU+r7wEXsHwL6r w== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id HzAZcxiGZYEF; Tue, 15 Oct 2024 19:10:38 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFn4FfWzlgMW2; Tue, 15 Oct 2024 19:10:37 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 13/22] serial: 8250: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:44 -0700 Message-ID: <20241015190953.1266194-14-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Greg Kroah-Hartman Signed-off-by: Bart Van Assche --- drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/= 8250_port.c index 3509af7dc52b..0b886c0924da 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3176,7 +3176,7 @@ static void serial8250_config_port(struct uart_port *= port, int flags) static int serial8250_verify_port(struct uart_port *port, struct serial_struct *ser) { - if (ser->irq >=3D nr_irqs || ser->irq < 0 || + if (ser->irq >=3D irq_get_nr_irqs() || ser->irq < 0 || ser->baud_base < 9600 || ser->type < PORT_UNKNOWN || ser->type >=3D ARRAY_SIZE(uart_config) || ser->type =3D=3D PORT_CIRRU= S || ser->type =3D=3D PORT_STARTECH) From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0347A1F5856 for ; Tue, 15 Oct 2024 19:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019445; cv=none; b=MHuKZTePdiw9Z/K3O6KJ8RSaDPwiBVid3knu454kJ2tGQwf5h/NftKMv66/mstAqQ/wV6jpY8bnUASsIOc7BQ8gDZ44/yX14KK22+plAS7ZlX1h5F0KD82S1K5qsVm8eftomP5Axrwr9uf0q4NU0fWWV01XDFhWiJXB7Lr3164w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019445; c=relaxed/simple; bh=Tr4xJM//9j8z/dwDTOVBf6kpLLhCrbCIcoEJRO5I6Gg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UWdn7zfrbNJ7yzgJkVLk7vG5HPSJvvtQGVzXctVVThLPG/SdOW6FhDuNCPQKEU2KVjXsbeq1rqzsN1XWU7hGz5OMOXU5JZKRF8zUP3oPqrAJdFinYykmv+/AxhUD91fQMd5PDAGMN8HZ4fkIuS5uQeD/jnxpbTZl1351BCynKpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=sso4f+B9; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="sso4f+B9" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFr5YCczlgMWC; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019438; x=1731611439; bh=iIm2g x3rCNvsrpUtyulAZ8xNRwU0lWliRsAvvXQ26vM=; b=sso4f+B9ywkgPtffxscE3 5tp3FlmfjsfjRTD7uHYP5D15FtcRKp7Zqmi7nhmSwLvgSG3955rFWgFwKi+msnr8 CNrMJnOLjzGIq9AnRXVurXmCwvEFtqeIO9aOE7jdseWj1MU/jf502mAmOopu5RXp 0ST6meZpmaQ+ZLTSbOSLK1nFHtHMFupaTAViTsEE93P2oBTVCLMcOguQg9+sCsxl v09KSZn0kj0Jg9iwEj/mpDVnV1mYt6Mh3SkU5C7TJOVGef4PTkcT1LV/1UbukwDV O/i/3DkZpOhGBgqjdWNIbFFtvuEEaq+7B+/zb70YCJq96aypnRPybIMg0cXzJf/r Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 8ksGpHNVfkMk; Tue, 15 Oct 2024 19:10:38 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFp2tPZzlgMW9; Tue, 15 Oct 2024 19:10:38 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 14/22] serial: amba-pl010: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:45 -0700 Message-ID: <20241015190953.1266194-15-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Russell King Signed-off-by: Bart Van Assche --- drivers/tty/serial/amba-pl010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl01= 0.c index eabbf8afc9b5..c3a7fad02ac9 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -499,7 +499,7 @@ static int pl010_verify_port(struct uart_port *port, st= ruct serial_struct *ser) int ret =3D 0; if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_AMBA) ret =3D -EINVAL; - if (ser->irq < 0 || ser->irq >=3D nr_irqs) + if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs()) ret =3D -EINVAL; if (ser->baud_base < 9600) ret =3D -EINVAL; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83E501FF051 for ; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019448; cv=none; b=PTnaxr0A4K5Y9VRtaya6bs1I1A3JhpKTdxSWTXK2XANdjXXxcvgWTcnIyyePZUePuU/0CDzBG/yDnXibRlNmx1BeJJbpJprdYQOsZdDJQLaFPgXRCJxqJn8rDLIbw34z8BRIGH0cN38eMKs6flwBwShjsGuCJKJ1Y8Aqgg+c1yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019448; c=relaxed/simple; bh=pT280GpY5z821adqTjhmYJtpOlpEdhOD3ynw3U2ED1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f5EyIMVFBj4wDRxvPHxRXSLSy6HvF5uXdFLmZTHHXtdI1mehTsaHukTVVIZoLcN28ETsGxsE/0664FE435//WoPkTH3o3R2Hvf5PZ6ijCY7tl3sefuTHxOpq6gDEk8/IXLxZHFjdZ72D7e/cH8NVnwRkqo/PViUx2Z4nkElBkV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=dVCZYGdc; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="dVCZYGdc" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFs5Ps5zlgMWD; Tue, 15 Oct 2024 19:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019440; x=1731611441; bh=Gd1SR C1KqUqbgF9nzPrVTNhfzYfVVvm7H7GFssZv5aU=; b=dVCZYGdcRQHXRcvZ4Vbsg Bl+VFwz5Ay9eFWVQIJA4DZSjXiQ65gn07oiZzcorX8KYrsWnuFTVNxF4u0nCQ+Sm aeTQO99mGwCrcZoxdiKTT/4npqQJzvNVWXd3x78ecU7XCJ3WiBgiiaUmE1m6Onzq EaVtl0ubJxLNU1uxplxWWHiLLSjnk6+lZNucwM6NiJUjDCqh6jmvVAVl5VKHXUXW nCPtKG2RFA04lMtqvg5ghDe1Du+yG0yEt92VqdIV34yGAEPHSwRF168xRjoRdadM Kxz+5GfG2RejCXL9ore8A/jDgg94OhZsN6ngJqSAui6TUr3tQ8L85TwvQB0wQBp9 A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id PErwcsaYakgI; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFq15yMzlgMW0; Tue, 15 Oct 2024 19:10:38 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 15/22] serial: amba-pl011: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:46 -0700 Message-ID: <20241015190953.1266194-16-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Russell King Signed-off-by: Bart Van Assche --- drivers/tty/serial/amba-pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl01= 1.c index 7d0134ecd82f..1c60850030b1 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2202,7 +2202,7 @@ static int pl011_verify_port(struct uart_port *port, = struct serial_struct *ser) =20 if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_AMBA) ret =3D -EINVAL; - if (ser->irq < 0 || ser->irq >=3D nr_irqs) + if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs()) ret =3D -EINVAL; if (ser->baud_base < 9600) ret =3D -EINVAL; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 543211FF04D for ; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019447; cv=none; b=oSyzr2p031FeQ5h+8gRspsvy2XrLg/WIYGBZSD2eD2ByMwYvNUfRVG9xfphYEeRU0xYkl7qzdamnuSnFb8bky/JkMOEEmbVu9DoE6/0Oxnbbx2X8S4m0vGIECKYjYt2Ak9xDJ+DE9a13TTbGg/ra1DKemKt9aCNCyeYlsdzcGKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019447; c=relaxed/simple; bh=rwSTrxMeDR58NLoluBPOaLrltx8AiPSHezxn/EIQS3Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pYxZIzr5hd97apOuxDJFWPCQowDtZKhYCqvmyKLhR4SsMPxSpqRqswXWGYR2q2mldb3a40u+2kdkksZyfX4x3AqpAoQPg05UoDJ8fa3+X4wT9QYGyQ/Ouh3ZcHyxXBikkBBjbRUEu4MNcEG9ZqLkMxo+p4XVL7alx+s76/48vic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=Zu8gjTr3; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="Zu8gjTr3" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFt5dhZzlgMW0; Tue, 15 Oct 2024 19:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019440; x=1731611441; bh=6Gadi ssd1xRreJMHFyFxcuAmyYPn7MUE3CNrw0CZYtM=; b=Zu8gjTr34Jc7U5V8vq2aN hRtrSgmk4Rn3SS3/tQOs7lUApWa4c5A+3OciqyKv6tNStQMpgP1qDIE9ke8oHgTj NDBfH2totli89FLR59LShRWzK6yZ/vy8tfyvSEEPpK07Ql/NSPdBjNuJ5xpqBD46 e8/I2bAKeu7HNB3c6+P9pnMDNlP+k+8dO54HxZdB57An/Z1ZcrzczrCHMLQM1WVp gmfDIQVxaN5QS9IRLyD9oiKKyRe//Z6DrqwAMRlEGvQ4OB3uYKoF6yg0lpZ8jvjD 0ZYNg5K9KtqXfAj7SkBLmMstXZLgK++aA3C+Rr9oea0rnWWYlCl88Az8pFfeVJKb A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id YrsHb6FFs8Xd; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFr1bP1zlgMW2; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 16/22] serial: cpm_uart: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:47 -0700 Message-ID: <20241015190953.1266194-17-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Greg Kroah-Hartman Signed-off-by: Bart Van Assche --- drivers/tty/serial/cpm_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/cpm_uart.c b/drivers/tty/serial/cpm_uart.c index a927478f581d..6eb8625de435 100644 --- a/drivers/tty/serial/cpm_uart.c +++ b/drivers/tty/serial/cpm_uart.c @@ -631,7 +631,7 @@ static int cpm_uart_verify_port(struct uart_port *port, =20 if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_CPM) ret =3D -EINVAL; - if (ser->irq < 0 || ser->irq >=3D nr_irqs) + if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs()) ret =3D -EINVAL; if (ser->baud_base < 9600) ret =3D -EINVAL; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AF422003B8 for ; Tue, 15 Oct 2024 19:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019449; cv=none; b=XIEAj1YllMjvVTt0QFeL/SZsnNqQbPQ4ghatEf8mw9/LOGk544K9qSaklxY+MdZWr0yRzpV9PUkmhH19XlAikjin47jaZGFjIGFPymigC/BbXDpw3YknrSCnWjZsXP9umRo18NwHitdBUkG/mB6YSlAxN6Pb/fl1/B6wi8LnWz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019449; c=relaxed/simple; bh=XCkgaoCW/g4Kn/PEsYqEdPVS612Hp7XsBq4MZWdPkeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZsYor9Aew7pBLHbXQoVi++b4dZjWJ4t9A+yJ/lASlYCZLr/CUED9Hwd9UhUO0OiFoxjJgbyHBoBG9JdDYFZcGwL9BJktZo2KTlYqud9vMoNvActyBUWo+YCFanVIwhz+sRWJ36DNyyD2YW8SLWq9PbiQOWNe27YDXSdy9yHZDeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=YcnqlYnd; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="YcnqlYnd" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFw17pdzlgMWF; Tue, 15 Oct 2024 19:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019442; x=1731611443; bh=/CFQm D8dplrCU79nB1uv1N+1ezjtp4CJbD1+mGPTw/4=; b=YcnqlYndeBN0+DtQlkp2m vv9c9UzEFMKvI+eTj2sBTZhjT6ufItYLxD973NNxpnOAqOujLXjaSZmPeRdpazDB 7hf2ytspYhG+3wvgHaOuO4ofba9NhCcTIGKTZjb1aMfrmDtX9VzcsgYuXQCi3zQ/ jEdb+HyMn6i2cPyDEGCzQHj9N3GhKYbQsnj8pTasfSrQXLV3ajZcqMCiV9cHt7gh BybNoJp1idZQRew9br3iZgO1pgIR1SJNoLojcKowkChKnCKNTsTToZx3wJ+DodUS POjpPCAPIsTIxfW5SOwHn2EzuJdlheWlGamF77Lhtt1CPdf9n+lGgXPFt1110gLI A== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id X4ps6AwKg_oN; Tue, 15 Oct 2024 19:10:42 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFs0tXzzlgMW9; Tue, 15 Oct 2024 19:10:40 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Timur Tabi Subject: [PATCH v3 17/22] serial: ucc_uart: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:48 -0700 Message-ID: <20241015190953.1266194-18-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Timur Tabi Signed-off-by: Bart Van Assche --- drivers/tty/serial/ucc_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 53bb8c5ef499..4eed909468ff 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1045,7 +1045,7 @@ static int qe_uart_verify_port(struct uart_port *port, if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_CPM) return -EINVAL; =20 - if (ser->irq < 0 || ser->irq >=3D nr_irqs) + if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs()) return -EINVAL; =20 if (ser->baud_base < 9600) From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AE022003C4 for ; Tue, 15 Oct 2024 19:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019450; cv=none; b=NKiEvgyTiP5RcwuTuHkVuFrE6QnJARte+7xCErx9/5KoILTxs+6fO1bX6Zkkls6/ST1096noX94MX3PMM12Xtd78TOkQ8igxVSqvJJOqVJIcKPa+QbSXH4s9BJo/MgFi905vQyTTivKfAObABTq69GPp4XQcUOXLhu4wk4Tpplk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019450; c=relaxed/simple; bh=ax3djP+zZvZU2aaZdzcUsZc/ClscWEMSJQtalnIGHDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VwyjrwEePX8l2AKf2ouPgb09Z+vcRkyr331ty1ZDAVqa2SRMgNqgSaW1Ewlpe6D/mxOVchAcaG2UvdSlxsp1vxOjzq/SNPiOFkpVLAjn8ag9Ew8WCVR6ePByKYtvkj6qx9hpC91GQ7dJjnL6vb8RprPOTZjLxIFzRhLTlT/kSDw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=iEW75WHa; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="iEW75WHa" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFy5LLFzlgMVv; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019443; x=1731611444; bh=Xd6Zs c38bHpyyyul0CsyEa1dCceS06rn+bSuiYRZsXA=; b=iEW75WHaaCFCjYSXkJQ/D U6Y5n0B12glC5l0fNQ4/B+NSrgRukmZmsPYwv9hAwVloR0Ybfcil9f0wQG1Ap23K 11CBdb3uXhx4XytDp1CTKP8EhCzeuldOUnod/KPnHobtygF+TICIgIJIe4Cxan5+ CttYN38t96eH5xo/9IEPzXsaAp1QNq/2tV555PE4H+/LGXzFFebUG30Iy0cGTMrS 2jUSXOBxxhSPmzebYVGY8HKsqcmSWB5C/W9eBF+fphA5YPihfHOuPQ1Gecjv+e8M L5dGXKENxxsg0SPqasP1RlI2eRE+tJR9iajznJMR//goe3AmkWgb/s/XSCkk8Iu+ g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id miY22hxJuvol; Tue, 15 Oct 2024 19:10:43 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFt39cczlgMVy; Tue, 15 Oct 2024 19:10:42 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Yoshinori Sato Subject: [PATCH v3 18/22] sh: intc: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:49 -0700 Message-ID: <20241015190953.1266194-19-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Yoshinori Sato Signed-off-by: Bart Van Assche --- drivers/sh/intc/virq-debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/sh/intc/virq-debugfs.c b/drivers/sh/intc/virq-debugfs.c index 939915a07d99..5dd8febe6da5 100644 --- a/drivers/sh/intc/virq-debugfs.c +++ b/drivers/sh/intc/virq-debugfs.c @@ -18,6 +18,7 @@ =20 static int intc_irq_xlate_show(struct seq_file *m, void *priv) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); int i; =20 seq_printf(m, "%-5s %-7s %-15s\n", "irq", "enum", "chip name"); From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D650201005 for ; Tue, 15 Oct 2024 19:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019451; cv=none; b=FgxR1C/ukTiZvzympds4Mn+zibcrjE4Aiw+/B+nPE1briHfak+Xj8DRiV2NK17RbBMtz9wpdtNUaxzbSj6BYgnIBPEOqAsfuIBr79afbNUUDszWYkTEDqgLOGG0x+uL+gwYq4oPwMy6sK8eqcY5ANS/bB97+v7NStnLot/Ln4Jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019451; c=relaxed/simple; bh=5HZ7p64O0x91+cTt4ZszeGfeNnzhdgH36tTCgLAP2nU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RG4Ti5CJLpQj5pcKx09LPsmu6idbhW41bveFGjnGKAXsQ4KXnYRufofRDLDIat5mzROu3+QRbsMAL7EottJo++Z1ViPAMAy5MGTz++0ULa1mspv4mAJ6tIdeiKElVz4PMEJKrcHSSUP3KftsIfHQ3WdvM6E5rdjhG4EObIzgoc0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=pFMWzpkF; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="pFMWzpkF" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFy74z6zlgMW1; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019444; x=1731611445; bh=jQN7C RCJ2b5AE108+aOTtBMaODrxsc5Ex4oLuFRxEEc=; b=pFMWzpkFv/qLs6+2JVS3P cJjgx5GgFt+klZMJTo56xeaZoyTlz3XrrZM1k2jovmUVljkeWkRNWtxbkYc1KbJV PSPAdTulO54YLzLIJ2E1fm+bEIxQPDKOq6uMwD6K7F2ZCVcFi0SX6xDpDmRTbEJx I8NzjvSpycdL15QPFZa59eL46eVua+PlL3wVFZ4DiqXmhauC6IvopAxRTj5AFnnz loXIEIhmEpLn2R2cXVcWypQbmMUPYmRJBzoO81NWvK2VoQFAePK0o4aDoKJTFFad BNmnXrXJP/MNQY9lJAao455cNIoaeAheLXLOoJEDHasCYul24GUQuBnYgwGd24q9 Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id Hqse_NpOurPP; Tue, 15 Oct 2024 19:10:44 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFv3NFVzlgMW2; Tue, 15 Oct 2024 19:10:43 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Juergen Gross Subject: [PATCH v3 19/22] xen/events: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:50 -0700 Message-ID: <20241015190953.1266194-20-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Juergen Gross Signed-off-by: Bart Van Assche --- drivers/xen/events/events_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_b= ase.c index 81effbd53dc5..985e155ebe4b 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -411,7 +411,7 @@ static evtchn_port_t evtchn_from_irq(unsigned int irq) { const struct irq_info *info =3D NULL; =20 - if (likely(irq < nr_irqs)) + if (likely(irq < irq_get_nr_irqs())) info =3D info_for_irq(irq); if (!info) return 0; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A18AA201016 for ; Tue, 15 Oct 2024 19:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019452; cv=none; b=V4mZWd2sFY2g804q/C718YLeYWp3FoSxywusEJbE5QX/M3w8lqZ7+b+S927/wJVepLzmA6fNRZyTQjk/Exr2/nXo+5Am/wQ2kPlxJy2UsyF0AyGJqbrMkluVMaLnoAJbRqEfzw2wQizvOuTzERCJFtExaGkZsTjqzR7Gj2MC5vY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019452; c=relaxed/simple; bh=C65hrQQHOKFPoqfhTZVpg+tv2vUuUWpXuSIvSRQ/PQU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T7uw41olCkjqsQV/HwluMz0cKYYJNVnRk3SMDnw6SLA0o6AFHom4Azhfma0V9kZ+fVCaGSLYsdn/Z5VyeN0/CBdFlkEBDJCue+IQQXSHHP570nSTLPFsklFTGe2dXkwGDkSFr00qDGeMD4nE3Tx3lXoir+mmDzc/cWXknwkLg94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=XfZxb2l3; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="XfZxb2l3" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkFz55G8zlgMW2; Tue, 15 Oct 2024 19:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019445; x=1731611446; bh=sT4hZ uUOjQ/KZbHYEzesO8WWdwvf1Nk3oNcZhQJfDq4=; b=XfZxb2l3CISEUSsKEPyF3 P++C7hRd2UrosHVKNvR3XV3TnZ33z1YqjKmfjR20RVlskQxipk8fZ5TM8KKfaaC7 vLZiOsiGt6x0ZOD546HFSJLwM8bp5zuamUb1i/9AFoaLeBWuhRlSxsQk2KI9fdMB 6kZniGuot1t7EWZvTmNcXBYeLTYsY00P2P/MX0beyLEOtfU+5q1jNGMY26ajE3JO ito3c/BwiRR3wHS06f/BhbqGU08Jds394CP4nCAMGGlJ0km5f2fCBOptESUXZMFR Iv3AoeTDZ2fxa/1UGbpwIMPNvhEpPZ9UJCy23YKcWjqyjK0qG6YTIfg9CEL4TjZS g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id AUTqvsrLb5dn; Tue, 15 Oct 2024 19:10:45 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFw3ZnrzlgMW9; Tue, 15 Oct 2024 19:10:44 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche , Alexey Dobriyan Subject: [PATCH v3 20/22] fs/procfs: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:51 -0700 Message-ID: <20241015190953.1266194-21-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Cc: Alexey Dobriyan Signed-off-by: Bart Van Assche --- fs/proc/interrupts.c | 4 ++-- fs/proc/stat.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c index cb0edc7cbf09..714a22ded8a8 100644 --- a/fs/proc/interrupts.c +++ b/fs/proc/interrupts.c @@ -11,13 +11,13 @@ */ static void *int_seq_start(struct seq_file *f, loff_t *pos) { - return (*pos <=3D nr_irqs) ? pos : NULL; + return *pos <=3D irq_get_nr_irqs() ? pos : NULL; } =20 static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) { (*pos)++; - if (*pos > nr_irqs) + if (*pos > irq_get_nr_irqs()) return NULL; return pos; } diff --git a/fs/proc/stat.c b/fs/proc/stat.c index da60956b2915..8b444e862319 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -76,7 +76,7 @@ static void show_all_irqs(struct seq_file *p) seq_put_decimal_ull(p, " ", kstat_irqs_usr(i)); next =3D i + 1; } - show_irq_gap(p, nr_irqs - next); + show_irq_gap(p, irq_get_nr_irqs() - next); } =20 static int show_stat(struct seq_file *p, void *v) @@ -196,7 +196,7 @@ static int stat_open(struct inode *inode, struct file *= file) unsigned int size =3D 1024 + 128 * num_online_cpus(); =20 /* minimum size to display an interrupt count : 2 bytes */ - size +=3D 2 * nr_irqs; + size +=3D 2 * irq_get_nr_irqs(); return single_open_size(file, show_stat, NULL, size); } =20 From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F314B20262A for ; Tue, 15 Oct 2024 19:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019454; cv=none; b=VhuWNIEZNfVM30lPVZimxsENavCeXp8NxmS6osk0J2djq4lz/eqd5DOLIQF7ILMYmBpVE9l1TUmwrpM2xv/IWWwMwmQ5KuoO7/k+ju3wnPJCeeFMb8aaJaP96ZR+lwb+FcFXpvCafH1baqRGwvZSMLCOZPr/PnkmhV47sVe9qgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019454; c=relaxed/simple; bh=ngsHDoV9KfS7WyJdzmcnvIUktyGVLD+61W9vJKdGERk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i94r1CRfZI5aBZaOFL1uCL+3u3ZWTt1DepLbuin1shXS8K7Y5ik/27YgcXoMYiSZ6gmH12LtbwIirQjGCtAR9HadnD+Mmq/ASYRpkbQCSL9gzHxgccM9bBuPO2iQeDGswNXhx9wZN5ndLWTtcKXWYRgfIiUsMQFevc2o1EWms7A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=uPfjUteq; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="uPfjUteq" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkG06xg1zlgMVy; Tue, 15 Oct 2024 19:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019445; x=1731611446; bh=d1DwS MHLYc4VX3zs0aggkzGrfbw6HeD6IpGcohc8YHo=; b=uPfjUteqjyC2tMLnIx/vR LwDfgZjigMRPtd8f5W7zlGAXkcQAdabtmzwC9zO6QN8iA1+GFRkwYffFcGNm+jBn s9sRJb7ql1SmPTn3RISEbTjWhPQSlBDwcSVtMlf5gsc5XzaRtk/HPp0Hts6elyjT WlKrlsy5lmPimJWACgaKRgGV+99RCc59OGg/BfA1zRnkK1Dbk85ENnCZu875RJ1d yDJH+Xz9X2hhDFgXlRyEwkdLH9boo1PYKqmBCTdOMVQH6NBTrJPgmfzDJ0F+PK2z 8A5E/1RPbBgomtaWpwiTtBgvtEGnR2zrHH8hEiXZak5Diul5U3FLPl70U6t1uPY8 g== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id tPdOjNKAOP8Z; Tue, 15 Oct 2024 19:10:45 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFx2v2qzlgMWH; Tue, 15 Oct 2024 19:10:45 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 21/22] genirq: Switch to irq_get_nr_irqs() Date: Tue, 15 Oct 2024 12:09:52 -0700 Message-ID: <20241015190953.1266194-22-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the irq_get_nr_irqs() function instead of the global variable 'nr_irqs'. Cache the result of this function in a local variable in order not to rely on CSE (common subexpression elimination). Prepare for changing 'nr_irqs' from an exported global variable into a variable with file scope. Signed-off-by: Bart Van Assche --- include/linux/irqnr.h | 33 +++++++++++++++++++-------------- kernel/irq/irqdomain.c | 2 +- kernel/irq/proc.c | 3 ++- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 7419b807b71b..a33088d27c54 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h @@ -11,26 +11,31 @@ unsigned int irq_set_nr_irqs(unsigned int nr); extern struct irq_desc *irq_to_desc(unsigned int irq); unsigned int irq_get_next_irq(unsigned int offset); =20 -# define for_each_irq_desc(irq, desc) \ - for (irq =3D 0, desc =3D irq_to_desc(irq); irq < nr_irqs; \ - irq++, desc =3D irq_to_desc(irq)) \ - if (!desc) \ - ; \ - else - +#define for_each_irq_desc(irq, desc) \ + for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__; \ + __nr_irqs__ =3D 0) \ + for (irq =3D 0, desc =3D irq_to_desc(irq); irq < __nr_irqs__; \ + irq++, desc =3D irq_to_desc(irq)) \ + if (!desc) \ + ; \ + else =20 # define for_each_irq_desc_reverse(irq, desc) \ - for (irq =3D nr_irqs - 1, desc =3D irq_to_desc(irq); irq >=3D 0; \ - irq--, desc =3D irq_to_desc(irq)) \ + for (irq =3D irq_get_nr_irqs() - 1, desc =3D irq_to_desc(irq); \ + irq >=3D 0; irq--, desc =3D irq_to_desc(irq)) \ if (!desc) \ ; \ else =20 -# define for_each_active_irq(irq) \ - for (irq =3D irq_get_next_irq(0); irq < nr_irqs; \ - irq =3D irq_get_next_irq(irq + 1)) +#define for_each_active_irq(irq) \ + for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__; \ + __nr_irqs__ =3D 0) \ + for (irq =3D irq_get_next_irq(0); irq < __nr_irqs__; \ + irq =3D irq_get_next_irq(irq + 1)) =20 -#define for_each_irq_nr(irq) \ - for (irq =3D 0; irq < nr_irqs; irq++) +#define for_each_irq_nr(irq) \ + for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__; \ + __nr_irqs__ =3D 0) \ + for (irq =3D 0; irq < __nr_irqs__; irq++) =20 #endif diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index e0bff21f30e0..ec6d8e72d980 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1225,7 +1225,7 @@ int irq_domain_alloc_descs(int virq, unsigned int cnt= , irq_hw_number_t hwirq, virq =3D __irq_alloc_descs(virq, virq, cnt, node, THIS_MODULE, affinity); } else { - hint =3D hwirq % nr_irqs; + hint =3D hwirq % irq_get_nr_irqs(); if (hint =3D=3D 0) hint++; virq =3D __irq_alloc_descs(-1, hint, cnt, node, THIS_MODULE, diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 9081ada81c3d..d226282c5b66 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -457,11 +457,12 @@ int __weak arch_show_interrupts(struct seq_file *p, i= nt prec) } =20 #ifndef ACTUAL_NR_IRQS -# define ACTUAL_NR_IRQS nr_irqs +# define ACTUAL_NR_IRQS irq_get_nr_irqs() #endif =20 int show_interrupts(struct seq_file *p, void *v) { + const unsigned int nr_irqs =3D irq_get_nr_irqs(); static int prec; =20 int i =3D *(loff_t *) v, j; From nobody Tue Nov 26 22:28:31 2024 Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D93E1F80D1 for ; Tue, 15 Oct 2024 19:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019453; cv=none; b=jVBVs0z+vBDV72haWinyv+s7EAn9CQsG3RJmAmHzS96Q2D3DnQvCumQB74j9NGuu+M7hsjIldY0gK16oAwsWPsCKigr+/ArqlZ2oIAB85C6G/R/VBob07o1KsI2lZ6H5P475j0rV+//e7EkflqD0tY+3s2o9mcRWkRSNbYJ6ZE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729019453; c=relaxed/simple; bh=UybMUcR+599A7o8i4NI+AzgUVwmatR93PUrtXeYW8EA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YgqcL2/aR6Qe0Oke2Z06RXNcptLuNN1q7/PfKPSqQpYhKdJ81BlBQUFTdVS+pSo9JNRDfCyPSlaO4bDV7N0nFgGI5nCLslvHf+iE4qo+qkGqTLzZHxEMkcFEQIjILTsIwZ5mlGaOlzB+BmNlqaaUw+ijHQR5d8/xmANc+vRe1w4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=d66RtRAG; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="d66RtRAG" Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4XSkG04w6yzlgMW9; Tue, 15 Oct 2024 19:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1729019446; x=1731611447; bh=nJ/PN WbgXqDkmBydxBghlnc4SXVStgqLWpje1vc1+RE=; b=d66RtRAGi1pzjif1UTzr4 Kg29Tw22fvEF7v6FD4wEn15LNa0IsD4O/o0W+001+aKiwf45hkRY7iwMK9JOpheD Nn8Af/N+z4gY7m56TQtnOGM8KU4oAKeh+Tepo6/aTOGJSu5yIDdNXy91KbMHwJcU Z/xe1JUZTTeM6k5iT5aBoVrb65WFOQLUP3RJWeRpHy5aiSOd3glynYGw9zY2Zyog R4JzwFiN4Nc4nF5S6yU90a8XsiwexkABJpciYlZ95rTrw4Dv0VznhhXRcEadd76L ctuvndJfHo5gfQFeBAdakX68pbhaqbkG/opfCnmpboD9VN1Wden6U3ALVZEABqbt Q== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 3_IITjJB-gZV; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4XSkFy1KDDzlgMWK; Tue, 15 Oct 2024 19:10:46 +0000 (UTC) From: Bart Van Assche To: Thomas Gleixner Cc: Greg Kroah-Hartman , Russell King , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH v3 22/22] genirq: Unexport nr_irqs Date: Tue, 15 Oct 2024 12:09:53 -0700 Message-ID: <20241015190953.1266194-23-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog In-Reply-To: <20241015190953.1266194-1-bvanassche@acm.org> References: <20241015190953.1266194-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Unexport nr_irqs and declare it static now that all code that reads or modifies nr_irqs has been converted to number_of_interrupts() / set_number_of_interrupts(). Change the type of 'nr_irqs' from 'int' into 'unsigned int' to match the return type and argument type of the irq_get_nr_iqs() / irq_set_nr_irqs() functions. Signed-off-by: Bart Van Assche --- include/linux/irqnr.h | 1 - kernel/irq/irqdesc.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index a33088d27c54..e97206c721a0 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h @@ -5,7 +5,6 @@ #include =20 =20 -extern int nr_irqs; unsigned int irq_get_nr_irqs(void) __pure; unsigned int irq_set_nr_irqs(unsigned int nr); extern struct irq_desc *irq_to_desc(unsigned int irq); diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index b0733959f8ae..479cf1caa610 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -138,8 +138,7 @@ static void desc_set_defaults(unsigned int irq, struct = irq_desc *desc, int node, desc_smp_init(desc, node, affinity); } =20 -int nr_irqs =3D NR_IRQS; -EXPORT_SYMBOL_GPL(nr_irqs); +static unsigned int nr_irqs =3D NR_IRQS; =20 /** * irq_get_nr_irqs() - Number of interrupts supported by the system.