From patchwork Fri May 29 15:16:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C767E218EC for ; Fri, 29 May 2015 15:16:59 +0000 (UTC) Received: by wixv7 with SMTP id v7sf7305123wix.0 for ; Fri, 29 May 2015 08:16:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bzPKooV0VmVNBSKZZ7DGbTDUZjP+x/x/Fq39oLqOdZM=; b=MrJsu+nhYiZybhztHZGl3vqEvEfUrRtYaVIzlyz+tNjQIAe2QsKzVWgvQsgc3pVRua nmW+mgu1Gla1XQ5Z6I+IxRjJ7dnXhl/GCqHFvp8nF868orkS4JyQd06agR9aNwPFKX7K K0xAwRCOtuF88YWFS37jkA3uCkY402vrcRAJijajO0rKZOfsCa/xYLCLqzy3iv+Ici+a 63ID874qaLkNOyfHH1pLQukW/Qr1ERiNB1MemM6+DpNwyoWD1IK05vTs2IyKHL6AcOb/ 2BKTsTFJtmZlRpJgZeuShdPv3i5yzBrGKs7s0RTMnn6aiD3FHd63rMqhMKMq56NpkpZ3 9KwA== X-Gm-Message-State: ALoCoQnKj2wLEX89Ue+gxilNzrFumam83mDSY3cyMyUF0y+MMWecZkLpAvS9/VUUbfdXEgF/rpym X-Received: by 10.112.55.104 with SMTP id r8mr7779260lbp.18.1432912619147; Fri, 29 May 2015 08:16:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.10 with SMTP id z10ls366398lae.24.gmail; Fri, 29 May 2015 08:16:59 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr8696858lad.56.1432912619002; Fri, 29 May 2015 08:16:59 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id y5si4912602lay.123.2015.05.29.08.16.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:16:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labpy14 with SMTP id py14so46546631lab.0 for ; Fri, 29 May 2015 08:16:58 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr8343799lbc.41.1432912618718; Fri, 29 May 2015 08:16:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp415992lbb; Fri, 29 May 2015 08:16:58 -0700 (PDT) X-Received: by 10.180.76.100 with SMTP id j4mr7622894wiw.10.1432912618108; Fri, 29 May 2015 08:16:58 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id pu9si10129858wjc.56.2015.05.29.08.16.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 08:16:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YyM1n-00061A-HH; Fri, 29 May 2015 16:16:55 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Evgeny Voevodin , Maksim Kozlov , Igor Mitsyanko , Dmitry Solodkiy Subject: [PATCH] hw/display/exynos4210_fimd: Fix bit-swapping code Date: Fri, 29 May 2015 16:16:55 +0100 Message-Id: <1432912615-23107-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , fimd_swap_data() includes code to reverse the bits in a 64-bit integer, but an off-by-one error meant that it would try to shift off the top of the integer. Correct the bug (spotted by Coverity). Signed-off-by: Peter Maydell --- Compile-tested only, I have no exynos images to test with. hw/display/exynos4210_fimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 45c62af..3e59ee4 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -337,7 +337,7 @@ static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data) if (swap_ctl & FIMD_WINCON_SWAP_BITS) { res = 0; for (i = 0; i < 64; i++) { - if (x & (1ULL << (64 - i))) { + if (x & (1ULL << (63 - i))) { res |= (1ULL << i); } }