linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] lib: cleanup dead code from rbtree_test.c
@ 2017-12-17 10:22 Pravin Shedge
  2017-12-17 15:55 ` Davidlohr Bueso
  0 siblings, 1 reply; 3+ messages in thread
From: Pravin Shedge @ 2017-12-17 10:22 UTC (permalink / raw)
  To: dave, akpm, linux-kernel; +Cc: pravin.shedge4linux

lib/rbtree_test.c code allows to compile either as a loadable modules or
builtin into the kernel.

Current code returns -EAGAIN on successful termination from module_init.
Such a fail will directly unload the module and hence there is no scope
to execute rbtree_test_exit on module_exit.

This patch will cleanup dead code from rbtree_test.c

Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
---
 lib/rbtree_test.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
index 7d36c1e..5cd2f26 100644
--- a/lib/rbtree_test.c
+++ b/lib/rbtree_test.c
@@ -397,13 +397,7 @@ static int __init rbtree_test_init(void)
 	return -EAGAIN; /* Fail will directly unload the module */
 }
 
-static void __exit rbtree_test_exit(void)
-{
-	printk(KERN_ALERT "test exit\n");
-}
-
 module_init(rbtree_test_init)
-module_exit(rbtree_test_exit)
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Michel Lespinasse");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] lib: cleanup dead code from rbtree_test.c
  2017-12-17 10:22 [PATCH 2/2] lib: cleanup dead code from rbtree_test.c Pravin Shedge
@ 2017-12-17 15:55 ` Davidlohr Bueso
  2017-12-19 17:51   ` Pravin Shedge
  0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2017-12-17 15:55 UTC (permalink / raw)
  To: Pravin Shedge; +Cc: akpm, linux-kernel

On Sun, 17 Dec 2017, Pravin Shedge wrote:

>lib/rbtree_test.c code allows to compile either as a loadable modules or
>builtin into the kernel.
>
>Current code returns -EAGAIN on successful termination from module_init.
>Such a fail will directly unload the module and hence there is no scope
>to execute rbtree_test_exit on module_exit.
>
>This patch will cleanup dead code from rbtree_test.c

Being completely harmless I'd rather leave this as is. If removed, the
module breaks generic layout.

Thanks,
Davidlohr

>
>Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
>---
> lib/rbtree_test.c | 6 ------
> 1 file changed, 6 deletions(-)
>
>diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
>index 7d36c1e..5cd2f26 100644
>--- a/lib/rbtree_test.c
>+++ b/lib/rbtree_test.c
>@@ -397,13 +397,7 @@ static int __init rbtree_test_init(void)
> 	return -EAGAIN; /* Fail will directly unload the module */
> }
>
>-static void __exit rbtree_test_exit(void)
>-{
>-	printk(KERN_ALERT "test exit\n");
>-}
>-
> module_init(rbtree_test_init)
>-module_exit(rbtree_test_exit)
>
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("Michel Lespinasse");
>-- 
>2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] lib: cleanup dead code from rbtree_test.c
  2017-12-17 15:55 ` Davidlohr Bueso
@ 2017-12-19 17:51   ` Pravin Shedge
  0 siblings, 0 replies; 3+ messages in thread
From: Pravin Shedge @ 2017-12-19 17:51 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Andrew Morton, linux-kernel

On Sun, Dec 17, 2017 at 9:25 PM, Davidlohr Bueso <dave@stgolabs.net> wrote:
> On Sun, 17 Dec 2017, Pravin Shedge wrote:
>
>> lib/rbtree_test.c code allows to compile either as a loadable modules or
>> builtin into the kernel.
>>
>> Current code returns -EAGAIN on successful termination from module_init.
>> Such a fail will directly unload the module and hence there is no scope
>> to execute rbtree_test_exit on module_exit.
>>
>> This patch will cleanup dead code from rbtree_test.c
>
>
> Being completely harmless I'd rather leave this as is. If removed, the
> module breaks generic layout.
>
Right this code is not harmless but at the same time I am not sure
How other modules [from lib/test_sort.c] added in kernel ?

Little curious, Just for my knowledge
 how it breaks generic layout ? and what will be the impact ?

> Thanks,
> Davidlohr
>
>
>>
>> Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
>> ---
>> lib/rbtree_test.c | 6 ------
>> 1 file changed, 6 deletions(-)
>>
>> diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
>> index 7d36c1e..5cd2f26 100644
>> --- a/lib/rbtree_test.c
>> +++ b/lib/rbtree_test.c
>> @@ -397,13 +397,7 @@ static int __init rbtree_test_init(void)
>>         return -EAGAIN; /* Fail will directly unload the module */
>> }
>>
>> -static void __exit rbtree_test_exit(void)
>> -{
>> -       printk(KERN_ALERT "test exit\n");
>> -}
>> -
>> module_init(rbtree_test_init)
>> -module_exit(rbtree_test_exit)
>>
>> MODULE_LICENSE("GPL");
>> MODULE_AUTHOR("Michel Lespinasse");
>> --
>> 2.7.4
>>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-19 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-17 10:22 [PATCH 2/2] lib: cleanup dead code from rbtree_test.c Pravin Shedge
2017-12-17 15:55 ` Davidlohr Bueso
2017-12-19 17:51   ` Pravin Shedge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).