From: Matthew Wilcox <matthew@wil.cx>
To: kernel-janitors@vger.kernel.org
Subject: Re: sema_init fail in 2.6
Date: Sun, 25 May 2008 21:56:53 +0000 [thread overview]
Message-ID: <20080525215653.GB30894@parisc-linux.org> (raw)
In-Reply-To: <41f748550805251313n5f1c9579k52060a940a911cc5@mail.gmail.com>
On Mon, May 26, 2008 at 03:13:43AM +0700, Iwan Budi Kusnanto wrote:
> 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.
How does it fail? What error messages do you get?
> */
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2008-05-25 21:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-25 20:13 sema_init fail in 2.6 Iwan Budi Kusnanto
2008-05-25 21:56 ` Matthew Wilcox [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080525215653.GB30894@parisc-linux.org \
--to=matthew@wil.cx \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.