Remove unneeded code with notnull.cocci script
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 14 Jul 2010 02:05:47 +0000 (02:05 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 14 Jul 2010 02:05:47 +0000 (02:05 +0000)
commitc426218dfe7be48674302bd92f4fd9dfd4e339ec
treece5600c679a6d96606dd2209091d8a7a5e716a11
parent38c5103bae96f49352e861f2bcb5b1108c9ee189
Remove unneeded code with notnull.cocci script

The notnull.cocci script from Coccinelle finds places where you check if a
variable is NULL, but it's known not to be NULL. The check can be safely
removed. For example, this code would be caught by notnull:

if (!var) return;
if (var && var->fld) { ... }

It's needless to check again if var is not NULL because if it's in fact NULL,
it would have returned on the previous "if". This commit removes all the
trivial places where this pattern happens. Another patch will be generated for
the more complex cases.

SVN revision: 50241
src/bin/e_exec.c
src/modules/conf_fonts/e_int_config_fonts.c
src/modules/illume-keyboard/e_kbd_buf.c
src/modules/illume/e_kbd_buf.c
src/modules/pager/e_mod_main.c
src/modules/syscon/e_syscon.c