From nobody Wed Oct 8 00:41:24 2025 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 EFAB92E7F13; Thu, 3 Jul 2025 14:00:33 +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=1751551235; cv=none; b=tUAQ6z3bqOBtynX7HYofyhY2mIUBDCQ3096dmgRBkiqCUeRzaIk2e3hg/BL8z78bNYmCI77AWdA7EwaFS/Ka5XgOb6uE/2crRvZ761YuBs0HAqIgGmgfsBr9Domj3WGt5weAPlvdN2h/s9iW7Egol1bl+zs5J8V+5iNikFB4Y2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751551235; c=relaxed/simple; bh=84B9ECo25r7Y29uGZxqNhX2GCI/7c9dDBhQ+n7APn50=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=iRB8H3zM8R4MMSm19iqxVxgmKOYU+A4pn9dH/EiWyeFjDnywlUpmAP9Q42WVGC/Z3xpcOsAIXNgeNsN5hTDjXELpIOKvCW8eU0q8El1J8+W83tIDKJ0dEQZpzgeNbDD8zXSeNYaJeIuTDhh4IspPSQ25UigDTPteHr1C5t+jVQI= 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=QPpR4y96; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XfQnyi4d; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QPpR4y96"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XfQnyi4d" Date: Thu, 03 Jul 2025 14:00:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751551232; 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=0eteJ/VcNVDl6VY87maxudzOv9HXtWF6OdZyM6LEZ44=; b=QPpR4y96lrVBrnMILWUKCPr0s8lPoAPtzktvg5Df2KkU4REz/gHhT5n1381FV7rvwBwYs3 qMTCFFbxhR1qFYPbFtfUWAN8aWPQhRouqWvNz4o4BnC2MMU9OxsnH9xObpneV9Roh511CB qYkeQwwpA+3T7mXM0axO1ggFYagbUFXX/uwCILxZ3jPpahM0g15E1Ydcr9aouFX/VIoJYi oeKXTiTPJykbtC0sdd+eFp+fLPAF9rL4PGO1soyaIemuxou1cCacOxx+PXfJPVSxTe4BKH NIzOznOoppTVdSr5s0M8DxswNsiAVuuT5bopNm9pJ8tRCny7Ie0XYK8ENQnNDQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751551232; 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=0eteJ/VcNVDl6VY87maxudzOv9HXtWF6OdZyM6LEZ44=; b=XfQnyi4dCJv9qR7s8eYgShIV8VXfC/9Qmq8wPdoYXgUEEQ1evzjxoWN2iYmBsapUj/jmeN /t1mlYWePC6SczBw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/drivers] irqchip/alpine-msi: Convert to lock guards Cc: Thomas Gleixner , Nam Cao , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C7886b9595aaf8e102f79364784f68dec9c49b023=2E17508?= =?utf-8?q?60131=2Egit=2Enamcao=40linutronix=2Ede=3E?= References: =?utf-8?q?=3C7886b9595aaf8e102f79364784f68dec9c49b023=2E175086?= =?utf-8?q?0131=2Egit=2Enamcao=40linutronix=2Ede=3E?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175155123134.406.9342162435788928180.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/drivers branch of tip: Commit-ID: 71476f915f92cd9fb209f8729d700703ec3c36bc Gitweb: https://git.kernel.org/tip/71476f915f92cd9fb209f8729d700703e= c3c36bc Author: Thomas Gleixner AuthorDate: Thu, 26 Jun 2025 16:49:05 +02:00 Committer: Thomas Gleixner CommitterDate: Thu, 03 Jul 2025 15:49:25 +02:00 irqchip/alpine-msi: Convert to lock guards Convert lock/unlock pairs to guards and tidy up the code. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Nam Cao Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/7886b9595aaf8e102f79364784f68dec9c49b023.= 1750860131.git.namcao@linutronix.de --- drivers/irqchip/irq-alpine-msi.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-= msi.c index 7e379a6..cf188e5 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -60,19 +60,12 @@ static int alpine_msix_allocate_sgi(struct alpine_msix_= data *priv, int num_req) { int first; =20 - spin_lock(&priv->msi_map_lock); - - first =3D bitmap_find_next_zero_area(priv->msi_map, priv->num_spis, 0, - num_req, 0); - if (first >=3D priv->num_spis) { - spin_unlock(&priv->msi_map_lock); + guard(spinlock)(&priv->msi_map_lock); + first =3D bitmap_find_next_zero_area(priv->msi_map, priv->num_spis, 0, nu= m_req, 0); + if (first >=3D priv->num_spis) return -ENOSPC; - } =20 bitmap_set(priv->msi_map, first, num_req); - - spin_unlock(&priv->msi_map_lock); - return priv->spi_first + first; } =20 @@ -80,11 +73,8 @@ static void alpine_msix_free_sgi(struct alpine_msix_data= *priv, unsigned int sgi { int first =3D sgi - priv->spi_first; =20 - spin_lock(&priv->msi_map_lock); - + guard(spinlock)(&priv->msi_map_lock); bitmap_clear(priv->msi_map, first, num_req); - - spin_unlock(&priv->msi_map_lock); } =20 static void alpine_msix_compose_msi_msg(struct irq_data *data, struct msi_= msg *msg)