public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: joro@8bytes.org, aliguori@us.ibm.com, avi@redhat.com,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 7/7] acpi: fix bug in acpi_checksum() caused by garbage in checksum field
Date: Tue, 30 Mar 2010 08:10:52 -0700	[thread overview]
Message-ID: <4BB2147C.9010506@twiddle.net> (raw)
In-Reply-To: <7498607873ad7c9ff59d0a24d35391c0e4ba0a11.1269936879.git.eduard.munteanu@linux360.ro>

On 03/30/2010 01:20 AM, Eduard - Gabriel Munteanu wrote:
> +    /* Ignore preexisting garbage in checksum. */
> +    acpi_hdr = (struct acpi_table_header *) data;
> +    sum -= acpi_hdr->checksum;
> +
>      return (-sum) & 0xff;

Wouldn't it be cleaner to adjust the acpi_checksum definition to take
and acpi_table_header operand instead of uint8_t?  And given it's only
usage, perhaps update the checksum instead of returning it?  E.g.

-    ((struct acpi_table_header*)p)->checksum = acpi_checksum((uint8_t*)p, off);
+    acpi_update_checksum((struct acpi_table_header *)p, off);


r~

  reply	other threads:[~2010-03-30 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  8:20 [RFC PATCH 0/7] Beginning implementing the AMD IOMMU emulation Eduard - Gabriel Munteanu
2010-03-30  8:20 ` [RFC PATCH 1/7] acpi: qemu_realloc() might return a different pointer Eduard - Gabriel Munteanu
2010-03-30  8:20 ` [RFC PATCH 2/7] acpi: split and rename acpi_table_add() Eduard - Gabriel Munteanu
2010-03-30  8:20 ` [RFC PATCH 3/7] acpi: move table header definition into pc.h Eduard - Gabriel Munteanu
2010-03-30  8:20 ` [RFC PATCH 4/7] sparc: rename hw/iommu.c Eduard - Gabriel Munteanu
2010-03-30 17:06   ` [Qemu-devel] " Blue Swirl
2010-03-30 19:28     ` Joerg Roedel
2010-03-30 20:00       ` Blue Swirl
2010-03-30 20:15         ` Eduard - Gabriel Munteanu
2010-03-31  7:27     ` Gerd Hoffmann
2010-03-30  8:20 ` [RFC PATCH 5/7] x86-64: AMD IOMMU stub Eduard - Gabriel Munteanu
2010-03-30 20:37   ` Blue Swirl
2010-03-30  8:20 ` [RFC PATCH 6/7] acpi: cleanup acpi_checksum() Eduard - Gabriel Munteanu
2010-03-30  8:20 ` [RFC PATCH 7/7] acpi: fix bug in acpi_checksum() caused by garbage in checksum field Eduard - Gabriel Munteanu
2010-03-30 15:10   ` Richard Henderson [this message]
2010-03-30 19:40 ` [RFC PATCH 0/7] Beginning implementing the AMD IOMMU emulation Joerg Roedel
2010-03-31  5:38   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB2147C.9010506@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=eduard.munteanu@linux360.ro \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox