From patchwork Tue Mar 30 08:20:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard - Gabriel Munteanu X-Patchwork-Id: 89251 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2U8KlZd006243 for ; Tue, 30 Mar 2010 08:20:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755940Ab0C3IUi (ORCPT ); Tue, 30 Mar 2010 04:20:38 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:48031 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755351Ab0C3IUd (ORCPT ); Tue, 30 Mar 2010 04:20:33 -0400 Received: by mail-bw0-f209.google.com with SMTP id 1so4153687bwz.21 for ; Tue, 30 Mar 2010 01:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=gz7su9+B0J9gFrGx1QGLVPSSUc8crl4m4UUm2qtu3SE=; b=ofFCdsX5U/AMXgOqnkr463CjUikmj0x5098kChM5airJz4m8jiOjDEaEU6Ekw1st8s q/SmzoXFe2BTdJ0hduWvxwkBR6gy6ZIY4TTt+THoiTfERgt6BYKZMXNYcLquhytky7S5 le4HwodUIxCfqjBk8ySiZ2iW9Jn/9Dl4Ca8Hw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=b1GotuIY91jzOjGW+75iVjCj6BgJVvdu20y+VtatTUFrJ7c3uEwgwfmrU1ERq9Q6IR B/rgwiG2/5nrOZtVCne5MKvLSda2RQpYFev9Z2bksSTUdSBh4ivr3lFEjayDp5+j9ZCQ ADz6qCaG1f99jN4McwWIbX6ZUMKv8Ze+5l6+c= Received: by 10.204.137.1 with SMTP id u1mr929074bkt.151.1269937228564; Tue, 30 Mar 2010 01:20:28 -0700 (PDT) Received: from localhost.localdomain ([188.25.93.130]) by mx.google.com with ESMTPS id 16sm2589620bwz.9.2010.03.30.01.20.27 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Mar 2010 01:20:28 -0700 (PDT) From: Eduard - Gabriel Munteanu To: joro@8bytes.org Cc: aliguori@us.ibm.com, avi@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Eduard - Gabriel Munteanu Subject: [RFC PATCH 6/7] acpi: cleanup acpi_checksum() Date: Tue, 30 Mar 2010 11:20:07 +0300 Message-Id: X-Mailer: git-send-email 1.6.4.4 In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 30 Mar 2010 08:20:47 +0000 (UTC) diff --git a/hw/acpi.c b/hw/acpi.c index 3794f70..f067f85 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -832,9 +832,11 @@ size_t acpi_tables_len, acpi_tables_prev_len; static int acpi_checksum(const uint8_t *data, int len) { int sum, i; + sum = 0; for(i = 0; i < len; i++) sum += data[i]; + return (-sum) & 0xff; }