From nobody Tue Nov 26 17:25:31 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 0F35C1C1741; Wed, 16 Oct 2024 20:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729109050; cv=none; b=M3ai0+ASnoUUTI+VWSJbkDATFhz66DGUh03S0Sy2scly5eYo5NRhgWK/QnQHMY8eFacwtOzBJ44bTLf3iLbOT+Olfy49/jRIkJ95SlWp49bx/1o8Yy4jaGNEnWA0owADg6C/A9WQTbH7AkjLll7gcfZDdCaqucvZqA8mesHtcSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729109050; c=relaxed/simple; bh=tuaO6A7gHLNmvnHus5eMRzGDum5IqO8lr2+Aro3Ykjc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=gOM/sU8nDYNWtKPM2wnoD3dap7iQ9VzHumg3uWRDzOOIjftgoQKoHR6Bm7fKcsygdItlrqv6yo/f7W0P0q9NoHpKN4Wh3n3oeylrPyaXKCG8BEOQITyG2RGCiVnEqJ6lvdWQ2wfZdNcl9XzMxQ7pIfhOs/QxoVxLedAyh4syPOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HF5e+r8B; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EDLQMy/a; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HF5e+r8B"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EDLQMy/a" Date: Wed, 16 Oct 2024 20:04:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1729109047; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p2v9s9xAb9zPgs8gsAoEXm6oEFtD6sxRNKgOYIgaFYE=; b=HF5e+r8BNAzUsMfxwol0LnQeyf4IXmw87rNrGSreoNyXE+pYwDUggAX6tFWk8Wml8/Ngbk fd2q+RRPa1SsP9Z+7+4PO9hC9ypGp6EtdeOwvgjV5gBUDvg+Iyez+wvbCG+chjGan6wBDw gO7tQkdua1IOLGbXULpGvRJUlgUFZO1Pwet1JDQ353YFVIMUGeKiEn0hDsUXMXOf+E3GrD 6Sf7z0wH2Ga/0GkbxAADaIVGTFMIv5kyTYiLDHG7btmPi3Nm1qNtI/7fgGwX/Q1/4rXT58 J/cM+7D3uxIzDD6jAj2nv3bsxcusiGy7a18sMKdPVdXyNKwIwdRpHSdNx8LzKA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1729109047; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p2v9s9xAb9zPgs8gsAoEXm6oEFtD6sxRNKgOYIgaFYE=; b=EDLQMy/aC99BJKa+FOIyGJ6MVy29BFaw/TEKV9FK0T1sPDKygYrOkFpFLSslI4tqjwP5Rw 98bs6wIRGYM5XWDQ== From: "tip-bot2 for Bart Van Assche" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] fs/procfs: Switch to irq_get_nr_irqs() Cc: Bart Van Assche , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20241015190953.1266194-21-bvanassche@acm.org> References: <20241015190953.1266194-21-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <172910904622.1442.15883821629541971439.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: f4dd946c775e85e4f9aa460cd3dba197c35e43f1 Gitweb: https://git.kernel.org/tip/f4dd946c775e85e4f9aa460cd3dba197c= 35e43f1 Author: Bart Van Assche AuthorDate: Tue, 15 Oct 2024 12:09:51 -07:00 Committer: Thomas Gleixner CommitterDate: Wed, 16 Oct 2024 21:56:59 +02:00 fs/procfs: Switch to irq_get_nr_irqs() 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. Signed-off-by: Bart Van Assche Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20241015190953.1266194-21-bvanassche@acm.= org --- 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 cb0edc7..714a22d 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 da60956..8b444e8 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); }