Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp655275imm; Thu, 4 Oct 2018 00:48:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV61JEFcF2JJx3jU8frYQKMQBGxyu6sA4qzks/H6qj7Y91Nqne7204oIwA7JelCGOn6xxfO/f X-Received: by 2002:a63:6a42:: with SMTP id f63-v6mr4742217pgc.48.1538639292932; Thu, 04 Oct 2018 00:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538639292; cv=none; d=google.com; s=arc-20160816; b=P3Ea7m2ysmODKgpunJTIyKKoVrsHxcLKxF/0aMzm+xb8CHBb8b8/N0r+f/QDIwf46m pNhezxaAnOvPwerxQYInJK4ahkScxX8XQvfmKR0J4U0YKPcT78Z1l3zy516/VuPjcHy3 djoRc8ZQxzjPcT9QzjMINeyqVzc2cBkLbVLdL26H96V7mbpYvL6PrwEHvncV/x8MUWA5 uowp+i+xkxQ16a4vhdIhNx8ZUM9aNTe9O8L5exblGL9SCr79bbe2s3T+z0OUqgYK1Ea1 EQtBhPgnYBeT6FT6Az7PMRmP73OgaR3pGVvVTe0KuP9bVk4TdEOmMpwlaClEjQUhj7Tn TY7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yFn1jLamOd2y8K8hzH6lW7ffXGGHoBl+JyIkzMB3QkQ=; b=XfWi6Vq2wwV7vDoDE2fURcimtg6wgZaJ0LgSal3HlZ4A/vW0bytPTGPhZy42vessT5 1hpuMJtowbdpV13I4imb1LQEDi4NCfqpqX4JiFIV1F3kFPwHDw8UGQ5kCZQI3ovqPO/J 9WVI5D5WNbQyWpi/HqduG5t00hJ9uGapZkCAPQ4Wysg5EYvyjS8Hgro/QbZH8adgW3KP TedBMig2/aumah7t+ZIglXUnO6Tjvxqs/VTkdj0o6NFVcy6NDiRNGt11/cpX7PYqBtwl W7k7ajrnpOKSQ5ZmdwoqiznM1deZmn0J4Fk+Vxm+8H2brtisSwYORF7MLLyFPgDMZw7T 4Kig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I7Tih4Ec; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14-v6si4241499plo.208.2018.10.04.00.47.57; Thu, 04 Oct 2018 00:48:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I7Tih4Ec; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbeJDOiz (ORCPT + 99 others); Thu, 4 Oct 2018 10:38:55 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37962 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbeJDOiz (ORCPT ); Thu, 4 Oct 2018 10:38:55 -0400 Received: by mail-pf1-f193.google.com with SMTP id f29-v6so105581pff.5; Thu, 04 Oct 2018 00:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFn1jLamOd2y8K8hzH6lW7ffXGGHoBl+JyIkzMB3QkQ=; b=I7Tih4Ecr3l4tSsP7knbGbDF+uqgFV8NmFH1xNDSWIW6To52pz0RI0gnr2rR4S/1Ks u5FyOi6q+4RidR59uJ5JYP8nVkMHsuia4inm3fzq+gCXn2OmFOFckLYIhvXa0Bno1KFk N195PLRDDCBSIEnP6Rvob1yDLYY1C6HkiqgX3PFn4NFQCHkdZr9xZC7Iw8t8FY60Fgxd WaW5hQRIagZoBxOVBXePRpPFgRlex3VPo75lb2azCBeFuYmY9dyre3CJy9DkxqnIOiFO l8raotkZr18rmyMnkjk69JlkfZxw8Re+J+LR04VvhrPW3Nh2cdoTkv+Bnlrn5eiL5GfR ZwXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFn1jLamOd2y8K8hzH6lW7ffXGGHoBl+JyIkzMB3QkQ=; b=Jre/YrxK2VUae+ZhHoLt9sOis9F+XMp+hRCRuxJkWbAsutvt7ytqdGUj2PMJmAOot4 hQTDtf/3TEEOIyYjmnaqS/B9O0vulsuXQXPf2hpVs1pE3wY0zalGEuBH7srBSLXnJwqu KQP+U+JdCysAMCA+Eav1kBvN8jaS5deijqPtlj8EoJQjp6VvOo23VLZKopq2Wk0Ve4Kr AzKR0VwxAmo1d3h06evZxdYnUVFmGzeYMvRPhRd0Y1XBWAun9UJcFeArolCp6lpJi3Rf Sjk8OOiOcX7dUb+v7wMSxfUyk8LwUQgVVpL+oyI9+r6NIQtdBVVJvBQrlZV9jdWR5J+S 4xkQ== X-Gm-Message-State: ABuFfoid0gHUWBsXFvn8gOBZKwx0gYb8oadQOQ0L2CbFV5azl+XxXHnU XLq4CDPxkwuUons5h2LqKyM= X-Received: by 2002:a63:d048:: with SMTP id s8-v6mr4555091pgi.311.1538639218917; Thu, 04 Oct 2018 00:46:58 -0700 (PDT) Received: from E570.localdomain (c-24-21-68-121.hsd1.or.comcast.net. [24.21.68.121]) by smtp.gmail.com with ESMTPSA id r18-v6sm2496171pgv.17.2018.10.04.00.46.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Oct 2018 00:46:58 -0700 (PDT) Received: by E570.localdomain (Postfix, from userid 1000) id C6D9A161835; Thu, 4 Oct 2018 00:46:58 -0700 (PDT) From: Lance Roy To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Lance Roy , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH] atm: nicstar: Replace spin_is_locked() with spin_trylock() Date: Thu, 4 Oct 2018 00:46:57 -0700 Message-Id: <20181004074657.17597-1-ldr709@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Chas Williams <3chas3@gmail.com> Cc: Cc: --- drivers/atm/nicstar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index cbec9adc01c7..ae4aa02e4dc6 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -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); -- 2.19.0