Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier

From: Josh Poimboeuf
Date: Mon Mar 14 2016 - 16:01:38 EST


On Fri, Mar 11, 2016 at 03:03:48PM -0500, Jessica Yu wrote:
> +/* Module can be either COMING or GOING */

IMO this comment doesn't really add anything: the below WARN_ON already
says as much. Also the location of the comment right above the function
is confusing: someone not familiar with the code might wonder why the
function is called klp_module_going() if the module can be either coming
or going. So I think the comment can just be removed.

> +void klp_module_going(struct module *mod)
> {
> - int ret;
> - struct module *mod = data;
> struct klp_patch *patch;
> struct klp_object *obj;
>
> - if (action != MODULE_STATE_COMING && action != MODULE_STATE_GOING)
> - return 0;
> + if (WARN_ON(mod->state != MODULE_STATE_GOING &&
> + mod->state != MODULE_STATE_COMING))
> + return;

--
Josh