Home:ALL Converter>kernel programming - Makefile error

kernel programming - Makefile error

Ask Time:2013-12-04T13:15:53         Author:user3064376

Json Formatter

i am not getting output for this code. What changes have to make in my Makefile?? code:

#define MODULE 
#define LINUX
#define __KERNEL__

#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/init.h>``
MODULE_LISENCE("GPL");
MODULE_AUTHOR("Peter Jay Salzman");


static u8 (mybyte='A');
static int (myint='i');

MODULE_PARM(mybyte, "b");
MODULE_PARM(myint, "i");

MODULE_PARM_DESC(mybyte, "this cannot do anything\n");

static int  __init hello5_init(void)

{
    printk("my byte %i\n",mybyte);
printk("my integer %i \n",myint);
 }
static void __exit hello5_exit()
{
printk("bye world\n");
}
module_init(hell05_init);
module_exit(helo5_exit);

Makefile: obj-m += hello5.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

exit:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

.PHONY: all, exit

Error:

 /home/kumarmagi/Desktop/amit/hello5/hello5.c:23:24: error: ‘mybyte’ undeclared     (first       use in this function)
    /home/kumarmagi/Desktop/amit/hello5/hello5.c:23:24: note: each undeclared identifier is reported only once for each function it appears in
    /home/kumarmagi/Desktop/amit/hello5/hello5.c:24:28: error: ‘myint’ undeclared (first use in this function)
    /home/kumarmagi/Desktop/amit/hello5/hello5.c:25:1: warning: no return statement in function returning non-void [-Wreturn-type]

Author:user3064376,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20367432/kernel-programming-makefile-error
yy