lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Dec 2009 13:02:24 +0100
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Ananth N Mavinakayanahalli <ananth@...ibm.com>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: kprobes: get rid of distinct type warning

On Mon, Dec 21, 2009 at 04:47:59PM +0530, Ananth N Mavinakayanahalli wrote:
> On Mon, Dec 21, 2009 at 11:15:49AM +0100, Heiko Carstens wrote:
> > From: Heiko Carstens <heiko.carstens@...ibm.com>
> > 
> > Every time I see this:
> > 
> > kernel/kprobes.c: In function 'register_kretprobe':
> > kernel/kprobes.c:1038: warning: comparison of distinct pointer types lacks a cast
> > 
> > I'm wondering if something changed in common code and we need to do
> > something for s390. Apparently that's not the case.
> > Let's get rid of this annoying warning.
> > 
> > Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
> > Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>
> 
> Acked-by: Ananth N Mavinakayanahalli <ananth@...ibm.com>
> 
> Thanks Heiko. I'd tested this on x86 and powerpc and neither throws the
> warning. No wonder I missed it.

Of course the patch wouldn't help for CONFIG_PREEMPT and !CONFIG_SMP since
we would have a comparison of a signed and and unsigned value again *sigh*.

So here's an updated version that should always work:

Subject: [PATCH] kprobes: get rid of distinct type warning

From: Heiko Carstens <heiko.carstens@...ibm.com>

Every time I see this:

kernel/kprobes.c: In function 'register_kretprobe':
kernel/kprobes.c:1038: warning: comparison of distinct pointer types lacks a cast

I'm wondering if something changed in common code and we need to do
something for s390. Apparently that's not the case.
Let's get rid of this annoying warning.

Acked-by: Ananth N Mavinakayanahalli <ananth@...ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>
---
 kernel/kprobes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1035,7 +1035,7 @@ int __kprobes register_kretprobe(struct 
 	/* Pre-allocate memory for max kretprobe instances */
 	if (rp->maxactive <= 0) {
 #ifdef CONFIG_PREEMPT
-		rp->maxactive = max(10, 2 * num_possible_cpus());
+		rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus());
 #else
 		rp->maxactive = num_possible_cpus();
 #endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ