Warnings compiling a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I'm trying to compile the kernel module below with the following command
line and get the following warnings. Is there anyway to get rid of them?

thanks
mick

gcc -Wall -Wstrict-prototypes -Winline -O2 -fomit-frame-pointer
-fno-strict-aliasing -I/usr/src/linux/include -c mymod.c -o mymod.o
In file included from /usr/src/linux/include/linux/mm.h:4,
                 from /usr/src/linux/include/linux/slab.h:14,
                 from /usr/src/linux/include/linux/proc_fs.h:5,
                 from mymod.c:6:
/usr/src/linux/include/linux/sched.h: In function `mmdrop':
/usr/src/linux/include/linux/sched.h:754: warning: can't inline call to
`__mmdrop'
/usr/src/linux/include/linux/sched.h:758: warning: called from here




#define __KERNEL__
#define MODULE

#include <linux/module.h>
#include <linux/init.h>
#include <linux/proc_fs.h>

MODULE_AUTHOR("Michael Covi");
MODULE_DESCRIPTION("Fun with modules Part 1");
MODULE_LICENSE("GPL");

static struct proc_dir_entry* myproc;

static int  read_proc_mymod(char *page, char **start, off_t off,
                                 int count, int *eof, void *data) {

	MOD_DEC_USE_COUNT;

	return 0;

}

static int  write_proc_mymod(struct file *file, const char *buffer,
			   unsigned long count, void *data) {

	static int i = 0;

	i++;
	printk("write_proc_mymod called %d times\n", i);
	printk("In the buffer was %s\n", buffer);
	printk("The count was %d\n", (int)count);
	printk("The data was %s \n", (char*)data);

	MOD_INC_USE_COUNT;

	return count;

}

static void __init fini(void) {

   if (myproc != NULL)
		remove_proc_entry("mymod", NULL);

	printk("Howdy, we've cleaned up the module\n");

}

static int __init init(void) {

	printk("Howdy, were initialising the module\n");

	myproc = create_proc_entry("mymod", 0644, NULL);
	if (myproc == NULL) {
		printk(KERN_CRIT "Error registering procfs entry mymod\n");
		fini();
	}

	myproc->read_proc = read_proc_mymod;
	myproc->write_proc = write_proc_mymod;

	return 0;

}

module_init(init);
module_exit(fini);


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux