Received: by 10.223.185.116 with SMTP id b49csp6229445wrg; Wed, 28 Feb 2018 06:09:06 -0800 (PST) X-Google-Smtp-Source: AH8x225Vl84et2+xhHX3WHnb1JetDFm4cBLtfeiB2d+6Ta3LcqncvIWyyqcd0bYmB2a1k+IR9FKU X-Received: by 10.101.82.195 with SMTP id z3mr14533754pgp.308.1519826946696; Wed, 28 Feb 2018 06:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519826946; cv=none; d=google.com; s=arc-20160816; b=Gka7A0cPBAU6GhwTfeTsY5+He8sEBxkP3f6M+WAL1tokEkzRAXGU3Fw4x0S7dIKG9v 0T4bz3WyLLj/igtKh/bWTc4N4Qj+B88lvJEa2zZAfrFdpY1cqNRZw86+7Kb3TkWkq83k +vqiRglv8D9gLNTg0qMdDq6t3aUIP86iSXLyEdsCnKUBc0KUGI6oxg2Z+gC3zA2nFxem p0UwR4WDqtiiOH5pD27Ir/M7vTEVCNtnXuwuRH8mOmMEJqHewjTq2Y54r6OondRVjR2l KCDX2NIzvv6k9Xh1JQdR6v8Dq6SMjTXk7u7h7HimnxS4at41Qb+6oC9HjlEXQLEfipmC E1nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=WP8ojxzc0kicl0QemEPRDr6X/6zaaoCu85hTxDRb0M0=; b=KFK5J3U2zVsFsDRzdpvCixwGj0hERVzmgWDE594fvSv3DP4ZiSZCe6i2Q0Gk+OxmQm es0V06W7XX26B6FUDcsU7cMmTlkwJXMYVDAmuyDuJXeY9xCZREd+LFAE1VF704myMEYK 5ivZ4Fwxj+EqAquKDNY7vDd2WwFGgXFCQUgkIqyX2xOZhguK15kE6vzTTlSpaIGzlQXB V5CHO/vDQHn6RMUkuSa9/48nvfxCc/JM48/YkekGC3cPVzdZv+o6N0FDysBNPYJGWFxD Jtlv4CVfrx3wEtymaNgfoGzFI8kie/wIDOcMGNfAaL7+QW9mWzjOPNmtRuPIXad7wmvg xFOg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si1303747pfi.105.2018.02.28.06.08.48; Wed, 28 Feb 2018 06:09:06 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752529AbeB1OHa (ORCPT + 99 others); Wed, 28 Feb 2018 09:07:30 -0500 Received: from terminus.zytor.com ([198.137.202.136]:54825 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbeB1OH3 (ORCPT ); Wed, 28 Feb 2018 09:07:29 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1SE7Kuo020988; Wed, 28 Feb 2018 06:07:20 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1SE7Kkw020985; Wed, 28 Feb 2018 06:07:20 -0800 Date: Wed, 28 Feb 2018 06:07:20 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, douly.fnst@cn.fujitsu.com, tglx@linutronix.de, andy.shevchenko@gmail.com Reply-To: douly.fnst@cn.fujitsu.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, andy.shevchenko@gmail.com, tglx@linutronix.de In-Reply-To: <20180226232554.14108.16881.stgit@tlendack-t1.amdoffice.net> References: <20180226232554.14108.16881.stgit@tlendack-t1.amdoffice.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Replace common tools with new ones Git-Commit-ID: eb088bc5133167ca7790bae351761f5448a8941d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: eb088bc5133167ca7790bae351761f5448a8941d Gitweb: https://git.kernel.org/tip/eb088bc5133167ca7790bae351761f5448a8941d Author: Dou Liyang AuthorDate: Mon, 26 Feb 2018 10:39:57 +0800 Committer: Thomas Gleixner CommitDate: Wed, 28 Feb 2018 15:02:58 +0100 x86/apic: Replace common tools with new ones The pending interrupt check code is old, update the following. -Replace for-if pair with for_each_set_bit() -Replace printk() with pr_err() Also merge the printk's code in one line and make curly braces balanced Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Reviewed-by: Andy Shevchenko Cc: bhe@redhat.com Cc: ebiederm@xmission.com Link: https://lkml.kernel.org/r/20180226232554.14108.16881.stgit@tlendack-t1.amdoffice.net --- arch/x86/kernel/apic/apic.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 3fda9734db25..4704a3541b11 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1412,7 +1412,8 @@ static void apic_pending_intr_clear(void) { long long max_loops = cpu_khz ? cpu_khz : 1000000; unsigned long long tsc = 0, ntsc; - unsigned int value, queued; + unsigned int queued; + unsigned long value; int i, j, acked = 0; if (boot_cpu_has(X86_FEATURE_TSC)) @@ -1435,24 +1436,22 @@ static void apic_pending_intr_clear(void) for (i = APIC_ISR_NR - 1; i >= 0; i--) { value = apic_read(APIC_ISR + i*0x10); - for (j = 31; j >= 0; j--) { - if (value & (1< 256) { - printk(KERN_ERR "LAPIC pending interrupts after %d EOI\n", - acked); + pr_err("LAPIC pending interrupts after %d EOI\n", acked); break; } if (queued) { if (boot_cpu_has(X86_FEATURE_TSC) && cpu_khz) { ntsc = rdtsc(); max_loops = (cpu_khz << 10) - (ntsc - tsc); - } else + } else { max_loops--; + } } } while (queued && max_loops > 0); WARN_ON(max_loops <= 0);