Skip to contentSkip to conversation

kunit: Use gfp in kunit_alloc_resource() kernel-doc

PATCH In review Stephen Boyd 2 participants 2 messages Mar 15, 2023 – Mar 16, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kunit: Use gfp in kunit_alloc_resource() kernel-doc

Copy/pasting the code from the kernel-doc here doesn't compile because kunit_alloc_resource() takes a gfp flags argument. Pass the gfp argument from the caller to complete the example.

---
 include/kunit/resource.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/kunit/resource.h +1 -1
index cf6fb8f2ac1b..c0d88b318e90 100644
@@ -72,7 +72,7 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource *);
  *		params.gfp = gfp;
  *
  *		return kunit_alloc_resource(test, kunit_kmalloc_init,
- *			kunit_kmalloc_free, &params);
+ *			kunit_kmalloc_free, gfp, &params);
  *	}
  *
  * Resources can also be named, with lookup/removal done on a name

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stephen Boyd

Copy/pasting the code from the kernel-doc here doesn't compile because kunit_alloc_resource() takes a gfp flags argument. Pass the gfp argument from the caller to complete the example.

---

Nice catch!

Cheers,
-- David

Quoted 22 lines
 include/kunit/resource.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/kunit/resource.h +1 -1
index cf6fb8f2ac1b..c0d88b318e90 100644
@@ -72,7 +72,7 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource *);
  *             params.gfp = gfp;
  *
  *             return kunit_alloc_resource(test, kunit_kmalloc_init,
- *                     kunit_kmalloc_free, &params);
+ *                     kunit_kmalloc_free, gfp, &params);
  *     }
  *
  * Resources can also be named, with lookup/removal done on a name

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6 --
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git