Subject: Re: CVS commit: src/sys/kern
To: None <tech-kern@netbsd.org>
From: Pavel Cahyna <pavel@netbsd.org>
List: tech-kern
Date: 10/22/2006 11:09:32
On Sun, Oct 22, 2006 at 04:16:02AM +0000, Thor Lancelot Simon wrote:
> On Sat, Oct 21, 2006 at 05:01:56PM +0000, Antti Kantee wrote:
> > 
> > Module Name:	src
> > Committed By:	pooka
> > Date:		Sat Oct 21 17:01:56 UTC 2006
> > 
> > Modified Files:
> > 	src/sys/kern: kern_proc.c
> > 
> > Log Message:
> > pool_get(): use PR_WAITOK, not M_WAITOK (which happens to be PR_NOWAIT ..)
> > 
> > XXX: not the first time this mistake has been made
> 
> find /usr/src/sys -name *.[ch"]" -exec grep -l pool_.*M_ "{"} ";"
> ./dev/raidframe/rf_reconmap.c
> ./kern/kern_kcont.c
> ./kern/kern_proc.c
> 
> There are probably more, in cases where a function argument is passed to
> pool_get() as the flag.
> 
> I think we should use different values for the constants and, if DIAGNOSTIC,
> assert that the constant is in fact in the correct range.

Could the compiler help here? For example, if we used enums instead of
plain int and macros?

Pavel