X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcontainer_of%2Fcontainer_of.h;h=de3f4505162a5416f477d5624e0049da6d2abeec;hp=1f4b18e4426a1c3c0bfc5c47e2a4e807ae7e2a52;hb=18636637ee013ef828cb04b2b7bb4a4922324475;hpb=650c775ff00cccd03fc84e7789a03c51d9839004 diff --git a/ccan/container_of/container_of.h b/ccan/container_of/container_of.h index 1f4b18e4..de3f4505 100644 --- a/ccan/container_of/container_of.h +++ b/ccan/container_of/container_of.h @@ -3,7 +3,7 @@ #include #include "config.h" -#include "check_type/check_type.h" +#include /** * container_of - get pointer to enclosing structure @@ -15,13 +15,16 @@ * subtraction to return the pointer to the enclosing type. * * Example: - * struct info - * { + * struct foo { + * int fielda, fieldb; + * // ... + * }; + * struct info { * int some_other_field; * struct foo my_foo; * }; * - * struct info *foo_to_info(struct foo *foop) + * static struct info *foo_to_info(struct foo *foo) * { * return container_of(foo, struct info, my_foo); * } @@ -42,13 +45,7 @@ * subtraction to return the pointer to the enclosing type. * * Example: - * struct info - * { - * int some_other_field; - * struct foo my_foo; - * }; - * - * struct info *foo_to_info(struct foo *foop) + * static struct info *foo_to_i(struct foo *foo) * { * struct info *i = container_of_var(foo, i, my_foo); * return i;