From patchwork Wed Apr 10 13:13:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawei Li X-Patchwork-Id: 13624442 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2067.outbound.protection.outlook.com [40.92.98.67]) (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 7F2928BE8; Wed, 10 Apr 2024 13:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.98.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712754861; cv=fail; b=cJh8tJIRtScOIFkiMIStTSA/em9uFycdqZ0qHML5VAUOq6TnTZOKxdJP4zm2xTDqkOhgdWLh92lEo5780c4jirYJtfgI9+hl3t4NNIbE2EaVpvKxnKuGDtn7g/BUyXCJo2zrEUXFAu0PNPCqKrWpZ1JlKeypZXNTtPez8568tfA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712754861; c=relaxed/simple; bh=QmnEMCgM4hVQST50qmJPtuyWMEJocxOQ2zHaF+siy4M=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=AxYvqQCvnnbY9Uf98jGAwSfpONAndXGuxgjhvaUq4nwmIUU5zDV6WkZoXQ/jYUf1HBjthkNXTQPJhBBAbyj9yokSoA9vyywVpXLPFU5F60YqPYS7QO3v42zi3/V204uLWSXZBrOv973VK0LtpM4EWdI3HprY8w5uWgqtr+yhKks= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=kuiF+ddo; arc=fail smtp.client-ip=40.92.98.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="kuiF+ddo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HqAt4clPuE/dWAZrzGiJzdjnkfLR7y+AB9b9geanpGcbCk4TXNyVqWilO5BABPxldHqfQB+qLv5avN34YVaB8hitipbqMRaqfVpZm3ylFFohqvA6h7nSBSOQkW+9Zx9C5Xwwt4HOrXxQoENwM/UvC8CwIugzWVbacDxIqkVgiOvxSRqMgiNz6G3bKjw2lOiFT/eDnFh72mIkyh5u/hRdtT6qO/7fwawswWNOMeG68bK2leG9elEksiCtZy+6RaJP9ALz+WnLb3VVg8uTzUg7frOaSqnOyiny+XzWc2C5qr5w0vyz7jQaJTf+zdQL1uQAwOfjckLeBqdcShWa0JinVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3+ft6SMVC4p95cIMPSX0HaZbO8mr81+ul8zYJ1LDcSk=; b=hSHqehYwD7MFwmE60RtmIjfQkWXsZBIAwOIRSowEINvfyfsJibS6QSUdvsReTbq9WlhDeXETLyn/vsaZwvi2jhogOjyRbTAtAeUm1c5qJlRm8KiuzMCYMbJLySV3k9sByZ6zxP7Bu6ddrSY7Of54D//QYvaAYTJ/HVy+CLo+ccOvevpKcXhysso2UsIxRQkMREShO2MmPsh5+YkRhWXml+3zRks9WzQ6ZpF6ItLZNFQZNPnSv9h2QSyoaAOVrLz1qccn0xOGW6h1tSahVmIIrwYUhmMa+4tjTCUTwoeG02WTlcqWKW67R1LZFppBYs5+qYVCT3nOon1q44+g42cd9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3+ft6SMVC4p95cIMPSX0HaZbO8mr81+ul8zYJ1LDcSk=; b=kuiF+ddovAmc1ceCe/dP3ZHE5h0yix9RfRgEkBeISeq2/RCUInynxdDGqxprOHyzSC6Q2l8MRL6j+p/7ZU3C0Tpy1JEkm21zTUhgLIyRq6buhEeXgNSiTZn6zzJoM+QlZJ93FJzL8s6uDOLtTv1XjOJ3AE3EVXV2Rf2qQHGPRw5PWY7BBMfymEJltWtZQ6VLTo/yO57qjGLELsdyl5mxBSO1zkLzA4z2wmmzkq8qRWLdWzywc+2sc2S8ceyobuvnRJCKzubVj8q1wQLfblOd8S4E3IsFpeoFxD3WrjILAhQx4S10yLkh8sCfKK8dYzmCisgZugxhj0U5TCaXmo1nRw== Received: from TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:39d::8) by OS7P286MB3808.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:242::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Wed, 10 Apr 2024 13:14:16 +0000 Received: from TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM ([fe80::12f8:ae5e:96cd:21cf]) by TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM ([fe80::12f8:ae5e:96cd:21cf%3]) with mapi id 15.20.7409.053; Wed, 10 Apr 2024 13:14:16 +0000 From: Dawei Li To: wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Dawei Li Subject: [PATCH] watchdog/wdt-main: Use cpumask_of() to avoid cpumask var on stack Date: Wed, 10 Apr 2024 21:13:59 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 X-TMN: [cvcm1DdHhFApAHmG8guPahqOkvN+PA0p] X-ClientProxiedBy: SG2PR02CA0134.apcprd02.prod.outlook.com (2603:1096:4:188::14) To TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:39d::8) X-Microsoft-Original-Message-ID: <20240410131359.3379-1-set_pte_at@outlook.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYTP286MB3564:EE_|OS7P286MB3808:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c2a24e6-6725-45c4-3c89-08dc59601fbf X-MS-Exchange-SLBlob-MailProps: 9IecXKUgicAfKI//0yoNlkeQDymwpEbTmGzQXC7VM48SfY5opAxjn8OMDCsEzQff97ou1P28TX048Q2M6MDGD1wEy5snxP7596o3ok+IoRbs1KhdWh0EJ3QN+nFccCz3VbILNrWjDScudTvXuCrx4T4jMM07HVy+ynonmy4KomeysS2AvdE7aWXfeKNjUmcq4H7K1hLqBVQSt4wyh6QlOd2hAPkx9ht3HEQNnJCuMGCURUZowy3H+0r4KnYif5N6SuR1nD+sDpdkhgrpassc6Sz1bJx4D4wEMX4K/PsQMgBT2z2DapCCv0Z+Wm6nn+r1kEXOAaLZd0eCzNmkaqaaJ6gZ5iHJKcO4W+dj6c16KYA9WlnfJgXOT7qSML+lfestHTMvV3m33vl0av9hjqdRP7dW398Hv91rF1dQTbbOR5HF6Lu09s20kze+8PeltXnia+ICoSCEcICuElTf0olHskjIpByuRnVPJLnehfctgIMkMvR8COSRhStBoo0rixPcwSEFEQ3JHoynqej/ZWyzff6Clp/BaPOAm/+GwqU1Ev2K1OXt6Jf7ge0KnMSa2IllgGFk+FmCVTW72sFJXr8nWhsosMgP5X58FaW0TbFNY/1xmv7KdYvaZLPA3ytSglnwWv7/D2m/7rkK92z0RWce4f7FMAcafPRy/j9LDA3JUxBJwZZ3t2qZW5nSefw/sFKRnEvl2n8bYf7+9wz732EUZXqhRwRFPTlEjlclFQnfoTw3q50h8f8ujA== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U1G7OiwgVW3o4cqmBJy8ZZTvnfSE4kzxLwTTizBCZVT/QlwqyjPNDgJDeI2pjwXMjKlpV80KpTXjqOmwjn728cQkLjBsubptDylzTfSeI8CCD6wJGjfCnV6gWx/AD9CMK/xfgftWmEfVSKTXBCPwqXG3/aLgCYhbHSYN4kTG3Z3msGKwK16/JcoqWjbXGuz6WsfLOFdIUlW9XsUIpyAVLCrJEXAu1RkvZbumGqjYMq++Kv83ISBfyn2M3bdiXuOumwH5y8Oo6mMQu7ajmeHLwl9WPekZPZUWR96ZfAFl/kkiJZJjtOaLV0PxiKMnHAzRewG4+p6DRohNfAGNXQJ/tvBlrMwaiSDqEk+xNcFdAicaMVBzS0+ZuRElZ8qrBCtsAcMPiv/BvjBDZDTv8ytgeRf0rMGRXaZCZzcGcKXMopz7h2CYGA0CqNpGiko9DLP9FpPM6kXjXzxb9//v9kzw0eU155T6RvXC79YD8nl0Wglrk3UC+wyLkH8wchmHJEgv88WtaYTKjug4a60bH/LYFzpcM1ycQmBH6emonZ1PNrf8kkt6qmhp6F4ISf8c5KWV5xNRYAFgXQz8rtXjd+vE8ShXubGqrHYjFTHRMrYTD8Sk2ZnHDc3kJHp/1S3t/W/a X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEFvO6uH8bMz9FRmF97n+bvCn38zkG4VFI6B/n18yupt0BN/TUluORPIFtfcWpivrJZmxuQoiystlzn9FfM4mbOdiyz+TmGU+4BdOCYU2iTwiN3IvmDOQge0Msm5Tpe6rOdjGF9nwdK5M6yB2A9fMyTyyQ8S0cvpEdVwATjxLbh1JOlXA2iETGoafkIcqOgm+sddhimRxFsdtFkYhoVjhgESq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Message-Id: 3c2a24e6-6725-45c4-3c89-08dc59601fbf X-MS-Exchange-CrossTenant-AuthSource: TYTP286MB3564.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2024 13:14:16.8352 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB3808 In general it's preferable to avoid placing cpumasks on the stack, as for large values of NR_CPUS these can consume significant amounts of stack space and make stack overflows more likely. Use cpumask_of() to avoid the need for a temporary cpumask on the stack Signed-off-by: Dawei Li Reviewed-by: Guenter Roeck --- drivers/watchdog/octeon-wdt-main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c index 0fe71f7e66d5..52d49e4e35a0 100644 --- a/drivers/watchdog/octeon-wdt-main.c +++ b/drivers/watchdog/octeon-wdt-main.c @@ -381,11 +381,7 @@ static int octeon_wdt_cpu_online(unsigned int cpu) /* Must set the irq affinity here */ if (octeon_has_feature(OCTEON_FEATURE_CIU3)) { - cpumask_t mask; - - cpumask_clear(&mask); - cpumask_set_cpu(cpu, &mask); - irq_set_affinity(irq, &mask); + irq_set_affinity(irq, cpumask_of(cpu)); } cpumask_set_cpu(cpu, &irq_enabled_cpus);