#!/usr/bin/perl
#
# Finds all functions returning a (void*).
# To be used with the type-convs.pl script, which looks for
# type-changed assignments of such functions - like this:
#   type *x = (type*) function().
# According to http://kernelnewbies.org/KernelJanitors/Todo 
# this is deprecated.

$kernel_dir=shift || die "Need a directory argument (kernel sources).\n";

@ARGV=split(/\0/, `find "$kernel_dir" -type f -iname "*.c" -print0`);
die "No sources found.\n" unless @ARGV;

# Print output sorted.
open(STDOUT, "| sort -u") || die "Cannot start sort: $!\n";

$/=undef;
while (<>)
{
	print "$1\n" while
		m{
		void \s* \* \s*
		(\w+) \s* \(
		}xg;
}

