From owner-svn-src-all@freebsd.org Fri Apr 1 08:47:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55715AE39E0; Fri, 1 Apr 2016 08:47:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22EFC1B12; Fri, 1 Apr 2016 08:47:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u318lNfb057877; Fri, 1 Apr 2016 08:47:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u318lNQb057876; Fri, 1 Apr 2016 08:47:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201604010847.u318lNQb057876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 1 Apr 2016 08:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297484 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 08:47:24 -0000 Author: kib Date: Fri Apr 1 08:47:23 2016 New Revision: 297484 URL: https://svnweb.freebsd.org/changeset/base/297484 Log: Style(9), use tabs for the #define LOOPS line. Print unsigned values with %u. Make code slightly more compact by inlining loop limit. Noted by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Apr 1 06:43:05 2016 (r297483) +++ head/sys/x86/x86/local_apic.c Fri Apr 1 08:47:23 2016 (r297484) @@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 1000000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which @@ -535,7 +535,7 @@ native_lapic_init(vm_paddr_t addr) r2 = r * 1000000; lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1; if (bootverbose) { - printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n", + printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n", (uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r, (uintmax_t)tsc_freq); } @@ -1762,14 +1762,13 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O static int native_lapic_ipi_wait(int delay) { - uint64_t i, counter; + uint64_t rx; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ if (x2apic_mode) return (1); - counter = lapic_ipi_wait_mult * delay; - for (i = 0; delay == -1 || i < counter; i++) { + for (rx = 0; delay == -1 || rx < lapic_ipi_wait_mult * delay; rx++) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1);