From patchwork Thu Sep 22 10:13:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 76733 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2512184qgf; Thu, 22 Sep 2016 03:17:03 -0700 (PDT) X-Received: by 10.200.54.187 with SMTP id a56mr1027025qtc.44.1474539423794; Thu, 22 Sep 2016 03:17:03 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id x129si620174qkd.113.2016.09.22.03.17.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 03:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn13v-0000vG-BE for patch@linaro.org; Thu, 22 Sep 2016 06:17:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn11S-00081p-Ba for qemu-devel@nongnu.org; Thu, 22 Sep 2016 06:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn11N-0006nC-A1 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 06:14:29 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn11N-0006n2-3b for qemu-devel@nongnu.org; Thu, 22 Sep 2016 06:14:25 -0400 Received: by mail-wm0-f45.google.com with SMTP id w84so243499790wmg.1 for ; Thu, 22 Sep 2016 03:14:25 -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=wBRGZ9foEWUQLocMHXZshuVSGg1NEHbbU94jaoIF+F4=; b=GzDoZGlf4MkwfpWnr308Hh+FZ2sz/DPem5hXZUm4uA1ra27yM8CU8hZ1q2gswBxEvv NtEUCqfkDao0zB3WVD+xrS0nCBpCd2/SmyD8Negy1i0//nHzfpakFNwQwr42fqJVhOoh lX6CkaG9r511pG/fSaVNvDIbrolL4EEThdBLQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wBRGZ9foEWUQLocMHXZshuVSGg1NEHbbU94jaoIF+F4=; b=aE9nyZqIt4M+P/Y7Eezx3wcRqC2rjDlPNHnKtuscydOEpEcO/vgSbNaUkehtH/ysRU j1P0/itswOaYmfr3kL9eLgFWkuhCvwcxDLb6OL5fdK/bRm+TThCKdfg5slmSZGa3lIMd OLmZiewKuRo3HS+4Ftf/8P9Bn4c2TwGQOMxyvsJckbhpZc8ZPWnlYVIO+QMRE6roZAMP Dyui4HNR4fr3Q3h1uw/VxGF/S6hszj8PPouQuMUXcZOeWWw425OQeKlpfy2eqW5wMIuV O25/TETmaO7/UAH4sXXYnsryYv06q8plfXs0DB1xwrGcrLeXAJzRkUi5WuDs1ElWwMTk blqQ== X-Gm-Message-State: AE9vXwMWcCq3iDn7R4m0oyntzyJgW/l5G4EhvqAPPV3Dueycicho9N/iiqrq4+OYQjUlS9BJ X-Received: by 10.28.31.7 with SMTP id f7mr6955075wmf.69.1474539204493; Thu, 22 Sep 2016 03:13:24 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n28sm1750205wmi.2.2016.09.22.03.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 03:13:23 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 87BE33E023D; Thu, 22 Sep 2016 11:13:22 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, pbonzini@redhat.com, cota@braap.org, stefanha@redhat.com, kwolf@redhat.com Date: Thu, 22 Sep 2016 11:13:08 +0100 Message-Id: <20160922101316.13064-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160922101316.13064-1-alex.bennee@linaro.org> References: <20160922101316.13064-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.45 Subject: [Qemu-devel] [PATCH v2 1/9] ui/vnc-enc-tight: remove switch and have single return 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: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, nikunj@linux.vnet.ibm.com, jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, Gerd Hoffmann , serge.fdrv@gmail.com, bobby.prani@gmail.com, rth@twiddle.net, =?UTF-8?q?Alex=20Benn=C3=A9e?= , fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When enabling the sanitizer build it will complain about control reaching a non-void function. Normally the compiler should detect that there is only one possible exit given a static VNC_SERVER_FB_BYTES. As we always expect a static VNC_SERVER_FB_BYTES I've added a compile time assert and just called the sub-function directly. Signed-off-by: Alex Bennée Reviewed-by: Marc-André Lureau --- v2 - use QEMU_BUILD_BUG_ON instead and just return --- ui/vnc-enc-tight.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.9.3 diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 49df85e..1e53b1c 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -707,10 +707,8 @@ check_solid_tile32(VncState *vs, int x, int y, int w, int h, static bool check_solid_tile(VncState *vs, int x, int y, int w, int h, uint32_t* color, bool samecolor) { - switch (VNC_SERVER_FB_BYTES) { - case 4: - return check_solid_tile32(vs, x, y, w, h, color, samecolor); - } + QEMU_BUILD_BUG_ON(VNC_SERVER_FB_BYTES != 4); + return check_solid_tile32(vs, x, y, w, h, color, samecolor); } static void find_best_solid_area(VncState *vs, int x, int y, int w, int h,