Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2016 04:58:21 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302618 - head/sys/dev/hyperv/vmbus
Message-ID:  <201607120458.u6C4wLUF051539@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Tue Jul 12 04:58:21 2016
New Revision: 302618
URL: https://svnweb.freebsd.org/changeset/base/302618

Log:
  hyperv/vmbus: Avoid tx_evtflags setting code duplication.
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D6915

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_connection.c

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel.c	Tue Jul 12 04:35:32 2016	(r302617)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c	Tue Jul 12 04:58:21 2016	(r302618)
@@ -58,14 +58,14 @@ static void	VmbusProcessChannelEvent(voi
 static void
 vmbus_channel_set_event(hv_vmbus_channel *channel)
 {
+	struct vmbus_softc *sc = channel->vmbus_sc;
+	uint32_t chanid = channel->offer_msg.child_rel_id;
+
+	atomic_set_long(&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
+	    1UL << (chanid & VMBUS_EVTFLAG_MASK));
+
 	if (channel->offer_msg.monitor_allocated) {
-		struct vmbus_softc *sc = channel->vmbus_sc;
 		hv_vmbus_monitor_page *monitor_page;
-		uint32_t chanid = channel->offer_msg.child_rel_id;
-
-		atomic_set_long(
-		    &sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
-		    1UL << (chanid & VMBUS_EVTFLAG_MASK));
 
 		monitor_page = sc->vmbus_mnf2;
 		synch_set_bit(channel->monitor_bit,

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_connection.c	Tue Jul 12 04:35:32 2016	(r302617)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c	Tue Jul 12 04:58:21 2016	(r302618)
@@ -164,15 +164,8 @@ vmbus_event_proc_compat(struct vmbus_sof
 int
 hv_vmbus_set_event(hv_vmbus_channel *channel)
 {
-	struct vmbus_softc *sc = channel->vmbus_sc;
-	int ret = 0;
-	uint32_t chanid = channel->offer_msg.child_rel_id;
 
-	atomic_set_long(&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT],
-	    1UL << (chanid & VMBUS_EVTFLAG_MASK));
-	ret = hv_vmbus_signal_event(channel->signal_event_param);
-
-	return (ret);
+	return hv_vmbus_signal_event(channel->signal_event_param);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607120458.u6C4wLUF051539>