diff mbox

[1/3] Fix aml_name_string() to recognize block name modifiers.

Message ID 1337504620-20378-1-git-send-email-gleb@redhat.com
State New
Headers show

Commit Message

Gleb Natapov May 20, 2012, 9:03 a.m. UTC
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 tools/acpi_extract.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Comments

Alon Levy May 20, 2012, 10:32 a.m. UTC | #1
On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote:
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>  tools/acpi_extract.py |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
> index 5f613e4..8038269 100755
> --- a/tools/acpi_extract.py
> +++ b/tools/acpi_extract.py
> @@ -121,7 +121,11 @@ def aml_name_string(offset):
>      if (aml[offset] != 0x08):
>          die( "Name offset 0x%x: expected 0x08 actual 0x%x" %
>               (offset, aml[offset]));
> -    return offset + 1;
> +    offset += 1
> +    # Block Name Modifier. Skip it.
> +    if (aml[offset] == 0x5c or aml[offset] == 0x5e):

You don't need parenthesis around the whole conditional.

> +        offset += 1
> +    return offset;
>  
>  # Given data offset, find dword const offset
>  def aml_data_dword_const(offset):
> -- 
> 1.7.7.3
> 
> 
> _______________________________________________
> SeaBIOS mailing list
> SeaBIOS@seabios.org
> http://www.seabios.org/mailman/listinfo/seabios
Gleb Natapov May 20, 2012, 11:13 a.m. UTC | #2
On Sun, May 20, 2012 at 01:32:18PM +0300, Alon Levy wrote:
> On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote:
> > 
> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > ---
> >  tools/acpi_extract.py |    6 +++++-
> >  1 files changed, 5 insertions(+), 1 deletions(-)
> > 
> > diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
> > index 5f613e4..8038269 100755
> > --- a/tools/acpi_extract.py
> > +++ b/tools/acpi_extract.py
> > @@ -121,7 +121,11 @@ def aml_name_string(offset):
> >      if (aml[offset] != 0x08):
> >          die( "Name offset 0x%x: expected 0x08 actual 0x%x" %
> >               (offset, aml[offset]));
> > -    return offset + 1;
> > +    offset += 1
> > +    # Block Name Modifier. Skip it.
> > +    if (aml[offset] == 0x5c or aml[offset] == 0x5e):
> 
> You don't need parenthesis around the whole conditional.
Rest of the code has it. Better to keep same style :)

> 
> > +        offset += 1
> > +    return offset;
> >  
> >  # Given data offset, find dword const offset
> >  def aml_data_dword_const(offset):
> > -- 
> > 1.7.7.3
> > 
> > 
> > _______________________________________________
> > SeaBIOS mailing list
> > SeaBIOS@seabios.org
> > http://www.seabios.org/mailman/listinfo/seabios

--
			Gleb.
Kevin O'Connor May 23, 2012, 1:23 a.m. UTC | #3
On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote:
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>

The patch series looks okay to me.  Let me know when the corresponding
qemu patches are committed.

-Kevin
Gleb Natapov June 20, 2012, 1:08 p.m. UTC | #4
On Tue, May 22, 2012 at 09:23:03PM -0400, Kevin O'Connor wrote:
> On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote:
> > 
> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> 
> The patch series looks okay to me.  Let me know when the corresponding
> qemu patches are committed.
> 
It is committed now: 459ae5ea5ad682c2b3220beb244d4102c1a4e332

--
			Gleb.
Kevin O'Connor June 22, 2012, 1:06 a.m. UTC | #5
On Wed, Jun 20, 2012 at 04:08:41PM +0300, Gleb Natapov wrote:
> On Tue, May 22, 2012 at 09:23:03PM -0400, Kevin O'Connor wrote:
> > On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote:
> > > 
> > > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > 
> > The patch series looks okay to me.  Let me know when the corresponding
> > qemu patches are committed.
> > 
> It is committed now: 459ae5ea5ad682c2b3220beb244d4102c1a4e332

Thanks.  I committed your seabios patches.

-Kevin
diff mbox

Patch

diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
index 5f613e4..8038269 100755
--- a/tools/acpi_extract.py
+++ b/tools/acpi_extract.py
@@ -121,7 +121,11 @@  def aml_name_string(offset):
     if (aml[offset] != 0x08):
         die( "Name offset 0x%x: expected 0x08 actual 0x%x" %
              (offset, aml[offset]));
-    return offset + 1;
+    offset += 1
+    # Block Name Modifier. Skip it.
+    if (aml[offset] == 0x5c or aml[offset] == 0x5e):
+        offset += 1
+    return offset;
 
 # Given data offset, find dword const offset
 def aml_data_dword_const(offset):