From owner-svn-src-head@freebsd.org Tue May 24 05:43:58 2016 Return-Path: Delivered-To: svn-src-head@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 67C7FB4896A; Tue, 24 May 2016 05:43:58 +0000 (UTC) (envelope-from sephe@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 143581299; Tue, 24 May 2016 05:43:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O5ht4Q047510; Tue, 24 May 2016 05:43:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O5ht5F047509; Tue, 24 May 2016 05:43:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605240543.u4O5ht5F047509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 24 May 2016 05:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300570 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 05:43:58 -0000 Author: sephe Date: Tue May 24 05:43:55 2016 New Revision: 300570 URL: https://svnweb.freebsd.org/changeset/base/300570 Log: hyperv/vmbus: Rename local variable and break long lines No functional changes. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6500 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:29:41 2016 (r300569) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue May 24 05:43:55 2016 (r300570) @@ -370,7 +370,7 @@ static int vmbus_bus_init(void) { struct vmbus_softc *sc; - int i, j, n, ret; + int i, n, ret, cpu; char buf[MAXCOMLEN + 1]; cpuset_t cpu_mask; @@ -394,44 +394,49 @@ vmbus_bus_init(void) sc->vmbus_idtvec); } - CPU_FOREACH(j) { - snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); - intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, j)); + CPU_FOREACH(cpu) { + snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu); + intrcnt_add(buf, VMBUS_SC_PCPU_PTR(sc, intr_cnt, cpu)); for (i = 0; i < 2; i++) - setup_args.page_buffers[2 * j + i] = NULL; + setup_args.page_buffers[2 * cpu + i] = NULL; } /* * Per cpu setup. */ - CPU_FOREACH(j) { + CPU_FOREACH(cpu) { /* * Setup taskqueue to handle events */ - hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, - taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); - CPU_SETOF(j, &cpu_mask); - taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, &cpu_mask, - "hvevent%d", j); + hv_vmbus_g_context.hv_event_queue[cpu] = + taskqueue_create_fast("hyperv event", M_WAITOK, + taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_event_queue[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_event_queue[cpu], 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); /* * Setup per-cpu tasks and taskqueues to handle msg. */ - hv_vmbus_g_context.hv_msg_tq[j] = taskqueue_create_fast( + hv_vmbus_g_context.hv_msg_tq[cpu] = taskqueue_create_fast( "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, - &hv_vmbus_g_context.hv_msg_tq[j]); - CPU_SETOF(j, &cpu_mask); - taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], - 1, PI_NET, &cpu_mask, "hvmsg%d", j); - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, + &hv_vmbus_g_context.hv_msg_tq[cpu]); + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + &hv_vmbus_g_context.hv_msg_tq[cpu], 1, PI_NET, + &cpu_mask, "hvmsg%d", cpu); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[cpu], 0, vmbus_msg_task, NULL); /* - * Prepare the per cpu msg and event pages to be called on each cpu. + * Prepare the per cpu msg and event pages to be called on + * each cpu. */ for(i = 0; i < 2; i++) { - setup_args.page_buffers[2 * j + i] = + setup_args.page_buffers[2 * cpu + i] = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); } } @@ -475,10 +480,10 @@ vmbus_bus_init(void) /* * remove swi and vmbus callback vector; */ - CPU_FOREACH(j) { - if (hv_vmbus_g_context.hv_event_queue[j] != NULL) { - taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); - hv_vmbus_g_context.hv_event_queue[j] = NULL; + CPU_FOREACH(cpu) { + if (hv_vmbus_g_context.hv_event_queue[cpu] != NULL) { + taskqueue_free(hv_vmbus_g_context.hv_event_queue[cpu]); + hv_vmbus_g_context.hv_event_queue[cpu] = NULL; } }