linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: lv.zheng@intel.com
Cc: linux-acpi@vger.kernel.org
Subject: Re: ACPICA: Tables: Cleanup RSDP signature codes.
Date: Thu, 17 Oct 2013 15:39:42 +0300	[thread overview]
Message-ID: <20131017123942.GG5550@mwanda> (raw)
In-Reply-To: <20130926223520.GA25642@elgon.mountain>

Does anyone have an idea about this?  The code is obviously wrong but
the fix is unclear.  Perhaps we should just note the bug in a comment?

regards,
dan carpenter

On Fri, Sep 27, 2013 at 01:35:20AM +0300, Dan Carpenter wrote:
> Hello Lv Zheng,
> 
> I'm sorry to bother you about this.  This code has been this way for
> years, but your recent formatting cleanups made it into something Smatch
> could understand and complain about.  Hopefully, you could take a look?
> 
> The patch cacba8657351: "ACPICA: Tables: Cleanup RSDP signature
> codes." from Sep 23, 2013, leads to the following
> static checker warning: "drivers/acpi/acpica/tbprint.c:141
> acpi_tb_print_table_header()
> 	 error: strncmp() '((((header->signature))))' too small (4 vs 8)"
> 
> drivers/acpi/acpica/tbprint.c
>    138                  ACPI_INFO((AE_INFO, "%4.4s %p %05X",
>    139                             header->signature, ACPI_CAST_PTR(void, address),
>    140                             header->length));
>    141          } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The RSDP_SIG is an 8 character signature but the header->signature
> buffer only has 4 characters so the signatures never match.  What's the
> deal with that?
> 
>    142  
>    143                  /* RSDP has no common fields */
>    144  
>    145                  ACPI_MEMCPY(local_header.oem_id,
>    146                              ACPI_CAST_PTR(struct acpi_table_rsdp,
>    147                                            header)->oem_id, ACPI_OEM_ID_SIZE);
> 
> regards,
> dan carpenter

  reply	other threads:[~2013-10-17 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 22:35 ACPICA: Tables: Cleanup RSDP signature codes Dan Carpenter
2013-10-17 12:39 ` Dan Carpenter [this message]
2013-10-25  5:49   ` Aaron Lu

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=20131017123942.GG5550@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).