From nobody Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 C9DC4215000 for ; Tue, 8 Oct 2024 20:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419186; cv=none; b=U0NfgYVA3Ycv2VqOY2HJf05HmYpHftfA5yboHGUItVTdL1EtoNFnSV2OmRAekLogLrMmWSiSiR9AgzmkVpLmtkrbPlRb9X9g9JFuS0vnXiZVVDmFZiMIyiCc3Aplq3+yOeZq/UmOh1yfu3jAfPwUdpXxioJzPfOVQn7UHG7vmxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419186; c=relaxed/simple; bh=Ed8gV8GKAA9ytfqVU4j8TQz2cYhGZTws2c4f7c2Cd9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fABIqiVrK5Qx7UzZvIqnV+owkTBiqNsGBmv0K/uXuYEQmB5YFTAgF41Bw0jP55vF8pf+fNtsrt2iHGLjUBgdFV4SgEN03B6Yu2waw5s2xkUsVw1dzMSNnrxb67D3QoQy1DC7ezFDxJZ5Lc5YArVCDkkvghqInf8alIWZwvmDuQ4= 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=A+IiciE9; arc=none smtp.client-ip=199.89.1.11 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="A+IiciE9" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGS1kH0z6ClY9X; Tue, 8 Oct 2024 20:26:24 +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=1728419181; x=1731011182; bh=6Hpou 3I2vTXbdkDW0wPhZhYVi/91c/wd5OQP0eCgeOk=; b=A+IiciE93a2mO1ux7UZoa OZQeTy8xqLCVlQdD0DAVrSVQ85p8hDGgzuf7WRWtzb6dyAu4+568jvwJYDqPm04J G1GI7DItBwHllUpgC5ifnXq+AGh3rQ2P2kk16RabztWK13c2fEJQvtpGFFdu2jZ5 IUY64LP9AHxeV+vckbQI+Zp2PBs4mQU3KqMmSuvtAwgwrOd3zvvRrs9uEK3ftt5V TntS9co1r8BpB8XWMu6V5eDXKm583DP5GMFDx/OBZIpPwmE+fqzB0f1b/xpditfL 3Mt9t/9a2GDGw4zho2/hdvdAtgnto0iRSeFn4Cd73NqfEC6dqhynoGIwwGj8G2nB Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id LFtF10rKgvnu; Tue, 8 Oct 2024 20:26:21 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGN682mz6ClY9M; Tue, 8 Oct 2024 20:26:20 +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 v2 01/22] genirq: Introduce irq_get_nr_irqs() and irq_set_nr_irqs() Date: Tue, 8 Oct 2024 13:25:40 -0700 Message-ID: <20241008202601.3737326-2-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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 change 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 EE75D215024 for ; Tue, 8 Oct 2024 20:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419188; cv=none; b=JUsTpLobp/D6HHS2KaLH+XQf/ne7EpyKgGWdu/KHiTRLOImPDJ/g05c7+Ej+jkD3cYVXypblpg5qLmLy3xeVJr8rLa3kBpINVpqyTdXRrd3DLR75m4DEVwPMdDJkHDr77UatqlP1FL3pmG+lf+ulYkGt3ploWwshMKOClV4cog8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419188; c=relaxed/simple; bh=GwL3T8/NAgxurVcKfArdlqPpL3Gi/OqPSpb74GoAS/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EMG7efkB5C4NJmrokeC3+U9DkcAZ+dYXq7mt6YTCn3GFNFmmBncP7qjqxNekrBO6opMO607qtMJmL591N6eAu5/e+DNXboVpKfdszIKQb2TWuwTLGO0a98NiRgOIc1GhVNjM0PsdT7c2e7XenFG4E8CFGkAI6YGrzMrYqTzQn5U= 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=n+ckes7m; arc=none smtp.client-ip=199.89.1.11 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="n+ckes7m" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGV2VVCz6ClY9c; Tue, 8 Oct 2024 20:26:26 +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=1728419184; x=1731011185; bh=teMoD VrbQQRpfWAMGe5SkP6JT1y9EEqndgcPVPB9Azo=; b=n+ckes7mwmctAyEPxF+Zp bjJcmgij9TDVbdjo8pZMERIFvZk9vesprhToRJT32JnXW7rsUKPw4Kii2qHg+F3M VuU+bT8Fd/RIeq+TfilmQMLFwMQku9RZHa4QWfojT50L2Otv6TnDHJijHegTrVIC dq4+BJJbI5b6bDW645arnhyxdf1WQk0vf+VPA8hqvGGjxlXbPoE/sQkZZu3yGg3N m2yiCae/3ddNdwz+8TE5j8ekZY5SklE3w0mea3QsNtBjkjWIg2gbgIkcmKN5h0fL pBSWuePsGPEjsnNW5rxXDxKUbRiD49/H5B2XqEOvjAEcFYRJzh0s60dTYHxBh6ea A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id oD_cL8X0JP05; Tue, 8 Oct 2024 20:26:24 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGP2qHXz6ClY9N; Tue, 8 Oct 2024 20:26:21 +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 v2 02/22] ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs() Date: Tue, 8 Oct 2024 13:25:41 -0700 Message-ID: <20241008202601.3737326-3-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 0F46C216438 for ; Tue, 8 Oct 2024 20:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419191; cv=none; b=cmmHRPKIqDMITjzxp+XSjKBLKwKHORHfDIjfPU/bUI65FgNd+RmDkGnSCr1iVuxYuxe+3aPiiLc+v+XEzMzPvbFQF5nt8ZCjN/aLaYFiT4EOsrkG7dcyrJ3BwA4MPaz3JosgqmgdPXhD2lnJPunpzbpRKE2fUdA31N3RPwIR+Hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419191; c=relaxed/simple; bh=v5+WlhCYp3nmMU6WLvuEwiSxxIt3K6XhnsHw3qlIlT0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ujbMxMGJvhSNMmvpnimPho7gPw3uNk5i2q2wMGoPnJvGtOxQnZs4CK1t84B5TP7JBNyVyj9d+exu8S2wc7aD7w+4KhAPLuNreXDehCOmhyzntdKjZPHUsiMnIrIo/hXVLC5VYfLuVw28CCh00v6FE8iYblY1pC6pvJS9U9HOkm4= 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=IReFh1kE; arc=none smtp.client-ip=199.89.1.11 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="IReFh1kE" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGW1tDfz6ClY9f; Tue, 8 Oct 2024 20:26: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=1728419184; x=1731011185; bh=/XeIP NRcpqtMH6mznQch4+Ar5ZL668QdZHfyJcueCk8=; b=IReFh1kEfvONVFrHKdhiP fhOhxi2UjzpZtTkq2ZdU5aUT+Vi2icWTQqk8kfIq3Ij5PSN09lrEvHOp4RdNqW/c kixO0xqvjbfHOVjaOmgMQHWKTn8/UTWhIS6soWVvjWfYZFPVgqUjBuPkysRRd8r2 WtpgPKuUWJDIFAfqDQ0bmulvz7YOZZGq+WItKQIp+OTo23ME74v1KZ6imfZl5voa kki7uJOxDehj3q/m1F1yoluxn01Ca+Ya//m6DfBmeukwd+7aVjXSmA/6dwdbxWBL amIg0quXRCbbQe/0fSihXDqlR4p7Dfa7TIALa1Z39ynkuHrC39B2OUWYZiY0aJkz Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id bK9icmbkKRjo; Tue, 8 Oct 2024 20:26:24 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGP6cdsz6ClY9P; Tue, 8 Oct 2024 20:26:21 +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 v2 03/22] LoongArch: Switch to irq_set_nr_irqs() Date: Tue, 8 Oct 2024 13:25:42 -0700 Message-ID: <20241008202601.3737326-4-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 E9F74215F55 for ; Tue, 8 Oct 2024 20:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419190; cv=none; b=TCtS8DQFGCkEQLVLnN58NY3a6XlQJA4P4Zr2cQaBC61oRieJadTXYN5T8BWu3MsL7z4enpW8g7RWVfEL2Fwlss4xzFcCattqr6JZI9lPRdtcrDpn5L4w1w6U9l+TfTOKUvBV3PqeNd6SG5BSoEjMAqwgNXVax8rwEIF5IjU2TwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419190; c=relaxed/simple; bh=LZHlm7CjWTjn4ZVlwuP1XH0lQQa9FSrmpnkGHu9aEDw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F2uE5gNDW/JeP8U1rsM2zsRIz5KWHqhuk629JHlQ/ZW2pCm1f010dZwiyHa+yRzM+1Z04AqUfioWH7SF3+KpJ5KKjq4bVy4vJZnBwwrPcDkgmsHiNzQCCXMrC+cgFdcWZvjVi7gZmxMaIE9FNILKZBkp1WT6zCUP5rTiBUbK3ZM= 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=nP6zLf64; arc=none smtp.client-ip=199.89.1.11 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="nP6zLf64" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGV5q9Lz6ClY9d; Tue, 8 Oct 2024 20:26:26 +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=1728419184; x=1731011185; bh=MyUaP bvugmKd3NVvycIqSqhXcIEjEkyEltEdZjwCUac=; b=nP6zLf64ncxoqFuow88JG PVz/1BU/VJ0/+eAKkW0zzH1vKaMXqfNnI+SbvKfnQnW3rPvLOt1klprltNo9c0Sg jNqnd8L6Gbk6qsksxWUNcq+M6nAkaxfiUH2wU8fV7vMcoVJBkkkrEF3Sjv9RQ/sP ajKN4yd1zEb4Ht7QqtAXvScPla4VlogqMUI8jtIAH/fjHgEZEaLYc3bO1kw/U5Ft dMtxLERx2QBPC9ozZ9IejIWwTCggADUl8ehPHUyTHn2NHFj/zpvcCpPh3KgJDCmw vugGMRrqC7i8xVZYdPJ+U3QhPo/oygIhpWCRXBWRceiPPuEhiM64BEuW8tzgx7Uh w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id n9sqEiyXRz1i; Tue, 8 Oct 2024 20:26:24 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGQ4TP7z6ClY9Q; Tue, 8 Oct 2024 20:26:22 +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 v2 04/22] powerpc/cell: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:43 -0700 Message-ID: <20241008202601.3737326-5-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 --- 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 23624215037 for ; Tue, 8 Oct 2024 20:26:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419189; cv=none; b=NA868aQpPCYOPUtgWxajv70Y1RVa/y5k0oLJCDrmiORnogXXbkiqkxzwjMlbdTfH9f0eXWf/jD14TahZI7gDA74OUjLPYM22HidViIW3nJIV4+dK/79cH6B77++KzIGyYo7ZqLYoZW+LwSgfmPyR0Hd0/ado1rlkgzMt9v6WOpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419189; c=relaxed/simple; bh=4OaWZQj2r7KW4hU7DOCWvsAxJCgl5pJj7S8Li1eYu8k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZ+izJ2KJpO1IeYANEumnP6TrqbTyTkQ0+MQ3hI8awzg1db5ZzEFMAN7ooL5IPB82Xx4oKkIObajVCdM4GCyBkx7lbtWuFqbtm89Ps43JtLvVr3CZEArhpH8SApi0946vmluNGINeAmIsS/zerkuR/kuStBLOcw9xT2R0pXTdww= 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=RM7gjzy+; arc=none smtp.client-ip=199.89.1.11 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="RM7gjzy+" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGV3wf9z6ClY9N; Tue, 8 Oct 2024 20:26:26 +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=1728419184; x=1731011185; bh=1npcv IHXQr/o/yu80ET0P8TxfjQQlT/eFnS/czBdy4w=; b=RM7gjzy+P5CBsB2NqWSR7 8+GOKOdoJSlI5tn1CxOgLv085NpmdTuTaRp1xRrwpUNAeus5hwt0/C4NrG2PqGZU NXjs1GN1WWFfCrlehHjHyuC/FENeIc2LSuupl6jQLZl0tHjFgMNgBLlv53ApYto8 bhpVIkkIqlqm1lbngAPgBg5SFu3AUjdX33PDuZwSh2us5GWy2qGad6HLXWFAdeOI sw8l69aYjgJ0AqxzJJrBT2R7QqMeDJtUgUpDGOu+YW4EMYyh9yeuEvCFW7RPFBmV kE4wg4u+aBiPkcKJLTM4IziyeBnEDBVNsJc5vGj/KpHusd5I1IfSrOFkHMTy5d/9 Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id bK53Xc7h6XVK; Tue, 8 Oct 2024 20:26:24 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGR1hvqz6ClY9R; Tue, 8 Oct 2024 20:26:23 +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 v2 05/22] s390/irq: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:44 -0700 Message-ID: <20241008202601.3737326-6-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 12B4B218D85 for ; Tue, 8 Oct 2024 20:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419199; cv=none; b=T5SyWyNN6yO/RS/yieW8d2hpO7UDpxfpJxXYX0ubunBeEvpaTw5St0lp45eWgm0sqqSd3CCu+lGraK3HRBXNN2PXTqLUuNmjQWG9hQ0UWVuxuQ6G7QFC+87VuBSY5jJLuATb1AHa2GQqTMKnmMpkZ0pcs6gqLDlMn/XSdL2dO3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419199; c=relaxed/simple; bh=GM3WUJp6PlTXVW7zuDxGprOCJL2aOZqrdGfUHItLHk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m+85Yt+1GJfhvUoxZh5AJm8pFqPr5iaKDdAXASGJpQMQIgU71SUGA1LP8u8OlYCMUpJj4L4tpsugFAxTGHWIOM7PLioOJgf6Sgb1vz4Ve6OF52aqx8pE65b/DsAwi69K/mxtzzxg6EawmPn1BQaAPbVDTJ6S7nh34iF6ZKd4V8M= 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=pFsx19Jt; arc=none smtp.client-ip=199.89.1.11 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="pFsx19Jt" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGZ4VZFz6ClY9R; Tue, 8 Oct 2024 20:26:30 +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=1728419186; x=1731011187; bh=5o3gV /RPFxVSDgTN7GytVoLdXfYOY+TDXun+fn8fKSA=; b=pFsx19JtO3V8Ql4meqzOp UTfZ6BuNDfxCPfHArYS6RZ0Q5GeFkzoJJzdPFoVAvTP2vlB+3m96mcrAP8P39U3z ZHWh+X9TaS+cOxUi//HEIwLeNJsuhOQD4gAdF7/5+R1uLA/+hz/hk6byAAFBZGx5 34XldKUTiaBpm4DehD6HcBy2W3ZbGhl5uUXuN4sPdl0yGQrm8n945bQ670Jmek2d 9l6qLYk4hPfDxfc5M24/rdtO8/jm0c1s7Hu1v18iBb1lo+mHOTDHxugNFPDGtApK iGTgnkRFyMH1afKkb2HoNpwBjV4kCpPbi/bxJ3aQrrMXClfp+ZBApTX+woXZsotn g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id V6WbZJvh6vdi; Tue, 8 Oct 2024 20:26:26 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGR6LnGz6ClY9T; Tue, 8 Oct 2024 20:26:23 +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 v2 06/22] x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs() Date: Tue, 8 Oct 2024 13:25:45 -0700 Message-ID: <20241008202601.3737326-7-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 010C9216455 for ; Tue, 8 Oct 2024 20:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419192; cv=none; b=NjQ/JHA+jDA6K0jrA0/k/D1nXxyowTJkFAt4b5YFAtSaA/nVJkbZUqoQMIzUZ8+sMjG/jBcTK3C0xp3XNmVWIoX/RD2Zhke5aUn7wezZrAQ3CAvgbom86z1x4PViPUukXmUZO57IoF39vRcofhPdctS55HkTuerJhd5NpnrRdGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419192; c=relaxed/simple; bh=4g4+rCe9fjT03ga0XaFl2S9QVagxsEwgsi/Uy47iMxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p7mYnfsA7hto2CoI99epKgDax2rWl+lcnmEM1QOJuNKeCbu75+MO1LcIH7kR+mqiqKOr9g4PH4OMkHfpr6oY/LO5mMr2ITu0/nfbz5beGEq5OGcnW4Fn7wXZt0WuS+qoPh3y6od29xFin2IyiaxaO1yYLsoM5TpyaaMUinFbP0U= 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=upFCslR+; arc=none smtp.client-ip=199.89.1.11 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="upFCslR+" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGX4wLyz6ClY9h; Tue, 8 Oct 2024 20:26:28 +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=1728419186; x=1731011187; bh=G3QUn uM0CAW8g81+YiCD9szTVl0B+RfQeSeKwgSjpAA=; b=upFCslR+OAHEFXJiggN3p UeSIUJM0Tx7XzEvSjigJ4iwvtr9D/kMckenXF7ARlLVfkb/WXeOdysZQKMdQzSoB WTpRRqnjeVaoeS1KDPclBbWA0g1SV8Prqg0DfeFqPe/55oXqt3qa/zDP4H6dHr0m ObKXCi2sHqBzDTtxSMmXRF0P2D8iusBMrvosDOlyH02nUUO7gtqM4Yjx15nik6Xw rc2/tBcXma2PhPOBFFJKXefZVsCeqZvmaH4QVNxaFVgc97pbi4wPxH/ZeVxtmcD1 cZ0ZyvC/Mj13yCN/BfOkQenze8w8jBFYECDR3bgSxwoZghf1+RG4LRV/gCNhRKyi Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id v3ARXb8bwgw4; Tue, 8 Oct 2024 20:26:26 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGS4trQz6ClY9L; Tue, 8 Oct 2024 20:26:24 +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 v2 07/22] hpet: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:46 -0700 Message-ID: <20241008202601.3737326-8-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 038B7217906 for ; Tue, 8 Oct 2024 20:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419194; cv=none; b=ijE0D7v0VKKz8DUlcJtuY2v7lBPXp4GaFI4AKWb/V3SlNd6XXrcoDOSNJgE5wpBL+gwVXeBXQuKr+vjZGq4aGQ4/7MFgumNdmGQAapOCbf+R3S59zcc6ZelhZpKlb+sG+sHiQ66yiagZL60lWRaJH7E6XHVYvu6Lhtre6Za4T34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419194; c=relaxed/simple; bh=cT7F/iY47iYil3nLGGv9FagpjGOTPwfm3obxBEiZcRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D+5z5C9/ccgBtG2j/5ProCpkIVjVJAM6RNm3c4LUayeQfDxPrfxTgtPUBlRRzd8RtB1Y19/S+BFpFUvvmZNmGhkdStXPvLsNEnHzuBMB48EVC3FX0ayg/j+WzMAeYA+2E6QiHYkWzpg96S3f/YvEc9o6pXqeEl2W+Ydv0FBL9Cc= 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=nGYfMeSG; arc=none smtp.client-ip=199.89.1.11 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="nGYfMeSG" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGY16dvz6ClY9b; Tue, 8 Oct 2024 20:26: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=1728419186; x=1731011187; bh=F0uiC daEPfklLraV0W8TwdVwRj1KJ8hn/CxPHZaXW7w=; b=nGYfMeSGm6VektWLT1c8u kJRbOJaQxnp8Uhm7D+1ejwsEfOlBbUGOFRyNtwuWKMv5S99ymIVMCKv+8V+P2nAp Er0AGRR5E79lK09CD8d4I2EB6R1BxK9QBIg7VXMbuGOhj95uZ6DxjVfy6Lj8ss7g PQFOxkDoSkrFcovFa7AjiaosHDiNTzv6DmC1xIkXrhtU5nl8o2Xp2bDlXUvZXi1F Emcfy+pScjy+nlmF/1td0Iz3mORAdxiZo33Y3I+cNXDJj1Cba8SXb/u1zDnWoa1e +m00Z08VaZMlWp8MZZ9nNs8kTuClorix4pyDV9YCAwA3PB49e07U2nogAvSuno5H Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id ybeO8WKbWyYN; Tue, 8 Oct 2024 20:26:26 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGT2RVPz6ClY9Y; Tue, 8 Oct 2024 20:26:25 +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 v2 08/22] net: 3com: 3c59x: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:47 -0700 Message-ID: <20241008202601.3737326-9-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 20F20216435 for ; Tue, 8 Oct 2024 20:26:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419193; cv=none; b=A9hWJl1YBbn0c6qdsrCWLCbBHoZaEQ13S53Gx48YJ0sauJgp1cx5/X3M3SppcbjriFf/JrjwPRUhqZ/uLTfC0RPBeqgb/Li/CTxTfTrTUPJLxJdZzrx6Jkho1U/MXjMceBg0G4vLYNu9NSGldcC70QtLMrEkiru5WrY18vnXttY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419193; c=relaxed/simple; bh=lnKKOwLK5Gi1cepcIygvi0h2DSr/l2rRZz7I41rmwSs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cgoloAatM/wagvpVLa0reGr/nftLb0vO4qU6FJDFcADKpV7Oqqrc8gPeClNyG2cWehIxEe5Q/8icASjWG2nZz6pEdhZ+YuI0VZtI437uUrMLGrK/6Y+xoPedh/0wM0j8GZobcejmnwKFfUYxdEhXoumrCuIs+rQotKTfXb/bFZY= 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=EZMudz6v; arc=none smtp.client-ip=199.89.1.11 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="EZMudz6v" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGX6bdqz6ClY9j; Tue, 8 Oct 2024 20:26:28 +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=1728419186; x=1731011187; bh=xoMeL cCXQ0f+ms3Bse8o8XtuDIj4bYAX5BXD8HdafpM=; b=EZMudz6v3YGX857oBXYQ3 qd6YSGpeEpMd3yzwG6M8EuYihsmqTUnBRKLNAnw6re85uJe39YBHFAdFuXCiCWtc SpKNV2x6a4NTnl10A/+IXuzKDfTspABFE8huw9v24eCPcoMflRloEfrPaAkZtvK1 0Nuz2Omy5Qma1YbLm+ZTthSzcbnk8xTqLagBIn026JFkIbgsozditGmEfNarqq5x RgTZ+PXbupEve8BOI57+Qs7/cD0SeJKYIhICgehEueC0WtAMNHHgL7ycbDQ4+aCo Tm7CELs5SVsWeHpSsrtqNz84avcM3M8edT3fxalviuO5DCrv2MQ299V77RGQAql2 A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 4MyCu1naAdOg; Tue, 8 Oct 2024 20:26:26 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGT6mD8z6ClY9b; Tue, 8 Oct 2024 20:26:25 +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 v2 09/22] net: hamradio: baycom_ser_fdx: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:48 -0700 Message-ID: <20241008202601.3737326-10-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 2FB5621858C for ; Tue, 8 Oct 2024 20:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419195; cv=none; b=qzBRu59cXeVv4TFCwfrG9/GNlT0c2nf47HzcV3VdiGGc7SOat5jZ23Ssc25hQgUBYq9csAXUrn1UHYLMNJH5vNy0wQgP2IobNRJ/Ay/0b7ZdBwr2IMgpIFdSKMEvoTEThP7d4NcN8R73gfwJ6xhrlyrL/kuVWlAPvXH7rkxITys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419195; c=relaxed/simple; bh=moKAU0SZ6I/5dYVRk5QjSDZbMnqbi4apKwSv+1U97QY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eaVzEGkvUPLRh0x58kY5fGLv06ENEvfZmtN3rwSGikeyB32UYb2jhT8WJ3HUju77q0qubInPEJBEyIqHYO2qWXgoBBmWIjDHFnWcqVl6eNpMQeibruP7wtfMc3TQPj7hFxWKIzNAq+98xEStkYpq2FZo7EHgqHcA7x7tlN4vyTw= 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=dYTsrZuO; arc=none smtp.client-ip=199.89.1.11 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="dYTsrZuO" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGZ1HpDz6ClY9m; Tue, 8 Oct 2024 20:26:30 +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=1728419187; x=1731011188; bh=LUQpW HP9gysuNTAWl+iwBIz82gJ2ZTSCiMvlcyN+QiU=; b=dYTsrZuOL4rFWwi0/LMdk ppSAQeRm2LBT1tuvwAqYKXrrogjIXlDLgdXJrBbCNk3oDbEY/Mby9cT5I2HCo35P 7eIqxG7YrKYMEIix6JqJQKZTAUknUjyoBouihFJSCHf2yM2vir8xihxTwFlVIKep /gE3e/wN3Y7orDJz/dFDCGAqbWGf5geENwql0OCx+YIdnBwS3xPK4Qh0z9KIt38m WZJ0E4rxEEPXGp4OBqPhbpP28OreAuFohHDNdISWevY5gLXOyLL8CZdrI4h0vI98 iZq7pJHvbKySzbWgiLASLssdbULjj6g+/6cwFQfcUxIxAJZ5zjZOB4mykkgYb+gP A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id jNZ9XKFb3fI3; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGV4HrPz6ClY9R; Tue, 8 Oct 2024 20:26:26 +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 v2 10/22] net: hamradio: scc: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:49 -0700 Message-ID: <20241008202601.3737326-11-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 F1B182185B8 for ; Tue, 8 Oct 2024 20:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419197; cv=none; b=RlHJPFnIMjv9LI85r/4sMkUi9R4gQVSyA9X6CZE0fyqMaA0bvqGy/2ia57wydhwYSLoS3h0SWbweAR3zuV+j8iRDOQK8cVBOk9fKlTdrsdtRDAdAe1nobg3NQP/hkFZZhekzFTR0gox+rpu73yHEdR49KwsIjdKNsJLuMWh1JeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419197; c=relaxed/simple; bh=wbyhHh/fNrwvxkXQyCwz4oT17PgEMPM3u9oMoptGZ2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bh4yvke2VhLZwo01L9gKyoixYJ+7tf5EwZH+1WZc69dowxX4x0bOWKY4W32LBCaFHh9NGdVLnWZ7vOUrBbkGSF5/0IBi/lxs2dHXBUjKtuygr/jDJjgF/uobhjicwB0tssIOEZo/TA5p/Y6tJLGpVTQKvoEfikhJuqaMfkaOZCM= 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=3nL5np8H; arc=none smtp.client-ip=199.89.1.11 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="3nL5np8H" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGZ1QLdz6ClY9n; Tue, 8 Oct 2024 20:26:30 +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=1728419187; x=1731011188; bh=wbyhH h/fNrwvxkXQyCwz4oT17PgEMPM3u9oMoptGZ2k=; b=3nL5np8H6eOrY3thn4QW9 Ps5yYV+XpNx5mXgLi6x4IEQLDOioxoK5ttT3hSPeh5ZggfOe9ODFFQx71AfqvG3V SGtAgyXRH60pJnaEbvn++/mRnehlVzcm5bw8iNT0EFgtEE8M1aCi0++5rHCKTtFp IFt8zCsBaD7T6AiBbgjAaDq+f3tKeB22S41Rl3hal4+hvYaglhikmgIOdqUrQDJB q6CuHWnp1NsPlzcfNZtYDg99gKdxMXi6Q/2/shS9w6Wm9DxCaa8iCp5xW8s5Xxal 9S3vGz4DKGUBPZvLmQnYrPW0Tep6bJEE0iS9sRulGTTgDZaoP0YKKR7DZlLYMozD g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 9v2TV9QYxm02; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGW1X3Fz6ClY9Q; Tue, 8 Oct 2024 20:26:27 +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 v2 11/22] scsi: aha152x: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:50 -0700 Message-ID: <20241008202601.3737326-12-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 62DBD218D63 for ; Tue, 8 Oct 2024 20:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419197; cv=none; b=buFpubteoA7f0lNpvgGIhpVRHU3hD/tpkRFoh4DOZijUtI/zSok5UcvI19q9fGbenzYtx1wPDvawtvZQ+AmdmurY2FkQApLylWBU+go+7EnfN1+oMIStHPFN4qihaaKEfKlx78Wc70tmEgz9D2zh2JFgX9WivW2uj9aKKsoP8PE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419197; c=relaxed/simple; bh=N8Pso7LIEKhmPYJAcyd+pmpEUBsrBXHmEtMjCkJ+cks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sOlyo/QlEf1Byi5xYVxa05id2ESU0NTwOna+2qTrE95C0LElm8L4SeHh9AdjbeNzeOSRrKITaim2ky2ijOCmKygQ52zxiJyBhLyvjIUQt6antKUSgqpnQe8jtkLQgzFN+WkgD1UQKSC4wOlnYAp9JIzLa6+2UuUNw3s8qjtR4wg= 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=lmrd/5Q+; arc=none smtp.client-ip=199.89.1.11 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="lmrd/5Q+" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGZ2Z8Qz6ClY9Q; Tue, 8 Oct 2024 20:26:30 +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=1728419188; x=1731011189; bh=s82ew VfzzQ8AbRkob+216KEVDAY5/NdueDD2UstRjTc=; b=lmrd/5Q+ebJYB3HqNEUU5 jchmCRRXrHExl7Be/IpWeYaku/zXEvTPZ+Ttf+P8/1EJupKlehPk28jnxSxQAV6g DJb9hgCASlumEWmZT8/Io0QAv2MxNEVg88HlwBxzUJhobzrhyGJHX1PMaAwg6Mnj 7AvAD8WJV2S7bSExBu6GpL9JcwFOM9TzOpSdO8HEBc7NrS5aSN7skS+UOTkx3mkX eKcGjvo76B5fgn1co/KAyxEPzrNC9Vd7wqFW1Y0t5WmLM5Ove+eDJzxErpsqjlOM LB7HsAdXN/kvIF24FN+OJ8ZVzOjvWc1ywCnRog5QEKXWdlwZb/vUrjTr2gtoydx+ w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id E14x2V409nIb; Tue, 8 Oct 2024 20:26:28 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGW6CzQz6ClY9P; Tue, 8 Oct 2024 20:26:27 +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 v2 12/22] serial: core: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:51 -0700 Message-ID: <20241008202601.3737326-13-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 4CCED218D8E for ; Tue, 8 Oct 2024 20:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419199; cv=none; b=LbzmTq1Uw4UcYnZp3cqMXN3imbCsKBsBa3oIDMngbhX7pGIUstzTLUHgk8C6xos8S6XgE4smY+6hlfHM4ZN5lUj+5J9zgZL5SW1/Yu/0Ame5gXL9RlGQ4ZXLUloDALdCIpzj3kzmIJNWa44gZ+nET1FuVTqtVZzX+3hGyMSHaKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419199; c=relaxed/simple; bh=DrqtvCE2lnd5KR5p3FcXCwKB3jBN/mKnGgfPrdONWEo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VdLudR1GH+6apKfQTA+zpenmXwfMPsydZ/ohBDN1F3iGKlUJlnr2aOzRzrcsSM461wzOOzsOs9+gQhvXC7YFHVd6XHkVJQrJvVkI/RVnzKbWqM2ay53UAIch3Oyg4aihcDYQijwiQCTZTy3ZhYDepc0x9N/6L0bw8aDwlchoAJo= 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=ZGf9sNqR; arc=none smtp.client-ip=199.89.1.11 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="ZGf9sNqR" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGZ75HSz6ClY9T; Tue, 8 Oct 2024 20:26:30 +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=1728419188; x=1731011189; bh=pWpjN 7U18uDbYTFuGlMzhKb18KDKDMcWIDteI1u8OXk=; b=ZGf9sNqROL6LfeLAkdt9n h7R5OOnuZ5QMZIomrWeGJhjWiTK1LDy0L55IgDnU1f/wBlOxKXcInj0Bs+RXVtN5 qNYIJE/WzmayZZ6br6IT3WQ4cqrhH/6kFG8jPxp0sqVS8XqaSCEwDiOJ8T+vfQwh yBgW2XlgvIgm0VgSGg862gsBvXP/0cr7Vb2AR0F2i/zKDJ03SgWs6tj0WGCQniay Y3lTcN03mgiWUxLE/8Zg/VuQx1c9wsWn/EA95U0adqeLF5iRMFftDsQaQ1L7YPdo CU3hojrlgKaUMPcx3lNveoiPn2pfjNKQdttXpVdYG5rU+Gi0O8x+MS989JI2cwma Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id nQBttlXBftmo; Tue, 8 Oct 2024 20:26:28 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGX2q85z6ClY9g; Tue, 8 Oct 2024 20:26:28 +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 v2 13/22] serial: 8250: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:52 -0700 Message-ID: <20241008202601.3737326-14-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 C783C21949A for ; Tue, 8 Oct 2024 20:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419201; cv=none; b=Lg3wP/g+XYKgMUiDM2ERMfkdvTdnA/3FI9UpgmfqRrRzgT6V8ryG62pbENzYEWsiwfXTrpgk6WF8qTDklsUMruvVE3/EPIgciDRvZ4kEADFG6IRbZt+L3hK8OCThc9YdKcimOrAsIsp0IDW65tidBHTBmP2U28GhWJO9xNyCe1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419201; c=relaxed/simple; bh=OeYDwU/0wVBci/xl84qCLTD64iJtOG4g86TdENaIHcc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f+X7n9k4GsKFSl6UJ/4MaJsStl7A7Rxbq4I4XX3MOwmAjVOkZBl6JbuhOo7cD727/zi9ZDoRlXFF04iY2z3uW0oQLVYT577WIju/wSAjvRldsxPj7hhkp0RBzB8FrE0fMKmjmQSCji1pyLt8fb60wShXL1Tmkv+4287YmELcxGw= 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=IZJmyMsv; arc=none smtp.client-ip=199.89.1.11 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="IZJmyMsv" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGb3H56z6ClY9p; Tue, 8 Oct 2024 20:26: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=1728419189; x=1731011190; bh=9lACP 2kF+rFvlPMnYD36bW+64oJAXBLB01JhEGP2uCI=; b=IZJmyMsviaDgEKVuczZ20 +IUe/ZdrKo5rducQ+mRFX/2qe4tnVafR2VP2shzvC5HPlX0aKEbxn+85ul/4QkjI HKnxSshUdmQ6FbxzTTXfCT2u1sr7w36asc7txuP+U77RvSHUtAZZ4Rl2DXnb321w qmZsTp0/pRs8zueV6vzqq/AOu2unHHr7MF3bAQgzC1LSxpytMbMjnS+nsDK1Jc1a hhEk4hmaWzLTLnpPJomDzRTFLJ2l/BWd2aOaJmI8ezGxPSU6BDa/XE253UyZRqli 2NRm1BNR/y9fnoFYPHaDK6A0GFPC6w8qd+ZKJZ2m4ENkirYvLN4Tsg3ekcKhEpvL g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id S6_nQazdHDVs; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGX6Vp0z6ClY9L; Tue, 8 Oct 2024 20:26:28 +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 v2 14/22] serial: amba-pl010: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:53 -0700 Message-ID: <20241008202601.3737326-15-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 0A0372194A5 for ; Tue, 8 Oct 2024 20:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419201; cv=none; b=u7VdqL7b/FtShmYkySSdVrQg1yxjR7RJ3FxlkhsgVZI4l9pXCGc+1u+rzK//aNPHFzxyH64ptZR90yHU9G03xPwm3zNF3Lr+W5pfjn7ngu2zMASHKW6+HTLpgdODWreURW59y4a+ugTEyMnV/+I++Eme8H++FggxyPOq99rx6Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419201; c=relaxed/simple; bh=CKhChBHrmIOJ6VVJGQlaw2//NXLCiKsUtwH1VvzB/RM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d6+uRTdagAzSQCoOIsIey1xY4t/nUBd33f/ROnmp4wo6LdJAPHY3wwg6mVr2j27mtQF+kQzAij8GSwAtiy3snmIBPb0Uj5AZnnZqJEg9trBIrAGRx1wg3HY8ojJTQTmMQStb8eZR9G8XaF388cWCmZ93V3+uW4LUE/9LRCnnIJA= 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=OURmHUPN; arc=none smtp.client-ip=199.89.1.11 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="OURmHUPN" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGb6hrNz6ClY9q; Tue, 8 Oct 2024 20:26: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=1728419189; x=1731011190; bh=p6cMM 168PmmiAlpKiMMt9WygxY142DKnEcNQe7MMpb4=; b=OURmHUPNO3dOjP2WTf0Dy roEjeLkuD+BSw4LGWYD6cYesoURu4tYoglIqz/ppffp49Poqf84RmsjuzwxhVSMV zduapfTr7ubt8PcZZLny928Y0MthwDjpwf0zbRyMITB4SzqG7VuHrPlkwPfB8ZfM kRBwQHPtsv0ZQyicGWLgbf3v9GTv9qCtaEya3Rhp+ov4rGMIgYyGC1xew1DMSmea 1RuiDEiFBYTTiwI1zvZIzUPXAxcrNrGmgxJ52PsVK+TIGRrmup/cS6sshog+MI71 bLX/8m5PNMkNL6zrCQ4FxRV+QK6C56FbcV64V+bowy8ud2RN+b08wK2mtKdl3OVD g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id YfQYrHMS9Esw; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGY34JLz6ClY9Y; Tue, 8 Oct 2024 20:26:29 +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 v2 15/22] serial: amba-pl011: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:54 -0700 Message-ID: <20241008202601.3737326-16-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 A706A219C98 for ; Tue, 8 Oct 2024 20:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419203; cv=none; b=M3AbgYFqBXGNpVz3TmRVApkonVCCoviqGk1VBWszAOtjfqiN+nNTkG2zpYjB06fX1o5QoA1+yV8H91RgnNs/As57lgQGH83Ku0qYzx0sofMRD1q8ShUIGqac8ds1Hy/GsSuyXcbMsEJnrSyN9SSiYLtzXDx/TNDrvvKzYPNOuN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419203; c=relaxed/simple; bh=3XJdmd66oELlrEy8vgIP+/fNwdroiL4PtG4UX2JO9dU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cc9olC2vL/xCZeFkc+FfpMfa/+dxYS8JKHXndDZYnySfXJezHjVji5gnKBINdCmzNrln25kwc/FziyYCDioHqH5Lnf5HbA1FDgJ7r8TZ84kq5Rr1bHnXnP/A5NcGwxRA0arCdkeN337MY7D7wtbBoCJRCbaVHHFdNHpJ8seazqQ= 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=1uhjo6oo; arc=none smtp.client-ip=199.89.1.11 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="1uhjo6oo" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGc4F8nz6ClY9t; Tue, 8 Oct 2024 20:26: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=1728419190; x=1731011191; bh=yBBrw fXqXxwNlNvecvySeiGRVQDZXt+uV5hagQ0dgf4=; b=1uhjo6oonwRD2Ihm0MlZ9 eqeG8xpOsGwNTc5AcZdN4yvMnHyRuRtyLHVMJUA72d27JS6Bs+DMsxtUK6BzOkoY giTitF+yc+mpDS+dR8t1cSAjBMVJULORxuBFz17k2a9R3oqhE2s1KcKtot2TJVlr WQSktXMPXDryHA0AUZJ+iRxXzP3z+FeB3PBel01loRFWLJCpDshq9XFwsPnKvxkI cZMcqf2YNx7uSTSLsC1aNhCNa+yxJJzKxHEEs+PBJVxOjxyXfeyfXPhII7/t2yia QbcdtDHDdnmhdjpYaSla5AnUWm5c+/O4fTUBwejNDpLSUctco1uMD4+z7CXh6kiF w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id mqKQnbO8UTYK; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGY6q0Qz6ClY9k; Tue, 8 Oct 2024 20:26:29 +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 v2 16/22] serial: cpm_uart: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:55 -0700 Message-ID: <20241008202601.3737326-17-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 C3733219C9D for ; Tue, 8 Oct 2024 20:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419203; cv=none; b=JXv60XKt1M8L8RatT10ZV9Y3LbtZRTzuoKhONmd0Bh7o4ad6abNx+GdzMC6grj7Gtc4lu9TnZRMpnHQT3ITzkZkWgqRbN8T2ijBZIHJxrENzNI3GQQfH1l62y4bQgVCyEnw++m+Q10BB01MJyg/N/cWMu4tM8M9veEdX7ipZJik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419203; c=relaxed/simple; bh=swMZD7FI8tCMDI93QQDPusZo5dN9MRVyXNFRhg1T0BY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KTg7WBqqMWrPxpLt/4Y8iNa5Eo6zu0M/5D8/YNZqlxTVcWD/xHCcHS3lJb1ZPau9HHVQgWRfkXb94KftXzLuon82dljkY4i5DuM3hO7VDmqnYGMALYLrdDQKBk9yAtTD+URdMPbXK0FXoVuvAHhX8D4KyPPLSBBkE3jIMX+nenM= 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=RP81AgpN; arc=none smtp.client-ip=199.89.1.11 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="RP81AgpN" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGd2nZCz6ClY9y; Tue, 8 Oct 2024 20:26:33 +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=1728419191; x=1731011192; bh=MuVeu XQSH5og23lQCkYHFjWws9QSXge+/a1m3nADjLA=; b=RP81AgpNaFnRpk0he3HZ8 zmrgzXK6nnocTE+kzg0OgbC5VaMpZ5hUB88kHWK9gh1jKY3Y3i0J6s1A7ZC4MvNT 6CWNGeEDMfY9UgKFq8fUCkGMtUdqnVCYXHVVsAAnBuMEzU9i0bplUAhOa/JqWFMV QulpX/HlC8FpdVkEIp36fiU4A8UncTqRXtcCX5vMLSUVYNMHZv9dnWj6rwhB7hCF 8wwTRNs/P02229OPWyq3ZBlXqDGld6sa7mmpvPJVr7OgEYnGvz09GtdUil5N1xby 2qtj4cj9eIq79vMfuLGDvF87DfpSNCK7O+WICRRttbQs/afopTde1767y8O99vYy Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id yzDA3dBUBOJa; Tue, 8 Oct 2024 20:26:31 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGZ3gtVz6ClY9P; Tue, 8 Oct 2024 20:26:30 +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 v2 17/22] serial: ucc_uart: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:56 -0700 Message-ID: <20241008202601.3737326-18-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 8981F21A6EF for ; Tue, 8 Oct 2024 20:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419204; cv=none; b=FSH9586/80B4VGFMowJ+UuvlquK+bggPpoWEn1Ce87tY8PKCCpKsV8aeZEa+n54lj6yC05urTbNuOAYVx5Gh2tJMPrzajvMox6uh9IYnzJuNdtUgF2ncZoxKy4FV1IDp4dZq6YLBQI/Qkgs2OVymOTW41EzZ6TOD1N5nfQqjZDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419204; c=relaxed/simple; bh=re/kXkGT5/zjgbRY6YUf91t29Klzj2YoHn5+Kb1dGs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xzz1obr2cmLiOXF+z6Qd6nh8RcrebZu+VcgfUg6ayg6/o7z/Oue6Nmtj6Nl+T/H3DpVKiTtK5GbGaHlAuXFhDuV5VMcmfZrGCoq7Wog9JBo/eFW74AdRSoYgVvMEqpX3LeGwjktbGJuiWTWmE1ITOcWA74ZSJlJaWN0z48SPFSQ= 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=VbLGoEFt; arc=none smtp.client-ip=199.89.1.11 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="VbLGoEFt" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGf1Q7Fz6ClYB0; Tue, 8 Oct 2024 20:26: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=1728419191; x=1731011192; bh=p7o11 FVa5oIVd0b764Tqg46wzHmV1oraPIo4X0Cac5A=; b=VbLGoEFt/nq4bVh20T6H1 4ALhykzDUhl3/PxqpOKIjyxxzx51+uFfoZ9gCG60iV27FwXMAARmVR+Mtj/1zTqj Wxer0U9NOETfE3fMVqp0ep3lQWiJQq5O/RX8UHPxVPih/Yvrunih6zvpOjj9VPnO JcRNTUI44bF1loZbM1ntcqCUXmVAE1sKy73By9l55ihYFUArszegDk0Sl1ap6v2p OlY1LSpczHQ5wvysoFYvuEkgjqvDszn3fDhIEDvv/uEwoLx7OWeiSvIOYHLIVCd2 HKOkV73wGYYDX5lhXaR/ErcSjFArQ9WUhnWW1UEO7Ky9c3gAxvaWioC7Dd4cSVTN g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 72tRgjD0rhz8; Tue, 8 Oct 2024 20:26:31 +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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGb1fhbz6ClY9g; Tue, 8 Oct 2024 20:26:31 +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 v2 18/22] sh: intc: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:57 -0700 Message-ID: <20241008202601.3737326-19-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 992EC21A711 for ; Tue, 8 Oct 2024 20:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419205; cv=none; b=kHJ1Ix20u0Fc4Al2ExXnF7eNhALiQ7itk4wi2CWZLWfT6ujaOLOYmrXArnmFcZHUybVqU0igt/cNU/QZEjMNRbq9fh6pb4trmVs1/9hFMC/e2Re6UVB7FTr5wqhMZ3cHREQ/4lo2DdsTDSSVJQqN4EB6sbvIdP8kcD7PzsYdbvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419205; c=relaxed/simple; bh=1I46L2ZZyE7z1LPEWtTa6y4lX4+EFDjuB6l0WCN6EhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oRL0FE79iyWzNcvcvIPVHGMjHuOt2UvGDDUrkbkJ2PcUZcFXNpokMG1WfF3GmmnNjeaINy9QJ8eqMO1oAWYkCqWvmoW+pOcnydvr1MFirZoAlrG4zjv+aRWPlPpuHjlOm8H/tMEAx9cw0YMXm4Ks9fOn1XGx+qKX6E2WIARGoRE= 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=SXCedmiw; arc=none smtp.client-ip=199.89.1.11 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="SXCedmiw" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGg0d92z6ClY9g; Tue, 8 Oct 2024 20:26: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=1728419192; x=1731011193; bh=p/O8K kaCx16EereU29CzMz00CvS4k4wZmCMmGDGS+QM=; b=SXCedmiwRKg0oKp4JfUb/ YEB0Kgl7Z1Z+LzF1iYDTKWafeOWqe4P/HLMJpLRcz33URp5X/DIqo5fFXkMVq0Od B79l5QMFfz9t8b9yq4MZczXtm4+OrB3wkKZLg6rBlUSTq10xcdPgSxjlumbs1iOC 1pzoz8D+bxwxguH9HXV+I0GyfIBevXjb5yvaHPj3lvKkfwbmmskigIy1AmIsWjmQ 5TGBh2eORVWrxoG2WkNx/CmipBAt0Q05lc3aOBvvIzxPbEPu1zXsZ7rURxriTERN qnGUMPyuGKO9VEDrKTTN1nf5JgDYQHlgN+gjyYJjrz1G/sclBVLf0BlMLGIsnVTc g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id a-M-XagxgGK0; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGb6Lwcz6ClY9L; Tue, 8 Oct 2024 20:26:31 +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 v2 19/22] xen/events: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:58 -0700 Message-ID: <20241008202601.3737326-20-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 66FD021B42C for ; Tue, 8 Oct 2024 20:26:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419206; cv=none; b=n/sshMb8oB4zpsycnthNzOvN75RJasgL0Ve8NzKoh7XfTXrgonHWEF9bYtSK9l4kMvlifyhrqlW82vLOGXL+PzGz5En5X7I+6PlnO9NBbyV00jqB6sUNlnX6krxkry7hy9sUNXA3jvKZk+igojhq5AnNeZfsIcRa/l8oLUjZNos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419206; c=relaxed/simple; bh=7QCRcY70pmIo12QeM9BsUHbH41DkG4WOFFxB+kB4FkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qsTD/sBR5jy64OH2Hk2J4m4uY08iWQa+msjdfQN4KT0Vbq0EG879R35RdX8SvJrNJqCL0fhVA1CQdiHbWY8At+86xCo9X/ful/mTMsdzNDPTaGI91Eh4Wm5ls0wlkNqsUg3RMKb9BbQxYV64Slkieq2vydB2deZkXk2n/gcVtFw= 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=ZbqO9kyW; arc=none smtp.client-ip=199.89.1.11 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="ZbqO9kyW" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGg68bnz6ClY9L; Tue, 8 Oct 2024 20:26: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=1728419193; x=1731011194; bh=/wM3P 9p1Yiy75TZVpSluehkydQ/ep7xUeajJ+6eskao=; b=ZbqO9kyWhN2o+UKKy2hks Nymo+7/FglN3WtRBue0YcUS0bU4A403yyaencWgz/Tke7w8bb9J4QmbFy7XMphnn EHyLrrDFPZoTs2ktSWcpUZOCAB2g18fYk1WI9UOkz/kEDlWf0z9MENgk0nRjTE1+ 5fNxgLbjx/dJnc90h1VCbnWNofi8rtIE9rrkFFcPaNKV+dRveSEl5LN9orVY0wBg 6fXQzRkdcJLlIWN59g8pQJVEFpwm2P9MDEnIN6oBk8izQvULxxPkNOshWxLGv3yD HHElPkBiNwPt8L5EJxdfeyrISUsoqmLHZAL11V7q0Il4huYRYF6dMjpmQC0cZITn w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id T982ad5--R8b; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGc3rvFz6ClY9Y; Tue, 8 Oct 2024 20:26:32 +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 v2 20/22] fs/procfs: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:25:59 -0700 Message-ID: <20241008202601.3737326-21-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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'. This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 5B00E21B45C for ; Tue, 8 Oct 2024 20:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419208; cv=none; b=QpLfX+s+L3vfZ7TDPvaGvlliMUZ6kXCX01z9YkMt0dFD4h2Ro++Lfj505z2P7MfOBQuQS+6xgfm2tn2vu1HOoRGk+KDOGGeShN3rHvNshHding3QNDelmK6FQSIbOCmn0gKnO0jVaDriwvz4bpTfECskyfrzYal1WBrlmV5qqmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419208; c=relaxed/simple; bh=c85tEugDzSd99VeIZ50PbpJLXU7eEVr4dI+KdUj3PV0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FPwuqhVOAMsBvpcjiiJue+zv+Gamv/VqqfEx+hU+zccPh7JTjtWvr+/NHoebq4b4O78inWAI++5FM7zEDIJh4RcrMCu3YuRDjt7ihTaJgrjWveEKCmrnRdAbKvBBrYPL4QIwyBfj7WQS+ZSccuxIeGKe/ckGvG0DHf9+Y3OEP0c= 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=L6+eoClT; arc=none smtp.client-ip=199.89.1.11 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="L6+eoClT" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGh67pvz6ClY9P; Tue, 8 Oct 2024 20:26:36 +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=1728419193; x=1731011194; bh=fYOBw Meteuc9o60FUQSeXBBZgNw2hRpnVN7BBenY7x8=; b=L6+eoClTUACqavQ9DwY4W 9xb3Xm9HcdOBNlYDKedk48cAcTWenu0ApkDWu1nUa4q4oGHd7z8H+RREvI2LA9N6 bD1eofwemWnDE5CH7zasZLbo3lkqT8uUz980aPktAgzgTui8Xd+K+oA+EKVqUSQS OXmZQWh/EQlXUsaf33+VWV7pRjFd94LPwyqxB0uDtQBvib8Cfs++CA28k6ZuDbN9 09Ji65+4HyQ6p3zHcWKzMyaroo4BlR+2gUZBrGZix4XSEapW4ljs0IaAxFcH5Ln0 T8mMgrIQVDpR9HlPWRJzwWvcpZyaFg58vSXDB/gt5eOy0FNQ2jGuM6PJPZiRx17n w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 8o3kJ2lcWnkU; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGd1BBjz6ClY9k; Tue, 8 Oct 2024 20:26:33 +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 v2 21/22] genirq: Switch to irq_get_nr_irqs() Date: Tue, 8 Oct 2024 13:26:00 -0700 Message-ID: <20241008202601.3737326-22-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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). This patch prepares 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 Wed Nov 27 16:39:07 2024 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (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 8229421B448 for ; Tue, 8 Oct 2024 20:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419207; cv=none; b=C9PClKRZFi6Qd7iAeA0G5jSh6p1P2HGsvRT1+y8N3W9EM6L8KS50QzfyewTF4xbWi/c1P3R1sXsqxtXThYV4R/cdBO0qHXdg/qvEAKz+narkTjw0islx7JVbWptsriXceJGwpi+XsiBPvrn0uPq/EVL9/ARhhQdn7/4MDWFd2HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728419207; c=relaxed/simple; bh=MOgE/7N4bgY9jRHLrBzKwPnkGmOSTCG3apIaru2LFFw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WxaO9wLciUPKUPBy2Q6kYLYHt6FGBVn/gX3k8wkrHP+/fyPt6//HNjyeEyKWzj1JjdoGteYIErMmlJ35pl40nUd/MgqqEARRnfeozCJir0aSs4Q1aSayZmuPfNYYkaYfAuRYSJQSyAjW6M4M0lCyZ2+HWBWl6L2VubjsnufN7nU= 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=LuPl73Iv; arc=none smtp.client-ip=199.89.1.11 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="LuPl73Iv" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4XNSGh2jWTz6ClY9Y; Tue, 8 Oct 2024 20:26:36 +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=1728419194; x=1731011195; bh=dCydM 2CMzllpwzzMb7EVvSy19h7i9m9RpbLLePrDLTA=; b=LuPl73IvVrSKKT3PWebcC PPHaAQEQtizXJE/E5ZDQ6L2Zi4L+4ENLKTj/qNJUFORut5aYQChHKupqjGrx5ciQ qoZSpJP/0GH/MOa0fqoT/sNxKd9RRLXTXid7gG/uapdi8INCjJx4uPDsCCFQakV7 aa4cj0Y9I0fhbEp7EJtnObOGZR4lAWs3EwRuoJkBPdSiXHM5qBw555ltrtv7EfON mx+P9lLx0cDgT/wGkPtzKJhASl8AvX7823BD0JYRXvTOeopUncrOimFCTKdYTIvN wUo/PyFUPSJke1bALLylo1ASyXgCZMStvjUsYtXyvq/aRErgv4OyH/Jmk2boJVsD w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id PqWAGJCNjW_f; Tue, 8 Oct 2024 20:26: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 008.lax.mailroute.net (Postfix) with ESMTPSA id 4XNSGd4sw2z6ClY9P; Tue, 8 Oct 2024 20:26:33 +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 v2 22/22] genirq: Unexport nr_irqs Date: Tue, 8 Oct 2024 13:26:01 -0700 Message-ID: <20241008202601.3737326-23-bvanassche@acm.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241008202601.3737326-1-bvanassche@acm.org> References: <20241008202601.3737326-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(). 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..8696500309e3 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 int nr_irqs =3D NR_IRQS; =20 /** * irq_get_nr_irqs() - Number of interrupts supported by the system.