From: Cody P Schafer Date: Tue, 31 May 2016 19:30:40 +0000 (-0400) Subject: tcon: avoid error 'expected `void *` but argument is of type `const void *`' in tcon_... X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=95573b36fd8130d5925f877a83b959c22aac1dfd tcon: avoid error 'expected `void *` but argument is of type `const void *`' in tcon_container_of() I did not see any failures of other modules with this change, but I'm not completely certain there are no cases that it breaks. Signed-off-by: Cody P Schafer --- diff --git a/ccan/tcon/tcon.h b/ccan/tcon/tcon.h index 1dbadafc..247a7331 100644 --- a/ccan/tcon/tcon.h +++ b/ccan/tcon/tcon.h @@ -330,7 +330,7 @@ canary, tcon_container_of_((member_ptr), \ tcon_offset((x), canary))) -static inline void *tcon_container_of_(void *member_ptr, size_t offset) +static inline void *tcon_container_of_(const void *member_ptr, size_t offset) { return member_ptr ? (char *)member_ptr - offset : NULL; }