All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Bartosz Golaszewski" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Yury Norov <yury.norov@gmail.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] bitmap: Define a cleanup function for bitmaps
Date: Fri, 26 Jan 2024 12:53:38 -0000	[thread overview]
Message-ID: <170627361832.398.12750100629168138899.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240122124243.44002-2-brgl@bgdev.pl>

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 <bartosz.golaszewski@linaro.org>
AuthorDate:    Mon, 22 Jan 2024 13:42:40 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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 <bartosz.golaszewski@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
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 <linux/align.h>
 #include <linux/bitops.h>
+#include <linux/cleanup.h>
 #include <linux/errno.h>
 #include <linux/find.h>
 #include <linux/limits.h>
@@ -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);

  reply	other threads:[~2024-01-26 12:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 12:42 [RESEND PATCH v2 0/4] genirq/irq_sim: misc updates Bartosz Golaszewski
2024-01-22 12:42 ` [RESEND PATCH v2 1/4] bitmap: define a cleanup function for bitmaps Bartosz Golaszewski
2024-01-26 12:53   ` tip-bot2 for Bartosz Golaszewski [this message]
2024-01-22 12:42 ` [RESEND PATCH v2 2/4] genirq/irq_sim: remove unused field from struct irq_sim_irq_ctx Bartosz Golaszewski
2024-01-26 12:53   ` [tip: irq/core] genirq/irq_sim: Remove " tip-bot2 for Bartosz Golaszewski
2024-01-22 12:42 ` [RESEND PATCH v2 3/4] genirq/irq_sim: order headers alphabetically Bartosz Golaszewski
2024-01-26 12:53   ` [tip: irq/core] genirq/irq_sim: Order " tip-bot2 for Bartosz Golaszewski
2024-01-22 12:42 ` [RESEND PATCH v2 4/4] genirq/irq_sim: shrink code by using cleanup helpers Bartosz Golaszewski
2024-01-26 12:53   ` [tip: irq/core] genirq/irq_sim: Shrink " tip-bot2 for Bartosz Golaszewski
2024-01-26 21:05     ` Nathan Chancellor
2024-01-26 22:15       ` Bartosz Golaszewski
2024-01-29 10:13         ` Ingo Molnar
2024-01-29 10:37           ` Bartosz Golaszewski
2024-01-29 10:16   ` [tip: irq/core] genirq/irq_sim: Shrink code by using <linux/cleanup.h> helpers tip-bot2 for Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170627361832.398.12750100629168138899.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.