mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bert Wesarg" <bert.wesarg@googlemail.com>
To: "Mike Travis" <travis@sgi.com>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] x86: modify show_shared_cpu_map in intel_cacheinfo v2
Date: Mon, 7 Apr 2008 15:57:29 +0200	[thread overview]
Message-ID: <36ca99e90804070657t4435f1a2ldd78ad5bf5978550@mail.gmail.com> (raw)
In-Reply-To: <20080405012447.770671000@polaris-admin.engr.sgi.com>

On Sat, Apr 5, 2008 at 3:24 AM, Mike Travis <travis@sgi.com> wrote:
>  --- linux-2.6.x86.orig/arch/x86/kernel/cpu/intel_cacheinfo.c
>  +++ linux-2.6.x86/arch/x86/kernel/cpu/intel_cacheinfo.c
>  @@ -593,14 +593,17 @@ static ssize_t show_size(struct _cpuid4_
>
>   static ssize_t show_shared_cpu_map(struct _cpuid4_info *this_leaf, char *buf)
>   {
>  +       unsigned long end = ALIGN((unsigned long)buf, PAGE_SIZE);
May I suggest this:

           ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf;

>  +       if (len == 0)
>  +               len = PAGE_SIZE;
Than this is not necessary.

>  +
>  +       if (len >= 2) {
>  +               n = cpus_scnprintf(buf, len-2, this_leaf->shared_cpu_map);
>  +               buf[n++] = '\n';
>  +               buf[n] = '\0';
>         }
>         return n;
>   }
Apart from my suggestion and the use of cpus_scnprintf I think this patch is ok.

Bert

PS: sorry for the long delay.

  reply	other threads:[~2008-04-07 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05  1:24 [PATCH 0/4] x86: add cpus_scnprintf function v2 Mike Travis
2008-04-05  1:24 ` [PATCH 1/4] " Mike Travis
2008-04-05  1:24 ` [PATCH 2/4] x86: modify show_shared_cpu_map in intel_cacheinfo v2 Mike Travis
2008-04-07 13:57   ` Bert Wesarg [this message]
2008-04-07 18:45     ` Mike Travis
2008-04-05  1:24 ` [PATCH 3/4] cpumask: use new cpus_scnprintf function v2 Mike Travis
2008-04-05  1:24 ` [PATCH 4/4] cpumask: add show cpu map functions Mike Travis
2008-04-07  8:04 ` [PATCH 0/4] x86: add cpus_scnprintf function v2 Paul Jackson
2008-04-07  8:16   ` Ingo Molnar
2008-04-07  8:44     ` Paul Jackson
2008-04-07 18:42     ` Mike Travis
2008-04-10 15:30     ` Paul Jackson
2008-04-07 14:07   ` Bert Wesarg
2008-04-07 18:22     ` Mike Travis

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=36ca99e90804070657t4435f1a2ldd78ad5bf5978550@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=travis@sgi.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

all inboxes | Powered by JetHome®