mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: kprobes: get rid of distinct type warning
Date: Sat, 9 Jan 2010 18:45:17 +0100	[thread overview]
Message-ID: <20100109174517.GA3237@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20100108161848.1fe19b5e.akpm@linux-foundation.org>

On Fri, Jan 08, 2010 at 04:18:48PM -0800, Andrew Morton wrote:
> On Tue, 5 Jan 2010 09:40:27 +0100
> Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> > --- a/include/linux/cpumask.h
> > +++ b/include/linux/cpumask.h
> > @@ -90,10 +90,10 @@ extern const struct cpumask *const cpu_a
> >  #define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
> >  #define cpu_active(cpu)		cpumask_test_cpu((cpu), cpu_active_mask)
> >  #else
> > -#define num_online_cpus()	1
> > -#define num_possible_cpus()	1
> > -#define num_present_cpus()	1
> > -#define num_active_cpus()	1
> > +#define num_online_cpus()	1U
> > +#define num_possible_cpus()	1U
> > +#define num_present_cpus()	1U
> > +#define num_active_cpus()	1U
> >  #define cpu_online(cpu)		((cpu) == 0)
> >  #define cpu_possible(cpu)	((cpu) == 0)
> >  #define cpu_present(cpu)	((cpu) == 0)
> 
> I assume that this fixes the kprobes warning, so 
> 
> Commit-ID:  c2ef6661ce62e26a8c0978e521fab646128a144b
> Gitweb:     http://git.kernel.org/tip/c2ef6661ce62e26a8c0978e521fab646128a144b
> Author:     Heiko Carstens <heiko.carstens@de.ibm.com>
> AuthorDate: Mon, 21 Dec 2009 13:02:24 +0100
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Mon, 28 Dec 2009 10:25:31 +0100
> 
> becomes unneeded?

Nah, that would be too easy. The code still compares an int (10) and
an unsigned int. The only thing that could be changed with this patch
is that max_t isn't needed anymore, so that the patch below would
work as well (10U).
But I don't think it's worth it.

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b7df302..85222a9 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1035,7 +1035,7 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
 	/* Pre-allocate memory for max kretprobe instances */
 	if (rp->maxactive <= 0) {
 #ifdef CONFIG_PREEMPT
-		rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus());
+		rp->maxactive = max(10U, 2*num_possible_cpus());
 #else
 		rp->maxactive = num_possible_cpus();
 #endif

      reply	other threads:[~2010-01-09 17:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21 10:15 Heiko Carstens
2009-12-21 11:17 ` Ananth N Mavinakayanahalli
2009-12-21 12:02   ` Heiko Carstens
2009-12-28 10:08     ` [tip:perf/urgent] kprobes: Fix " tip-bot for Heiko Carstens
2009-12-30 21:29     ` kprobes: get rid of " Andrew Morton
2010-01-04 15:57       ` Heiko Carstens
2010-01-04 22:45         ` Rusty Russell
2010-01-05  8:40           ` Heiko Carstens
2010-01-09  0:18             ` Andrew Morton
2010-01-09 17:45               ` Heiko Carstens [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=20100109174517.GA3237@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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

Powered by JetHome