Skip to contentSkip to conversation

Documentation: KUnit: Fix usage bug

PATCH In review Akira Kawata 2 participants 2 messages Feb 7, 2022

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

PATCH 1/1 Documentation: KUnit: Fix usage bug

Fix a bug of kunit documentation.

: Quoting Steve Pfetsch:
:
: kunit documentation is incorrect:
: https://kunit.dev/third_party/stable_kernel/docs/usage.html
: struct rectangle *self = container_of(this, struct shape, parent); :
:
: Shouldn't it be:
: struct rectangle *self = container_of(this, struct rectangle, parent); : ?

---
 Documentation/dev-tools/kunit/usage.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/dev-tools/kunit/usage.rst +1 -1
index 76af931a332c..1c83e7d60a8a 100644
@@ -242,7 +242,7 @@ example:
 
 	int rectangle_area(struct shape *this)
 	{
-		struct rectangle *self = container_of(this, struct shape, parent);
+		struct rectangle *self = container_of(this, struct rectangle, parent);
 
 		return self->length * self->width;
 	};
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Akira Kawata

Fix a bug of kunit documentation.

: Quoting Steve Pfetsch:
:
: kunit documentation is incorrect:
: https://kunit.dev/third_party/stable_kernel/docs/usage.html
: struct rectangle *self = container_of(this, struct shape, parent); :
:
: Shouldn't it be:
: struct rectangle *self = container_of(this, struct rectangle, parent); : ?

Quoted 1 line

Wow. I can't believe we let this go for this long...and even after doing an *almost* complete rewrite of that page.

Anyway, thanks for fixing this!