From patchwork Fri Jan 26 12:53:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 192584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp635813dyb; Fri, 26 Jan 2024 04:54:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFjBR5g6KSHimfPJGk3K5TXPXsgilMgZ9j1DSxh3nt8DEP6LYMDn0cmL6vOsCAqpycO0di X-Received: by 2002:a05:622a:5ca:b0:42a:6826:395 with SMTP id d10-20020a05622a05ca00b0042a68260395mr1948669qtb.23.1706273669508; Fri, 26 Jan 2024 04:54:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706273669; cv=pass; d=google.com; s=arc-20160816; b=BDSCnSMG9JRfW9tDcGv6CWFni488WtAbsDtN4JC7Egh7hxvOYT5D8U4Rk8IpTuTxrr jX4F5zaIPNzYYsIBhtDojsYtOyF/GaQqt0yx9qs6kDh96Qa5UeEToUm1zhqgDQrbuHab gHFocU5Rq53lrDRSYw3MPIBODocOSABQuHbK4htbMzQVA52gbXQwM5AB/INkNxvnxpV3 ZvvmFJt2WzM9lbtd54PlmvMHVeTSXPK7naJtlrpfZWDxGfGfK7weGexnccNhVql5tP9c ayJrbKNL4OmUyuH2rydmYLQoBq+n0U6QANpk6YQbc65xPIUX9P9itCqMPm+NpkqPwRbP JDNQ== 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=ft2WJzQF+PY1zHfzprvk0m7UItI04v5JPkKm6TXQoS0=; fh=/A0WPsDuwK+Wl2i0oV/ew2NS/gtzSegvuWqgRCYKW3c=; b=Uf2BO28PqrHtGCFrBnASxMsmMbWRct7byLwPvh6JBe7hqwymgrza7OAfIcV4Dkolpm KuBoGBIHVC3RE4xCYI+4jCTMvYkjY5vllWzBNmIVaO7fFTxG0kaIdkB9XjDle2NoPgK+ N+KG8EeFZgQcHQ2KFcqUNYt/x6BoQc8/kBobu+tcZLhzxDOPic7j3ihZqVlzVikxQAJU yAQ7rOAHUUpzyn9jCA2W1HP+DQfVVplwqNTTlgR2SEag3GToQfWhXVqZUG1ve0/THu1f 7zDDYzoWKwvtbnYxOlkl2i2F1xOke7fbKEmiLDeBgliLPDkjEMMFg/tZsxeQKuTLsMi5 lDLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YRvivAIC; 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-40105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40105-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v14-20020ac8578e000000b00421af2e8f53si1149290qta.624.2024.01.26.04.54.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 04:54:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YRvivAIC; 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-40105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40105-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5082F1C24496 for ; Fri, 26 Jan 2024 12:54:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5364A1BDF8; Fri, 26 Jan 2024 12:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YRvivAIC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WKmwjGIa" 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 2C3661B7E8; Fri, 26 Jan 2024 12:53:40 +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=1706273622; cv=none; b=Ir2hlDBjo2Cy0EEr/UpY0OKXyyTpSk86Ku9hVEOGnclAH0+0Sp27Qy8MY82O6kzTcr1j2yXyNh/dvjHcJl+W8ed4ZotMiYu6h38V2mj9a8x5s1sV5aFCf4CllnXIiY3cr4LnMeWlh7XFXrUGRSJJtDTRov+47Mm0Z4fWDs2YNDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706273622; c=relaxed/simple; bh=crEkeVj7Bs+xMpRjnPknM/Yqxm8h3ndBVuH6Jl7K/Mw=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=YK7rv/ySP3YVirAbqvbSpSSKTg9e6KZRdisstnU4/iT4ZFQNW8cIajAnsF2yOg/e7BXae2a0nR0whD16hj60uOYb5iRyz27D24DyLCXFCvPRS2mkCbHCsxj171u+N95JuHSRx205vY9Rssf1YqVYJS3hgWKgey9ZG/QVtK53EcI= 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=YRvivAIC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WKmwjGIa; 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: Fri, 26 Jan 2024 12:53:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706273619; 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=ft2WJzQF+PY1zHfzprvk0m7UItI04v5JPkKm6TXQoS0=; b=YRvivAIC9E+lnCavi2pAnhQC5O1opjJYoWW9rjsrffB6j6n8CaXK7x8OH+m/RoNkwM08ko X2gLmZZAFz/q+sLKtn+0SYNNhSiG1diBoZzLR9X+zINDSLCDB+hkXKmne7CnAS2HEVJ0lI tdSRsBimswNdGQPJN3fG8+FT2piyX9TP8VJbF56gDPsfrLjBIouGTFz4lff6GlkYDZkTSU /8MzajJD8oxl/HeuIWJMidu3CRGvissYfW6fbEPK0KAuxeEtGqcQqwmdMUDw2aJLb86bYU 5G7251Ky1mr+yRcabiYzAsrkXHJvyoCxTR1HUVSUYXPFpr7yeZsXn59Q2HDm3Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706273619; 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=ft2WJzQF+PY1zHfzprvk0m7UItI04v5JPkKm6TXQoS0=; b=WKmwjGIawcCS3ps325F5cdDRwZjH/Su37OChK1NyyBWfR+xNg6dvEb004qQBOt57bMsULs EZSUqR9t447VCPDA== From: "tip-bot2 for Bartosz Golaszewski" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] bitmap: Define a cleanup function for bitmaps Cc: Bartosz Golaszewski , Thomas Gleixner , Andy Shevchenko , Yury Norov , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240122124243.44002-2-brgl@bgdev.pl> References: <20240122124243.44002-2-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170627361832.398.12750100629168138899.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789157619357716799 X-GMAIL-MSGID: 1789157619357716799 The following commit has been merged into the irq/core branch of tip: Commit-ID: d12a82848eac28d248e67940378fe4a72b0a8cd3 Gitweb: https://git.kernel.org/tip/d12a82848eac28d248e67940378fe4a72b0a8cd3 Author: Bartosz Golaszewski AuthorDate: Mon, 22 Jan 2024 13:42:40 +01:00 Committer: Thomas Gleixner CommitterDate: Fri, 26 Jan 2024 13:44:48 +01:00 bitmap: Define a cleanup function for bitmaps Add support for autopointers for bitmaps allocated with bitmap_alloc() et al. Signed-off-by: Bartosz Golaszewski Signed-off-by: Thomas Gleixner Reviewed-by: Andy Shevchenko Acked-by: Yury Norov Link: https://lore.kernel.org/r/20240122124243.44002-2-brgl@bgdev.pl --- include/linux/bitmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 9945143..df24c8f 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -127,6 +128,8 @@ unsigned long *bitmap_alloc_node(unsigned int nbits, gfp_t flags, int node); unsigned long *bitmap_zalloc_node(unsigned int nbits, gfp_t flags, int node); void bitmap_free(const unsigned long *bitmap); +DEFINE_FREE(bitmap, unsigned long *, if (_T) bitmap_free(_T)) + /* Managed variants of the above. */ unsigned long *devm_bitmap_alloc(struct device *dev, unsigned int nbits, gfp_t flags);