aboutsummaryrefslogblamecommitdiffstats
path: root/tasks/04/coding_style.c
blob: cebe4e54b994efa086a87924ee0f849a4f1f9d15 (plain) (tree)


































                                                                     
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
int do_work(int *my_int, int retval)
{
	int x;
	int y = *my_int;
	int z;

	for(x = 0 ; x < *my_int ; ++x)
		udelay(10);
	if (y < 10)
		/* That was a long sleep, tell userspace about it. */
		pr_debug("We slept a long time!");
	z = x * y;

	return z;
}

int my_init(void)
{
	int x = 10;

	x = do_work(&x, x);

	return x;
}

void my_exit(void)
{
}

module_init(my_init);
module_exit(my_exit);