Quoting Matt Roper (2018-02-01 19:53:13) > +#include <linux/cgroup.h> > + > +#include "i915_drv.h" > + > +struct i915_cgroup_data { > + struct cgroup_driver_data base; > +}; > + > +static inline struct i915_cgroup_data * > +cgrp_to_i915(struct cgroup_driver_data *data) > +{ Document your requirement that base is offset 0 (required for both i915_cgroup_alloc and i915_cgroup_free). BUILD_BUG_ON(offsetof(struct i915_cgroup_data, base)); (or make said code flexible) > + return container_of(data, struct i915_cgroup_data, base); > +} > + > +static struct cgroup_driver_data * > +i915_cgroup_alloc(struct cgroup_driver *drv) > +{ > + struct i915_cgroup_data *data; > + > + data = kzalloc(sizeof *data, GFP_KERNEL); > + return &data->base; > +} > + > +static void > +i915_cgroup_free(struct cgroup_driver_data *data) > +{ > + kfree(data); > +} -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html