public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Bernhard Walle <bwalle@suse.de>
Cc: Laurent Riffard <laurent.riffard@free.fr>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix CONFIG_NOHIGHMEM for extended crashkernel command line
Date: Tue, 25 Sep 2007 00:06:24 -0700	[thread overview]
Message-ID: <20070925000624.46bcf2b7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070925065528.GA25783@suse.de>

On Tue, 25 Sep 2007 08:55:29 +0200 Bernhard Walle <bwalle@suse.de> wrote:

> @@ -381,6 +381,20 @@ extern unsigned long __init setup_memory
>  extern void zone_sizes_init(void);
>  #endif /* !CONFIG_NEED_MULTIPLE_NODES */
>  
> +

Only one line is needed between functions, please.

> +#ifdef CONFIG_HIGHMEM
> +static inline unsigned long long get_total_mem(void)
> +{
> +	return (max_low_pfn + highend_pfn - highstart_pfn) << PAGE_SHIFT;
> +}
> +#else
> +static inline unsigned long long get_total_mem(void)
> +{
> +	return max_low_pfn << PAGE_SHIFT;
> +}
> +#endif
> +
> +

Full of bugs.  (unsigned long << foo) returns an unsigned long.  With >4G
there will be truncation.

Please review the full patchset for other occurrences of this.

      reply	other threads:[~2007-09-25  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25  6:55 [PATCH] Fix CONFIG_NOHIGHMEM for extended crashkernel command line Bernhard Walle
2007-09-25  7:06 ` Andrew Morton [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=20070925000624.46bcf2b7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bwalle@suse.de \
    --cc=laurent.riffard@free.fr \
    --cc=linux-kernel@vger.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