From patchwork Mon Oct 24 20:10:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 79077 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2776961qge; Mon, 24 Oct 2016 13:42:11 -0700 (PDT) X-Received: by 10.159.48.88 with SMTP id i24mr10804471uab.13.1477341731573; Mon, 24 Oct 2016 13:42:11 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 17si6120477vkv.48.2016.10.24.13.42.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 24 Oct 2016 13:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:49951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bym4Q-0003u2-D8 for patch@linaro.org; Mon, 24 Oct 2016 16:42:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bylZr-0005Qz-Jm for qemu-devel@nongnu.org; Mon, 24 Oct 2016 16:10:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bylZo-0001i8-OU for qemu-devel@nongnu.org; Mon, 24 Oct 2016 16:10:35 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:34906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bylZo-0001hi-FU for qemu-devel@nongnu.org; Mon, 24 Oct 2016 16:10:32 -0400 Received: by mail-pf0-x242.google.com with SMTP id s8so17363439pfj.2 for ; Mon, 24 Oct 2016 13:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l8Sj7Etqq4ydAWLHXozl0P7AxC39k39/1AoyPkeoPvI=; b=LHOu5pPkNgSIEtXU88q377Dyqi+FR5dvvpEAtiWEW+HrAxymcUrhB7pf9j9mmEU5OE sGGiVya3VS8o0sBHroPBmV8XbwhYw34sjUmX/7OwVTkp42ZNa1LMFT2VRI6qfSxURO3a irRno9u6h+a/qOUNpRjm6QoQETJR3zJKrPSaPRpKLNrFi6K0qiMnneLdn8mhyyRs0N0z jNxxf7I+wORuGOTD8Cz1N24p4i2zxRW0oiw6zt6tX8L28raltkQrsAthvd8cJimO0vD5 ljVcpQitUGHZannLIBR5azHuAKKTkvx50UsUGx1SwqBlFLSLMD6t63criakZAfm+GjMj PO4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=l8Sj7Etqq4ydAWLHXozl0P7AxC39k39/1AoyPkeoPvI=; b=FSc+2EX7rFIB1I5YeMtLiAXoTXxYTVffMkHn6ccD7a5TYSMJB4lxnKAJa1x35ZOhZi MjSvtjCJwtT8c+BDOUfVD7jieDyECh/fRMHz21poUNj5dfJwMcEn8nkUhb3Z5ThuKSUi 5nRGw0chm5Gj63pMAfeorRa8I1JbASawV0YkMA3VmPdqCbwj4K12VIl1NWlPtE2DPloG HnhUkuNxtFOk0i8NHxvwT8GnPy24RE+hFHeNjACKcugCEhx7m8ywEkQbIXzUEK2LlwKo x0PrYBJ4XFRHNhZ3RuB3Q8XclChZv2Yy1f/TEu7TSLnIr/D+i23rYvZ8wMEfssNSu/Hr vK3A== X-Gm-Message-State: ABUngvdng/pu4NU3VecsxgHq0BNQwVK53HeDzSho8lcVAlXcnXXFwUq1pto/kVsYKqINsA== X-Received: by 10.98.223.150 with SMTP id d22mr32173338pfl.2.1477339830931; Mon, 24 Oct 2016 13:10:30 -0700 (PDT) Received: from serve.minyard.net ([47.184.183.230]) by smtp.gmail.com with ESMTPSA id ij5sm27451646pab.2.2016.10.24.13.10.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 13:10:29 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 91E781348; Mon, 24 Oct 2016 15:10:27 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 8FCF53025DC; Mon, 24 Oct 2016 15:10:25 -0500 (CDT) From: minyard@acm.org To: Igor Mammedov , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org, minyard@acm.org, cminyard@mvista.com Date: Mon, 24 Oct 2016 15:10:16 -0500 Message-Id: <1477339821-11782-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477339821-11782-1-git-send-email-minyard@acm.org> References: <1477339821-11782-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PATCH 2/7] ipmi_bmc_sim: Remove an unnecessary mutex X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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é Lureau --- hw/ipmi/ipmi_bmc_sim.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.7.4 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]; - QemuMutex lock; /* We allow one event in the buffer */ uint8_t evtbuf[16]; @@ -940,7 +939,6 @@ static void get_msg(IPMIBmcSim *ibs, { IPMIRcvBufEntry *msg; - 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, } out: - qemu_mutex_unlock(&ibs->lock); return; } @@ -1055,11 +1052,9 @@ static void send_msg(IPMIBmcSim *ibs, end_msg: msg->buf[msg->len] = ipmb_checksum(msg->buf, msg->len, 0); msg->len++; - qemu_mutex_lock(&ibs->lock); QTAILQ_INSERT_TAIL(&ibs->rcvbufs, msg, entry); ibs->msg_flags |= IPMI_BMC_MSG_FLAG_RCV_MSG_QUEUE; k->set_atn(s, 1, attn_irq_enabled(ibs)); - qemu_mutex_unlock(&ibs->lock); } static void do_watchdog_reset(IPMIBmcSim *ibs) @@ -1753,7 +1748,6 @@ static void ipmi_sim_realize(DeviceState *dev, Error **errp) unsigned int i; IPMIBmcSim *ibs = IPMI_BMC_SIMULATOR(b); - qemu_mutex_init(&ibs->lock); QTAILQ_INIT(&ibs->rcvbufs); ibs->bmc_global_enables = (1 << IPMI_BMC_EVENT_LOG_BIT);