lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170627361832.398.12750100629168138899.tip-bot2@tip-bot2>
Date: Fri, 26 Jan 2024 12:53:38 -0000
From: "tip-bot2 for Bartosz Golaszewski" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
 Thomas Gleixner <tglx@...utronix.de>,
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Yury Norov <yury.norov@...il.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org, maz@...nel.org
Subject: [tip: irq/core] bitmap: Define a cleanup function for bitmaps

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@...aro.org>
AuthorDate:    Mon, 22 Jan 2024 13:42:40 +01:00
Committer:     Thomas Gleixner <tglx@...utronix.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@...aro.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Acked-by: Yury Norov <yury.norov@...il.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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ