All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] HYSDN cards: use spin_lock_init() for spinlock
Date: Wed, 11 Apr 2007 08:44:35 +0000	[thread overview]
Message-ID: <20070411084435.GK24898@traven> (raw)
In-Reply-To: <20070411071951.GJ24898@traven>

El Wed, Apr 11, 2007 at 01:37:50PM +0530 Milind Arun Choudhary ha dit:

> On 4/11/07, Matthias Kaehlcke <matthias.kaehlcke@gmail.com> wrote:
> >HYSDN cards: use spin_lock_init() for spinlock initialization
> >
> >Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
> >---
> >diff --git a/drivers/isdn/hysdn/hysdn_proclog.c 
> >b/drivers/isdn/hysdn/hysdn_proclog.c
> >index f7e83a8..168fd56 100644
> >--- a/drivers/isdn/hysdn/hysdn_proclog.c
> >+++ b/drivers/isdn/hysdn/hysdn_proclog.c
> >@@ -299,7 +299,8 @@ hysdn_log_close(struct inode *ino, struct file *filep)
> >        hysdn_card *card;
> >        int retval = 0;
> >        unsigned long flags;
> >-       spinlock_t hysdn_lock = SPIN_LOCK_UNLOCKED;
> >+       spinlock_t hysdn_lock;
> >+       spin_lock_init(&hysdn_lock);
> 
> use DEFINE_SPINLOCK() instead,for static/compile time initialization
> 
> spin_lock_init() is for runtime

thanks for your comment, i have corrected this

---

HYSDN cards: use DEFINE_SPINLOCK() for spinlock declaration and
initialization instead of declaring the spinlock and assigning it to
SPIN_LOCK_UNLOCKED

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>

---
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index f7e83a8..53e8de6 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -299,7 +299,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
 	hysdn_card *card;
 	int retval = 0;
 	unsigned long flags;
-	spinlock_t hysdn_lock = SPIN_LOCK_UNLOCKED;
+	DEFINE_SPINLOCK(hysdn_lock);
 
 	lock_kernel();
 	if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) = FMODE_WRITE) {

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona


  The salvation of mankind lies only in making everything the concern of all
                         (Alexander Solzhenitsyn)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2007-04-11  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11  7:19 [KJ] [PATCH] HYSDN cards: use spin_lock_init() for spinlock Matthias Kaehlcke
2007-04-11  8:19 ` Milind Arun Choudhary
2007-04-11  8:44 ` Matthias Kaehlcke [this message]
2007-04-11 11:23 ` Alexey Dobriyan
2007-04-11 11:44 ` Matthias Kaehlcke

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=20070411084435.GK24898@traven \
    --to=matthias.kaehlcke@gmail.com \
    --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.