From patchwork Thu Mar 19 19:33:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 184702 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2366082ile; Thu, 19 Mar 2020 12:33:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZDUIfglC3SSpgx49+LH1t3LRRZPaTCfTq6j9gEtxOk6jPSGnlX+FN2vwkALQgu3XXLMyD X-Received: by 2002:ac8:505a:: with SMTP id h26mr4611398qtm.84.1584646433340; Thu, 19 Mar 2020 12:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584646433; cv=none; d=google.com; s=arc-20160816; b=0LGNUKCV6/7BeH9Hv2/qy0y+BmYUQh4J7GkNoDnvbjiWUUU+imyoIPWw2vxRlsKfzL ZdZFnkWmBCLTPwNfbiGJ/opQlITEfZtJHaM5MUgtmI0nAIeYDfpiTAZVit+RCJAlVqX1 ySFIbusarwWxcDloKoO3pXQ1W14cPyfbM4uk8oA3FfZ2Pl3jO7XgwU0lHkTJkWGLPnv0 ms/M63FuVO2/ZmNbz8BR7DvYFI9p7l50/GECh2+J4Gewb23eFXEZP4g8/IjiWwR+aMVz PZ264wdjynlOI75O5MpXHTxC5jDis3KdA8JPeQA3te7sS7Ci6eo/oOELEhQY1DXUgncW O/Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=smsrtU5x+Ww0fA4g+LeGtvF6EpGiUdbtArUTIrJNIQ0=; b=VeBF4PBSl4gLPWuxPTOGA4LBZs3+JrAgCHeKbBZVOG+Fc5FfxR1fdV8Hxyx0RRvwQQ lZQm1HEpEsFqwPdOQLCYFehAY8hPSBhz51DE5VL9HgSXTmH7VfJWr4caLoFVL4TW9n7T zAq6394pizl+wn9ALa6yArJ8CmjokA9xAMcnudpcwuX0nOEHr5rrlXL4LNv+qeTcKzkz B5I9HXc+fYKnDRw755yJJlqXLE//CgOl34qA3ika8bXGcsnw3umaFQ8oQJJRw2kZG99F NJ7+rzMgGamzyGwDmU+pyftylyqipQvGVAkopJVsfUO7Vk/7Ax3/XQ/eecQx3wzSVOUw rLwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q0tDhS99; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a18si1771825qvj.201.2020.03.19.12.33.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Mar 2020 12:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q0tDhS99; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jF0vQ-0004H7-Sz for patch@linaro.org; Thu, 19 Mar 2020 15:33:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jF0v4-0004GD-A9 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 15:33:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jF0v3-0005pT-8B for qemu-devel@nongnu.org; Thu, 19 Mar 2020 15:33:30 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33977) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jF0v3-0005oW-2N for qemu-devel@nongnu.org; Thu, 19 Mar 2020 15:33:29 -0400 Received: by mail-wr1-x444.google.com with SMTP id z15so4659235wrl.1 for ; Thu, 19 Mar 2020 12:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=smsrtU5x+Ww0fA4g+LeGtvF6EpGiUdbtArUTIrJNIQ0=; b=Q0tDhS990sj6uzNWIfGFwU92SMl8u3+aXG+LEXxgAuKb9PRbbSaj39Qgx436xD7Xqc Qc0ZXYx3I1H2suQ1xYvAUdqm9CkjrzaHGLb14LzIvvufALlqyOtknqVA1wp4z3x5MNf5 S7TXvyZZmONJSPtbLXWR7xyfhp4hxQaeKO8KfG/ZAcpz24mcoYRfhtudpc2laRs8Dcpo aXqHX52CeZLfOxldUZrlYlSlnFDaOUooSY2AIfZOdd/acnBbjzxMHLrShItq7JN7ffXI vUj+yrJ0baVZFj16rrgKcYVC3l2RWVMvCt7i/v0a3O29nfwCwwKeKb1skNDp6S5jXEqU 9/Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=smsrtU5x+Ww0fA4g+LeGtvF6EpGiUdbtArUTIrJNIQ0=; b=ijqGu1V411pQhkLK7dNpxYaF1lIVzE5iHT2o8aWdoRSeRZmUqUMeXJrPdvmW3Gao9z EfJrQjZ7wvMAKV/HPRIeXnDdtqVnEOVdhaOgUZUotvNeazACqXGUtb+q8kK5IoIQD65R n9eR93QUUXGPrFn1OJim1Ia4gfzIeS/bV8jiNrNrv4KXLZ5QTHsLHilC0AUAFbnvnddm 2nUan2aYnjlO4YPMkDCUMC+/PoAzbIAB9alpLZJT+OAYZHI6fqq/7itFygoshc/7qTUk LpQ0AqxxRab/1nhWTgGjKWpUv8DNcfUwpfoMyAfBulhocjsEg4T8d6raqkvwBZWFtfBk lC4Q== X-Gm-Message-State: ANhLgQ1FvqGBRyocT0xWYYTCVEFcIV6K7o0uPFWNqbUxnCRbo1dJ+Yxs s0vFGYmQsrT4kcnUAglo/RjgZZdlWLWIIQ== X-Received: by 2002:a5d:5290:: with SMTP id c16mr5922034wrv.235.1584646407864; Thu, 19 Mar 2020 12:33:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o9sm4984794wrw.20.2020.03.19.12.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 12:33:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] thread.h: Fix Coverity version of qemu_cond_timedwait() Date: Thu, 19 Mar 2020 19:33:19 +0000 Message-Id: <20200319193323.2038-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200319193323.2038-1-peter.maydell@linaro.org> References: <20200319193323.2038-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For Coverity's benefit, we provide simpler versions of functions like qemu_mutex_lock(), qemu_cond_wait() and qemu_cond_timedwait(). When we added qemu_cond_timedwait() in commit 3dcc9c6ec4ea, a cut and paste error meant that the Coverity version of qemu_cond_timedwait() was using the wrong _impl function, which makes the Coverity parser complain: "/qemu/include/qemu/thread.h", line 159: warning #140: too many arguments in function call return qemu_cond_timedwait(cond, mutex, ms); ^ "/qemu/include/qemu/thread.h", line 159: warning #120: return value type does not match the function type return qemu_cond_timedwait(cond, mutex, ms); ^ "/qemu/include/qemu/thread.h", line 156: warning #1563: function "qemu_cond_timedwait" not emitted, consider modeling it or review parse diagnostics to improve fidelity static inline bool (qemu_cond_timedwait)(QemuCond *cond, QemuMutex *mutex, ^ These aren't fatal, but reduce the scope of the analysis. Fix the error. Signed-off-by: Peter Maydell --- include/qemu/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 047db0307e7..10262c63f58 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -67,7 +67,7 @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func; #define qemu_cond_wait(c, m) \ qemu_cond_wait_impl(c, m, __FILE__, __LINE__); #define qemu_cond_timedwait(c, m, ms) \ - qemu_cond_wait_impl(c, m, ms, __FILE__, __LINE__); + qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__); #else #define qemu_mutex_lock(m) ({ \ QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func); \