mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Eder <hannes@hanneseder.net>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Ingo Molnar <mingo@elte.hu>, x86 maintainers <x86@kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>, Yinghai Lu <yinghai@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [git-pull -tip] x86: cleanup patches 20090322
Date: Mon, 23 Mar 2009 11:35:06 +0100	[thread overview]
Message-ID: <154e089b0903230335q1fbdcc4biea140738b01e7a36@mail.gmail.com> (raw)
In-Reply-To: <1237801506.2485.7.camel@ht.satnam>

On Mon, Mar 23, 2009 at 10:45 AM, Jaswinder Singh Rajput
<jaswinder@kernel.org> wrote:
> On Mon, 2009-03-23 at 18:45 +1030, Rusty Russell wrote:
>> On Monday 23 March 2009 07:22:56 Jaswinder Singh Rajput wrote:
>> >       x86: e820.h fix various signedness issues in setup.c and e820.c
>>
>> Wouldn't fixing the users be better than changing the header?  Esp. since
>> it could well now cause similar warnings in userspace programs.
>>
>> >  struct e820map {
>> > -   __u32 nr_map;
>> > +   __s32 nr_map;
>> >     struct e820entry map[E820_X_MAX];
>> >  };
>>
>> This number can't be negative!
>>
>
> Is this OK, or should I go more further:

since sanitize_e820_map does only modify its third argument on
success, and leaves it untouched on error, the temporary variable
could be eliminated in some places.

> From: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> Date: Mon, 23 Mar 2009 02:13:01 +0530
> Subject: [PATCH] x86: e820 fix various signedness issues in setup.c and e820.c
>
> Impact: cleanup
>
> This fixed various signedness issues in setup.c and e820.c:
> arch/x86/kernel/setup.c:455:53: warning: incorrect type in argument 3 (different signedness)
> arch/x86/kernel/setup.c:455:53:    expected int *pnr_map
> arch/x86/kernel/setup.c:455:53:    got unsigned int extern [toplevel] *<noident>
> arch/x86/kernel/setup.c:639:53: warning: incorrect type in argument 3 (different signedness)
> arch/x86/kernel/setup.c:639:53:    expected int *pnr_map
> arch/x86/kernel/setup.c:639:53:    got unsigned int extern [toplevel] *<noident>
> arch/x86/kernel/setup.c:820:54: warning: incorrect type in argument 3 (different signedness)
> arch/x86/kernel/setup.c:820:54:    expected int *pnr_map
> arch/x86/kernel/setup.c:820:54:    got unsigned int extern [toplevel] *<noident>
>
> arch/x86/kernel/e820.c:670:53: warning: incorrect type in argument 3 (different signedness)
> arch/x86/kernel/e820.c:670:53:    expected int *pnr_map
> arch/x86/kernel/e820.c:670:53:    got unsigned int [toplevel] *<noident>
>
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
>  arch/x86/include/asm/e820.h |    2 +-
>  arch/x86/kernel/e820.c      |   10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
> index 00d41ce..7ecba4d 100644
> --- a/arch/x86/include/asm/e820.h
> +++ b/arch/x86/include/asm/e820.h
> @@ -72,7 +72,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type);
>  extern void e820_add_region(u64 start, u64 size, int type);
>  extern void e820_print_map(char *who);
>  extern int
> -sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, int *pnr_map);
> +sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
>  extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
>                               unsigned new_type);
>  extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index fb638d9..ef2c356 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -233,7 +233,7 @@ void __init e820_print_map(char *who)
>  */
>
>  int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
> -                               int *pnr_map)
> +                            u32 *pnr_map)
>  {
>        struct change_member {
>                struct e820entry *pbios; /* pointer to original bios entry */
> @@ -552,7 +552,7 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
>
>  void __init update_e820(void)
>  {
> -       int nr_map;
> +       u32 nr_map;
>
>        nr_map = e820.nr_map;
>        if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map))
> @@ -563,7 +563,7 @@ void __init update_e820(void)
>  }
>  static void __init update_e820_saved(void)
>  {
> -       int nr_map;
> +       u32 nr_map;
>
>        nr_map = e820_saved.nr_map;
>        if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map))
> @@ -1303,7 +1303,7 @@ early_param("memmap", parse_memmap_opt);
>  void __init finish_e820_parsing(void)
>  {
>        if (userdef) {
> -               int nr = e820.nr_map;
> +               u32 nr = e820.nr_map;
>
>                if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0)
>                        early_panic("Invalid user supplied memory map");
> @@ -1386,7 +1386,7 @@ void __init e820_reserve_resources_late(void)
>  char *__init default_machine_specific_memory_setup(void)
>  {
>        char *who = "BIOS-e820";
> -       int new_nr;
> +       u32 new_nr;
>        /*
>         * Try to copy the BIOS-supplied E820-map.
>         *
> --
> 1.6.0.6
>
>
>
> --
> 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:[~2009-03-23 10:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22 20:52 Jaswinder Singh Rajput
2009-03-23  8:15 ` Rusty Russell
2009-03-23  9:45   ` Jaswinder Singh Rajput
2009-03-23 10:35     ` Hannes Eder [this message]
2009-03-23 10:52       ` Jaswinder Singh Rajput
2009-03-23 21:10     ` Rusty Russell
2009-03-23 21:16       ` Sam Ravnborg
2009-03-23 10:07   ` Jaswinder Singh Rajput

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=154e089b0903230335q1fbdcc4biea140738b01e7a36@mail.gmail.com \
    --to=hannes@hanneseder.net \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.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

all inboxes | Powered by JetHome®