From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757642AbbJVQMn (ORCPT ); Thu, 22 Oct 2015 12:12:43 -0400 Received: from m50-134.163.com ([123.125.50.134]:55679 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757166AbbJVQMl (ORCPT ); Thu, 22 Oct 2015 12:12:41 -0400 Date: Fri, 23 Oct 2015 00:09:33 +0800 From: Geliang Tang To: Arnd Bergmann Cc: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck , linux-kernel@vger.kernel.org, Geliang Tang Subject: Re: [PATCH] pstore: remove __exit annotation for ramoops_remove Message-ID: <20151022160933.GA1893@bogon> References: <4192179.KJLgHAoH2d@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4192179.KJLgHAoH2d@wuerfel> User-Agent: Mutt/1.5.24 (2015-08-30) X-CM-TRANSID: DtGowEBJMnNNCilWf9t+AQ--.755S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XFy5Zw4Uur48Wr1rur1xZrb_yoWkZwb_Gw 4vvFyxur40vryjyr13trnxAF90kr4DtFZ5Kr1kJFsIk3WxtwsFvrZ0yF9a9ry8Xr4UKF4D G3y3trW8uw13WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjvJmUUUUUU== X-Originating-IP: [116.77.148.132] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNRCbmVSIJojVFwAAsX Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2015 at 04:52:33PM +0200, Arnd Bergmann wrote: > The remove function of a device driver should not be marked > __exit, because that section gets discarded for built-in drivers, > and it is still possible to manually unbind a driver from a > device, which would result in a runtime error. > > The kernel also produces a link error for this when the module > is built-in: > > `ramoops_remove' referenced in section `.data' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o I can't see why it wasn't reported as an error on my machine. But I think you are right. __exit should't be there. Acked-by: Geliang Tang > > Signed-off-by: Arnd Bergmann > Fixes: 2adb611ef932 ("pstore: add pstore unregister") > > diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c > index 68889a727bc7..319c3a60cfa5 100644 > --- a/fs/pstore/ram.c > +++ b/fs/pstore/ram.c > @@ -578,7 +578,7 @@ fail_out: > return err; > } > > -static int __exit ramoops_remove(struct platform_device *pdev) > +static int ramoops_remove(struct platform_device *pdev) > { > struct ramoops_context *cxt = &oops_cxt; >