From patchwork Tue Aug 2 15:58:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 73166 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp241654qga; Tue, 2 Aug 2016 09:01:15 -0700 (PDT) X-Received: by 10.55.102.204 with SMTP id a195mr16187871qkc.173.1470153673538; Tue, 02 Aug 2016 09:01:13 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c50si1930369qtc.1.2016.08.02.09.01.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 02 Aug 2016 09:01:13 -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]:57391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUc81-0001vy-2y for patch@linaro.org; Tue, 02 Aug 2016 12:01:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUc5x-0001Do-V9 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 11:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUc5t-0006TX-Rg for qemu-devel@nongnu.org; Tue, 02 Aug 2016 11:59:04 -0400 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:34129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUc5t-0006TJ-N5 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 11:59:01 -0400 Received: by mail-oi0-x244.google.com with SMTP id c199so17273562oig.1 for ; Tue, 02 Aug 2016 08:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=72uJePL2SJmOfPCEsHRSOkmiFobrLUbYeSLzAMecRHg=; b=GlfYfU3Cg+jJv51nj+3HXNKyqK5HJpaVG+ZRRhAJceMR0gj5r+oO9dh2koBl6tfzHu eVQ4vf2Cf9eEHgLwuy1IoCFCternRDF5sK0K5XI1syHbhHlfsSJDpQFIqXOuqvfhFFkD Uaat/Z14XU9Vn+JKxKCjpTydYGWRFGs5y7+T3R9sU5nNpUgfp7VQetha/86VPDk9rCLY wYm14QqXsm4xBlMG3A2NdGS5RAPKV2OaM+xTCEQE8wcUFewhvQfM8vDqVerGzWuIHiMC xcE+kGvbS1YLJ+Hp4j7I8tRcVjY5/TyEsmokn2Hcc3AVLtlxb3yx09bQne4C1wovs04W hkCA== 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:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=72uJePL2SJmOfPCEsHRSOkmiFobrLUbYeSLzAMecRHg=; b=Jqerm44xC1inANWx4h4fz3u/n3W0Y5RSgVQjDhG0axGG1nMdI0UEM0I1nI2jwrFbWg KfF0afdTtQdi7gnbDQM1Rwxb9dHDG4bc3URbwcaYHEMBC7PWF9pITqsoljv3EKwz8PH0 yh3fCtLAbOfjuXmHkukWDG79dqaOlWbfJ80EXJqmEUnF9hEr+svqV8ViuDy2Z7D7XoCM Q2LdanXJdlWpiOtMOaIfaeDsnoLldIltal6r2IVBcB2+K1QeYsoKvsYgzHyrRPp2zmqn zw8LKIg0vvqZsm+xWg+/cT/rs5Dej+dTXwdijgueIYCz8sVApLnng1p0PeUki1lSQ16E EmaQ== X-Gm-Message-State: AEkoouvCe6ZKt5aF2Vx/wzZQAXmfPHNhKloo3X0+jR3YCHrvDw0d5Qy8aimw/qwyM2oIqw== X-Received: by 10.202.171.80 with SMTP id u77mr38677692oie.29.1470153541154; Tue, 02 Aug 2016 08:59:01 -0700 (PDT) Received: from serve.minyard.net ([173.64.235.97]) by smtp.gmail.com with ESMTPSA id h2sm1512254otb.19.2016.08.02.08.59.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Aug 2016 08:59:00 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:d6f:e2fa:cd5a:adde]) by serve.minyard.net (Postfix) with ESMTPA id 9ECC16D3; Tue, 2 Aug 2016 10:58:59 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 6F74F30053D; Tue, 2 Aug 2016 10:58:59 -0500 (CDT) From: minyard@acm.org To: qemu-devel@nongnu.org, minyard@acm.org Date: Tue, 2 Aug 2016 10:58:57 -0500 Message-Id: <1470153537-6588-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 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:4003:c06::244 Subject: [Qemu-devel] [PATCH v2] 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: , Cc: Corey Minyard 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(-) This is pretty straightforward, I think it's ready to include. -- 2.7.4 diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 190e169..b38f4f0 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);