From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0xbU-0004H4-Bj for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0xbT-0007SA-HH for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:25:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c0xbT-0007Rw-BN for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:25:19 -0400 Date: Sun, 30 Oct 2016 23:25:15 +0200 From: "Michael S. Tsirkin" Message-ID: <1477850917-1214-42-git-send-email-mst@redhat.com> References: <1477850917-1214-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1477850917-1214-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 41/47] ipmi_bmc_sim: Remove an unnecessary mutex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Corey Minyard , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , =?iso-8859-1?Q?C=E9dric?= Le Goater , Marcel Apfelbaum , Greg Kurz From: Corey Minyard Get rid of the unnecessary mutex, it was a vestige of something else that was not done. That way we don't have to free it. Signed-off-by: Corey Minyard Reviewed-by: Marc-Andr=E9 Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ipmi/ipmi_bmc_sim.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index a0282cb..c7883d6 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -217,7 +217,6 @@ struct IPMIBmcSim { /* Odd netfns are for responses, so we only need the even ones. */ const IPMINetfn *netfns[MAX_NETFNS / 2]; =20 - QemuMutex lock; /* We allow one event in the buffer */ uint8_t evtbuf[16]; =20 @@ -940,7 +939,6 @@ static void get_msg(IPMIBmcSim *ibs, { IPMIRcvBufEntry *msg; =20 - qemu_mutex_lock(&ibs->lock); if (QTAILQ_EMPTY(&ibs->rcvbufs)) { rsp_buffer_set_error(rsp, 0x80); /* Queue empty */ goto out; @@ -960,7 +958,6 @@ static void get_msg(IPMIBmcSim *ibs, } =20 out: - qemu_mutex_unlock(&ibs->lock); return; } =20 @@ -1055,11 +1052,9 @@ static void send_msg(IPMIBmcSim *ibs, end_msg: msg->buf[msg->len] =3D ipmb_checksum(msg->buf, msg->len, 0); msg->len++; - qemu_mutex_lock(&ibs->lock); QTAILQ_INSERT_TAIL(&ibs->rcvbufs, msg, entry); ibs->msg_flags |=3D IPMI_BMC_MSG_FLAG_RCV_MSG_QUEUE; k->set_atn(s, 1, attn_irq_enabled(ibs)); - qemu_mutex_unlock(&ibs->lock); } =20 static void do_watchdog_reset(IPMIBmcSim *ibs) @@ -1753,7 +1748,6 @@ static void ipmi_sim_realize(DeviceState *dev, Erro= r **errp) unsigned int i; IPMIBmcSim *ibs =3D IPMI_BMC_SIMULATOR(b); =20 - qemu_mutex_init(&ibs->lock); QTAILQ_INIT(&ibs->rcvbufs); =20 ibs->bmc_global_enables =3D (1 << IPMI_BMC_EVENT_LOG_BIT); --=20 MST