public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: shinkoi2005a <shinkoi2005a@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: printk format "%4.4s"
Date: Mon, 17 Sep 2007 10:16:42 +0200	[thread overview]
Message-ID: <46EE37EA.7020802@panasas.com> (raw)
In-Reply-To: <46EDD114.7010403@gmail.com>

On Sep 17, 2007, 2:57 +0200, shinkoi2005a <shinkoi2005a@gmail.com> wrote:
> Hi, all
> 
> I have a question about printk format.
> 
> Can printk format use "%4.4s"?

Yes it can.
The precision part of the format determines the max number
of characters to copy from the string.
The 4 byte signature array might not null terminated
so you must use the .4 in the format otherwise vsnprintf
might look over the buffer for the terminating '\0'.

> This format is used following source.
> 
> #############
> drivers/acpi/tables/tbinstal.c
>                 ACPI_ERROR((AE_INFO,
>                             "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
>                             table_desc->pointer->signature));
> 
> ##############
> At least, my dmesg is buggy output like that..

Hmm, looks like you should believe the error messages
rather than blaming the code for buggy output ;-)

Like it says, the table seems corrupt, has invalid signature
and checksum.

> 
> ##############
> $ dmesg
> (snip)
> ACPI Warning (tbutils-0158): Incorrect checksum in table [  ^E礑 -  00, should b
> e F6 [20070126]
> ACPI Error (tbinstal-0134): Table has invalid signature [  ^E礑, must be SSDT, P
> SDT or OEMx [20070126]
> (snip)
> ##############
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


      reply	other threads:[~2007-09-17  8:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17  0:57 printk format "%4.4s" shinkoi2005a
2007-09-17  8:16 ` Benny Halevy [this message]

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=46EE37EA.7020802@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shinkoi2005a@gmail.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