Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp664887lqd; Wed, 24 Apr 2024 13:05:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEE+ZMLmuyYZwR5FX46C6ftIX3OXNFBJVpLb+DmPr+TOMucFQs7yEjRUG5fDV9w7Wko5GrIfz4lfTiOBnZBKytLZ7HISx0WRoLo2Bpfg== X-Google-Smtp-Source: AGHT+IFCt3rMlIDL8h1JZFFd90pygtf16NVNx8jSnCq2oMbFc6anEoKZ16kYxuUJTNoJ3RrFDgtq X-Received: by 2002:a17:907:1b12:b0:a55:6c07:1569 with SMTP id mp18-20020a1709071b1200b00a556c071569mr906779ejc.0.1713989134323; Wed, 24 Apr 2024 13:05:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713989134; cv=pass; d=google.com; s=arc-20160816; b=hwh/PKlq4AKKADLo7kn1LX4JNLWzw47lfy5BkV0EH10elq5ZRBL5ScJCt1Xx7w4F39 KHHXxBgE6yXaPP33otWey4lNE4puyREwUpwA3M70Y81wOgqnUzb1YCKkHNoOZzAVNUgU vG/FpHLEiNCsWzgPUf2mXzyIvYEiYzmBwj/1xQvHYX8RIazpQlMPfp6icS9ORM5/Nu6o csYVgps//03V6gbnH42zqv6YXAwq+MBvfWxkh4uS6gkWCb24YushIPG4WsKdGuqo/Sab 885hfaodFRvO/npdo+82Me2oSM2Xv/4o7NVgNC6H+jOU2bHGjXeaHIZsjMW011GXCPmP 2+AA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=D5z4tFy3QCHZzwedTlQsNI/nutDSDWzD6FrlbXGLPYo=; fh=wVqU6T0Gn2AC6rPgI9925ZzqdHwWFEzrEfe0PmdtYM8=; b=O9NuGWZ2WeZJI/mxyOEXmzXilZLr00ETIQmq131KizlsxZ7biCydZfGNl82s4bbGeM oh4R3Xs/uXTsr9ApCBJGA6RugHDcODeKhS6uPu6uJi/QfKj/TeekQByinBqgvoxvzssy IpqINDI19hTcoi9U9O6WdZSjq/F/Lu+MwCXdBcAULneHUzKNYyhwHcUJFmAYusPGb/Si Q7tQanrBBFZXRT5JdPybKcwTV7ekrncriz0K1GA+vWvuSo7y3VRQncpRMCTxOXdK2J3K AEFl4kp7eQkMf86dvxDgyP8dMPVAkBaA4Cwu/N3fRDX3QI4sS8WLu2+FYvYGGi1etExr kV5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ppMoE3nE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j16-20020a170906279000b00a51a97c5fd4si8374970ejc.543.2024.04.24.13.05.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ppMoE3nE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 13AF81F244F5 for ; Wed, 24 Apr 2024 20:05:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D66B51442EA; Wed, 24 Apr 2024 20:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ppMoE3nE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sLyg5o9F" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D928142E8A; Wed, 24 Apr 2024 20:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989055; cv=none; b=Bk+VFyg5pFV8HSm1bl6goodNDNT+aART0ubUisWH2etY/wwzA1vcOdJh4ZEFSKXInXXKHe9MyGebCZAob9mSZBIEbrYvcNDBNz4Gq+0zrLvYlHQ5qet+isN0qTNZCvSKgA9Iyk45CJFWVKSIFAAWo/B8/X7cqJVb+sWSUU3PJpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989055; c=relaxed/simple; bh=qPqVNK7uWAmguOkWW+7sc6hrSU3AGtvOyIB9h2WeGAY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=HaeovEY25kZRecOvZJXE4hQUAfLh8MGyrp9s29nagbDGW+Ewi2GcU7CaVnUSDl/VVld2i5MjKkrZVJCqaG8JhmCi5gBTorM8IrGzB2QX3dwZV9ooYUsdkZHhupjwkRUMxVUjIq8giZCvvTidwm20A7vmmsO85SY41ZDM+oh4TUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ppMoE3nE; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sLyg5o9F; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 24 Apr 2024 20:04:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713989047; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D5z4tFy3QCHZzwedTlQsNI/nutDSDWzD6FrlbXGLPYo=; b=ppMoE3nEecgT7BHoDjA8O41+F/4OIzwV7PpJHK4e0WGfLdoHXyHs8En2xhICi0RacZdHby /2pUhAPSn4RO4O4nyJiZzj4Zu3ve3XHTR+/v8wL+j0IPVFwESEzVeIioPs6d6EHp6BpIw6 3zMIC+Wg3xkrZE502FePPjoxDYPaKPbXoa0srt8MkXzXC4YdjYDRkFeF2ryjDHydw3055Z LV1V6v0VfNQN+cVB9rw1i9mT2SlDjADjL5D4GZiUqtYmBbWI2071Jw2QY9saCgDnIz36fP XDlswjTpEH+mZ511MfHGAleOhu66wSQzT/2BYi80E28Wx+b/3Nu4FYaqNP0hRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713989047; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D5z4tFy3QCHZzwedTlQsNI/nutDSDWzD6FrlbXGLPYo=; b=sLyg5o9F76swgbTgiZP3exQvmSgbvGSs76/S0zt9ATW4SedySvv/335Tsc7JcHAO0r/ZqC DgPQXPAJJwqeynDQ== From: "tip-bot2 for Dawei Li" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/irq-bcm6345-l1: Avoid explicit cpumask allocation on stack Cc: Dawei Li , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240416085454.3547175-3-dawei.li@shingroup.cn> References: <20240416085454.3547175-3-dawei.li@shingroup.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171398904724.10875.2678089770204346248.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the irq/core branch of tip: Commit-ID: 6a9a52f74e3b82ff3f5398810c1b23ad497e2df5 Gitweb: https://git.kernel.org/tip/6a9a52f74e3b82ff3f5398810c1b23ad497e2df5 Author: Dawei Li AuthorDate: Tue, 16 Apr 2024 16:54:49 +08:00 Committer: Thomas Gleixner CommitterDate: Wed, 24 Apr 2024 21:23:49 +02:00 irqchip/irq-bcm6345-l1: Avoid explicit cpumask allocation on stack 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_first_and_and() to avoid the need for a temporary cpumask on the stack. Signed-off-by: Dawei Li Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240416085454.3547175-3-dawei.li@shingroup.cn --- drivers/irqchip/irq-bcm6345-l1.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c index eb02d20..90daa27 100644 --- a/drivers/irqchip/irq-bcm6345-l1.c +++ b/drivers/irqchip/irq-bcm6345-l1.c @@ -192,14 +192,10 @@ static int bcm6345_l1_set_affinity(struct irq_data *d, u32 mask = BIT(d->hwirq % IRQS_PER_WORD); unsigned int old_cpu = cpu_for_irq(intc, d); unsigned int new_cpu; - struct cpumask valid; unsigned long flags; bool enabled; - if (!cpumask_and(&valid, &intc->cpumask, dest)) - return -EINVAL; - - new_cpu = cpumask_any_and(&valid, cpu_online_mask); + new_cpu = cpumask_first_and_and(&intc->cpumask, dest, cpu_online_mask); if (new_cpu >= nr_cpu_ids) return -EINVAL;