mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
btrfs: define the AUTO_KFREE/AUTO_KVFREE helper macros
These are two simple macros which ensure that a pointer is initialized to NULL and with the proper cleanup attribute for it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
285c3ab28e
commit
d00cbce0a7
@@ -13,6 +13,13 @@
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/bio.h>
|
||||
|
||||
/*
|
||||
* Convenience macros to define a pointer with the __free(kfree) and
|
||||
* __free(kvfree) cleanup attributes and initialized to NULL.
|
||||
*/
|
||||
#define AUTO_KFREE(name) *name __free(kfree) = NULL
|
||||
#define AUTO_KVFREE(name) *name __free(kvfree) = NULL
|
||||
|
||||
/*
|
||||
* Enumerate bits using enum autoincrement. Define the @name as the n-th bit.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user