- struct declaration_field *field_decl;
- struct declaration_integer *ret = NULL;
-
- if (decl && bt_ctf_field_type(decl) == CTF_TYPE_INTEGER) {
- field_decl = (struct declaration_field *) decl;
- ret = ((struct declaration_integer *) field_decl->declaration);
- }
-
- return ret;
+ if (!decl || bt_ctf_field_type(decl) != CTF_TYPE_INTEGER)
+ return NULL;
+ return container_of(decl, const struct declaration_integer, p);