Size: 1080
Comment:
|
← Revision 12 as of 2017-12-30 01:30:30 ⇥
Size: 1092
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 8: | Line 8: |
Here's a script that finds all functions returning (void*): attachment:find_voidp_funcs.pl | Here's a script that finds all functions returning (void*): [[attachment:find_voidp_funcs.pl]] |
Line 16: | Line 16: |
Another script has an embedded list of such function names (after the _END_), or can take such names on the commandline: attachment:type-convs.pl | Another script has an embedded list of such function names (after the _END_), or can take such names on the commandline: [[attachment:type-convs.pl]] |
Line 29: | Line 29: |
This script returns a patch for such assignments: attachment:voidp_vars.pl | This script returns a patch for such assignments: [[attachment:voidp_vars.pl]] |
(void*) conversions
Here are a few tips and scripts how to find unnecessary (void*) conversions.
Find (void*) functions
Here's a script that finds all functions returning (void*): find_voidp_funcs.pl
Example:
./find_voidp_funcs.pl linux-2.6.git/
Finding and removing type conversion on such assignments
Another script has an embedded list of such function names (after the _END_), or can take such names on the commandline: type-convs.pl
Example:
./type-convs.pl linux-2.6.git kmalloc
The output is a patch that removes these type conversions; the source files are kept unchanged.
(void*) variable assignments
Some kernel structures have variables meant to be private to some driver, normally named "priv" or "private"; these are of type "(void *)", and need not be casted to some other type.
This script returns a patch for such assignments: voidp_vars.pl
Example:
./voidp_vars.pl linux-2.6.git kmalloc