From patchwork Wed Oct 2 16:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 175028 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1028285ill; Wed, 2 Oct 2019 10:09:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUw6XBAuhyMOnAiDaSfzMxbpNl5arZMVETfhpmQpM+99Vy4eIW1FDMdxQEYU6PoqI+vJfA X-Received: by 2002:a17:906:82d3:: with SMTP id a19mr3922088ejy.151.1570036184415; Wed, 02 Oct 2019 10:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570036184; cv=none; d=google.com; s=arc-20160816; b=omq5Gid7RyRo4sG3pGcbQxxSm+FNG+1kJkPimRQ4473/obdPAeVWSfwqfZx9Lslavl 3B85BCiCwcVY4fo4PhfbD9qpI3Qh7a1hX+QF9t7Nmh4XKZxncwT0obqh+gTtXZ2D4l+Z 1GT4N3f75rMAaB1PJ3oei/S4hzaXL6aGlWxpK/cICeFKRQ3BQK45jOB5V/WEqhnKGUQB JIKuG+f23bQ3V7K4Rh9o4+u1GZcPdfzDx6gvBEy9iH9bLqH0zkUV6f/tHNJ3et243MmE xT/Rv4f4E5aOCaRE72dKmNhLUVr7cXGx/79YlOxhYRVbpLE4NhmnZvI53XKxj23Uw5Bo 3T0w== 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=SMJwE8Po6gqDcIMCVlLUJtYONx0fpzl7bDQkyAr27WI=; b=aHG/z4+1wMJs+iJTk5bbHTMQAEoT+Ba1bAV0EaOpO5DMxu7roOEjTC4ShMv5a6GaXY TnXmtA8rOSkqcPo23qBK47eQ+exQgOMGuMENKJfNJHGic8X+icNR9GVaZgXVTblVTpw7 ZDXgJOkPP0qu+4qH+OAE/LJq8zqze1P5a6mgZcv+WYTTcaYsKVlH3VHGJ5pManKbJy48 RaRYYOGcNeJZZ4HoDqowyRPg4RWY49wyLupLDZaKWaFbTTcWjrCpemCqeeNhdXgL/0dF NF6CGSaMlMhBYSDYTOVGibVpn4JAGuYTOE4FhdUtBE/NlHNAHJCGH/xuCcr25gplJ+lx 1AOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=blNBNqFf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dv24si11136022ejb.60.2019.10.02.10.09.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Oct 2019 10:09:44 -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=fail header.i=@gmail.com header.s=20161025 header.b=blNBNqFf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:57836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFi8F-0007CD-9Q for patch@linaro.org; Wed, 02 Oct 2019 13:09:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35573) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFhrb-0005nd-Lk for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFhrZ-0003hQ-I9 for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:31 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:33858) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFhrZ-0003g7-CJ for qemu-devel@nongnu.org; Wed, 02 Oct 2019 12:52:29 -0400 Received: by mail-wm1-x343.google.com with SMTP id y135so5359332wmc.1 for ; Wed, 02 Oct 2019 09:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SMJwE8Po6gqDcIMCVlLUJtYONx0fpzl7bDQkyAr27WI=; b=blNBNqFf318bJBWyTHWJA2SzafzWoZleULzgxSfZ88Ds+FlN8L+E44q7eow97uxLzr XNHra2sSJlN1HeiCVXql5UEyhXbGvqFFFOrNhlpgatc3w/OOlD+Bc/iJOeiZ+iyATMeS 4AZk5NQN2MOlweWpeQEnK87AJJnxqjAj5mHyF/5YWYYlzjPbblRo5Ajx87vy+uz83hg6 475KljAlLAp2WM/iJy9r9kU1KMDw+dkL9sCDAZHpR8JFVGj84qfUFSFDW/BI94RVGY35 beFjL+CzRoTWNbtDXHPUth1TjxK5Ro+WufDoxPqy9hou2S8ZmRzAO3B2jn6qSDQxAZAY HJoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SMJwE8Po6gqDcIMCVlLUJtYONx0fpzl7bDQkyAr27WI=; b=aJoUUFTIw98u/FVXp3N4qOGhkT5mNONQAGHiMeVNhKk05Z1HjAbCqxOpkiMF1ZL3MH RqX97edD+QK406mSXnNfRotDU2RCbXovot20lRGqrdQ6DWSHlY+a7ZVUbXt6BOpClgut jmFE/rvS25XPQPFrFzQkr9tOYIh4oSPGeVp5hqimzTJs4yeBw27ODuPe9PnyNgll6gCr l3vDHTvrERI6GqMk/NlA5mMRGLFz1PngocxX4dmmlxq0x+9+BQ8fAlZ36dAcKkFWKeR/ LbZL9PzlbxQlP5XLg6iqdLLOrsQWQNoRAmwzXWjo/FkjVaw7X90W72Exq746lop+jM4+ ZUXQ== X-Gm-Message-State: APjAAAVQk9iSbURxqq3WziDUw+xpBRbHfLGxSixTyTids6xjRzvjNgzB RO0Ziqddfel1Hn/i3F7AcW+Uw5LI X-Received: by 2002:a1c:2d44:: with SMTP id t65mr3647412wmt.12.1570035148081; Wed, 02 Oct 2019 09:52:28 -0700 (PDT) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id g4sm27303990wrw.9.2019.10.02.09.52.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 09:52:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 30/30] accel/kvm: ensure ret always set Date: Wed, 2 Oct 2019 18:51:53 +0200 Message-Id: <1570035113-56848-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570035113-56848-1-git-send-email-pbonzini@redhat.com> References: <1570035113-56848-1-git-send-email-pbonzini@redhat.com> 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::343 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: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée Some of the cross compilers rightly complain there are cases where ret may not be set. 0 seems to be the reasonable default unless particular slot explicitly returns -1. Signed-off-by: Alex Bennée Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.8.3.1 diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index aabe097..d2d96d7 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -712,11 +712,11 @@ static int kvm_physical_log_clear(KVMMemoryListener *kml, KVMState *s = kvm_state; uint64_t start, size, offset, count; KVMSlot *mem; - int ret, i; + int ret = 0, i; if (!s->manual_dirty_log_protect) { /* No need to do explicit clear */ - return 0; + return ret; } start = section->offset_within_address_space; @@ -724,7 +724,7 @@ static int kvm_physical_log_clear(KVMMemoryListener *kml, if (!size) { /* Nothing more we can do... */ - return 0; + return ret; } kvm_slots_lock(kml);