mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Peng Tao <bergwolf@gmail.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Subject: [PATCH 6/6] staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK
Date: Wed,  5 Mar 2014 21:27:20 +0800	[thread overview]
Message-ID: <1394026040-1968-6-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1394026040-1968-5-git-send-email-bergwolf@gmail.com>

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/nidstrings.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/nidstrings.c b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
index 732ae55..cfb274f 100644
--- a/drivers/staging/lustre/lustre/libcfs/nidstrings.c
+++ b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
@@ -65,23 +65,20 @@ void libcfs_init_nidstrings(void)
 	spin_lock_init(&libcfs_nidstring_lock);
 }
 
-# define NIDSTR_LOCK(f)   spin_lock_irqsave(&libcfs_nidstring_lock, f)
-# define NIDSTR_UNLOCK(f) spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
-
 static char *
 libcfs_next_nidstring(void)
 {
 	char	  *str;
 	unsigned long  flags;
 
-	NIDSTR_LOCK(flags);
+	spin_lock_irqsave(&libcfs_nidstring_lock, flags);
 
 	str = libcfs_nidstrings[libcfs_nidstring_idx++];
 	if (libcfs_nidstring_idx ==
 	    sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
 		libcfs_nidstring_idx = 0;
 
-	NIDSTR_UNLOCK(flags);
+	spin_unlock_irqrestore(&libcfs_nidstring_lock, flags);
 	return str;
 }
 
-- 
1.7.7.6


  reply	other threads:[~2014-03-05 13:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 13:27 [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Peng Tao
2014-03-05 13:27 ` [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp Peng Tao
2014-03-05 13:27   ` [PATCH 3/6] staging/lustre/libcfs_string.h: don't export internal functions Peng Tao
2014-03-05 13:27     ` [PATCH 4/6] staging/lustre/libcfs: remove cfs_iswhite Peng Tao
2014-03-05 13:27       ` [PATCH 5/6] staging/lustre/libcfs: remove obsolete function declaration Peng Tao
2014-03-05 13:27         ` Peng Tao [this message]
2014-03-09  3:23 ` [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Greg KH

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=1394026040-1968-6-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®