pstore: remove __exit annotation for ramoops_remove
PATCH 1/1 pstore: remove __exit annotation for ramoops_remove
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
fs/pstore/ram.c +1 -1
@@ -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;
Luck, Tony
reviewer-static int __exit ramoops_remove(struct platform_device *pdev) +static int ramoops_remove(struct platform_device *pdev)
Arnd,
Thanks. I folded that fix into the commit that made the error and rebased (I don't believe anyone is foolish enough to base work on my "next" branch)
-Tony
Quoted 9 lines · Arnd Bergmann
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' offs/built-in.o: defined in discarded section `.exit.text' offs/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.
Quoted 17 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes 2adb611ef932 ("pstore: add pstore unregister")fs/pstore/ram.c +1
-1@@ -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;