All of lore.kernel.org
 help / color / mirror / Atom feed
From: PUCCETTI Armand <armand.puccetti@cea.fr>
To: xen-devel@lists.xensource.com
Subject: e820.c : why char* ?
Date: Fri, 23 Jun 2006 18:09:51 +0200	[thread overview]
Message-ID: <449C124F.6050805@cea.fr> (raw)

In function

sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)

of file e820.c, the last argument is treated as an integer, but when 
compiling with gcc
it belongs to [-128,127].

Inside the body of that function, however, we use that argument as an 
int to fill up a table of a different
size, namely:

static struct change_member *change_point [256]
static struct change_member change_point_list [256]
static int __init sanitize_e820_map(struct e820entry * biosmap, char * 
pnr_map)
{
...
old_nr = *pnr_map;
...
for (i=0; i < 2*old_nr; i++) {
        change_point[i] = &change_point_list[i];
...
}

After the loop, change_point is not completely filled-up, as 
change_point [254] and change_point [255]
are never filled nor used.

Is it voluntary that pnr_map gets typed and used like this?

Armand

                 reply	other threads:[~2006-06-23 16:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=449C124F.6050805@cea.fr \
    --to=armand.puccetti@cea.fr \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.