1, warning:passing argument 2 of ' REQUEST_IRQ ' from incompatible pointer type
Http://blog.sina.com.cn/s/blog_7321be1101012gek.html
warning:passing argument 2 of ' REQUEST_IRQ ' from incompatible pointer type
my request The _IRQ function is called as follows:
if (Request_irq (Key_info->irq_no, Key_ Eint_handler, irqf_disabled, "Mini2440_key", &i))
{
return-1;
}
key The _eint_handler function is prototyped as follows:
static void Key_eint_handler (int IRQ, void *dev_id,struct pt_regs *regs)
The problem is the prototype of the Key_eint_handler function,
Should be by:
static void Key_eint_handler (int irq, void *dev_id,struct pt_regs *regs)//Wrong notation
Switch
static irqreturn_t key_eint_handler (int irq, void *dev_id)//correct notation
the reason from the kernel source code to start ...
in theLinux/include/linux/interrupt.h, there's such a definition on line 60.
typedef irqreturn_t (*irq_handler_t) (int, void *);
What does this definition mean?
It means: Define a function pointer type irq_handler_t, the return type of this function is irqreturn_t, the argument list is int, void*
and look at the function declaration section of REQUEST_IRQ.
kernel/irq/manage.c:
int Request_irq (
unsigned int IRQ,
irq_handler_t Handler,
unsigned long irqflags,
const char *devname,
void *dev_id)
the second parameter of the REQUEST_IRQ is the handler function, which is the type irq_handler_t,
that is to say: I define the handler function return type is irq_handler_t,
combined with the above-mentioned
typedef irqreturn_t (*irq_handler_t) (int, void *);
so ...
the handler function should be written as:
static irqreturn_t key_eint_handler (int irq, void *dev_id)//correct notation
2 parameters ... The return type of irqreturn_t is correct!
2, WARNING: "__bad_udelay" undefined!
Cause: The parameters of Udelay () are too large.
Definition of Udelay () in the kernel:
......
#define MAX_UDELAY_MS 2
#define UDELAY (N)
(__builtin_constant_p (n)? \
((n) > (Max_udelay_ms *1000) __bad_udelay (): __const_udelay ((N) * ((2199023u*hz) >>11)): \
__udelay (n))
......
3.
Linux driver design compilation error message collection