Skip to contentSkip to conversation

trivial: treewide: remove extra semicolon added by module_init/exit

PATCH Nicolas Ferre 3 participants 4 messages Jun 10, 2012 – Jun 12, 2012 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Nicolas Ferre

author Acked-by
#1 lore raw

(Not putting everybody in copy, but still replying)

Felipe,

On 06/06/2012 03:41 PM, Felipe Balbi :

Quoted 22 lines

The definition of module_init() and module_exit() already added the final semicolon creating a situation where most of our drivers end up with two semicolons at the end of every module_init()/module_exit() call.

To fix that, we add missing semicolons to the places which didn't have them and remove the semicolons from the definition of module_init/module_exit.

Patch generated with the following sed script:

$ sed -i 's/^module_\(init\|exit\)\s*\((\w\+)\)$/module_\1\2;/g' \
	$(git ls-files)

---

compile tested with allyesconfig, allnoconfig and allmodconfig on x86 only.

Unfortunately I couldn't Cc everybody on get_maintainer.pl's output due to recipient limits on TI's mail server.

[..]

Quoted 1 line
 drivers/net/ethernet/cadence/at91_ether.c             |    4 ++--

[..]

Quoted 5 lines
drivers/net/ethernet/cadence/at91_ether.c +0 -0
index 7788419..b107e7f 100644

drivers/net/ethernet/cadence/at91_ether.c static void __exit at91ether_exit(void) · line 1297

Quoted 10 lines
drivers/net/ethernet/cadence/at91_ether.c +2 -2
@@ -1290,8 +1290,8 @@ static void __exit at91ether_exit(void)
 	platform_driver_unregister(&at91ether_driver);
 }
 
-module_init(at91ether_init)
-module_exit(at91ether_exit)
+module_init(at91ether_init);
+module_exit(at91ether_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("AT91RM9200 EMAC Ethernet driver");

For this Atmel network driver, you can add my:

Best regards,

Signature · 1 line
Nicolas Ferre

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 7 lines · Stephen Hemminger

Given common kernel practice and the fact that only 16% of the uses of module_init/exit are without semicolon and that other kernel macros don't include semicolon.

I recommend going with the majority and common practice...
1. Fix the 636 places that use module_init()/exit without semicolon to include semicolon
2. Remove semicolon from module_init()/exit()

Um, yes. He should do exactly what he did.

It's a wart, let's fix it.

Thanks,
Rusty.
PS. CC's chopped; somewhere in there is a bad address...

#6 lore raw

Hi,

Quoted 9 lines · Rusty Russell
Quoted 7 lines · Stephen Hemminger

Given common kernel practice and the fact that only 16% of the uses of module_init/exit are without semicolon and that other kernel macros don't include semicolon.

I recommend going with the majority and common practice...
1. Fix the 636 places that use module_init()/exit without semicolon to include semicolon
2. Remove semicolon from module_init()/exit()

Quoted 7 lines

Um, yes. He should do exactly what he did.

It's a wart, let's fix it.

Thanks,
Rusty.
PS. CC's chopped; somewhere in there is a bad address...

let me know if you need me to update the patch.

Signature · 1 line
balbi
#7 lore raw

Hi,

Quoted 14 lines · Felipe Balbi

Hi,

Quoted 11 lines · Rusty Russell
Quoted 7 lines · Stephen Hemminger

Given common kernel practice and the fact that only 16% of the uses of module_init/exit are without semicolon and that other kernel macros don't include semicolon.

I recommend going with the majority and common practice...
1. Fix the 636 places that use module_init()/exit without semicolon to include semicolon
2. Remove semicolon from module_init()/exit()

Um, yes. He should do exactly what he did.

Quoted 7 lines
Quoted 5 lines

It's a wart, let's fix it.

Thanks,
Rusty.
PS. CC's chopped; somewhere in there is a bad address...

let me know if you need me to update the patch.

BTW, I sent a v2 of this patch [1] and that should be used instead. It contains a fix to the sed script so that it matches also module_init/exit when it contains a trailing whitespace at the end.

[1] http://marc.info/?l=linux-kernel&m=133899476223535

Signature · 1 line
balbi