From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933430AbcCNUBf (ORCPT ); Mon, 14 Mar 2016 16:01:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932183AbcCNUBd (ORCPT ); Mon, 14 Mar 2016 16:01:33 -0400 Date: Mon, 14 Mar 2016 15:01:31 -0500 From: Josh Poimboeuf To: Jessica Yu Cc: Seth Jennings , Jiri Kosina , Vojtech Pavlik , Miroslav Benes , Petr Mladek , Rusty Russell , Steven Rostedt , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier Message-ID: <20160314200131.GA32496@treble.redhat.com> References: <1457726628-9171-1-git-send-email-jeyu@redhat.com> <1457726628-9171-3-git-send-email-jeyu@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1457726628-9171-3-git-send-email-jeyu@redhat.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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