All of lore.kernel.org
 help / color / mirror / Atom feed
* sema_init fail in 2.6
@ 2008-05-25 20:13 Iwan Budi Kusnanto
  2008-05-25 21:56 ` Matthew Wilcox
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Iwan Budi Kusnanto @ 2008-05-25 20:13 UTC (permalink / raw)
  To: kernel-janitors

Hello, i recently porting my driver from 2.4.35 to 2.6.X kernel.
I meet some strange behaviour with sema_init. This is the code snippet

/**
 * this code is compiled & working in 2.4 kernel.
 * Compiled in 2.6 but fail in module initialization.
 */
static struct semaphore sem_fail;

static init __init my_module_init_fail(void)
{
        sema_init (&sem_fail, 1);
}

/**
 * this code compiled & work in 2.6
 */
struct semaphore *sem;

static init __init my_module_init(void)
{
        sem = (struct semaphore *) kmalloc (sizeof (struct semaphore
), GFP_KERNEL);
        sema_init (sem, 1);
}

Any idea?
Thx

-- 
Iwan Budi Kusnanto

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-26  4:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25 20:13 sema_init fail in 2.6 Iwan Budi Kusnanto
2008-05-25 21:56 ` Matthew Wilcox
2008-05-25 21:59 ` Matthew Wilcox
2008-05-26  4:12 ` Iwan Budi Kusnanto
2008-05-26  4:14 ` Iwan Budi Kusnanto
2008-05-26  4:33 ` Iwan Budi Kusnanto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.