Skip to content

Commit

Permalink
atm: nicstar: Replace spin_is_locked() with spin_trylock()
Browse files Browse the repository at this point in the history
ns_poll() used spin_is_locked() + spin_lock() to get achieve the same
thing as a spin_trylock(), so simplify it by using that instead. This is
also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Chas Williams <3chas3@gmail.com>
Cc: <linux-atm-general@lists.sourceforge.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lance Roy authored and David S. Miller committed Oct 5, 2018
1 parent 9798594 commit 9a694c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/atm/nicstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -2689,11 +2689,10 @@ static void ns_poll(struct timer_list *unused)
PRINTK("nicstar: Entering ns_poll().\n");
for (i = 0; i < num_cards; i++) {
card = cards[i];
if (spin_is_locked(&card->int_lock)) {
if (!spin_trylock_irqsave(&card->int_lock, flags)) {
/* Probably it isn't worth spinning */
continue;
}
spin_lock_irqsave(&card->int_lock, flags);

stat_w = 0;
stat_r = readl(card->membase + STAT);
Expand Down

0 comments on commit 9a694c1

Please sign in to comment.