Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2012 07:59:48 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r242988 - head/sys/sys
Message-ID:  <20121114074101.S3274@besplex.bde.org>
In-Reply-To: <201211131824.qADIOmqx095958@svn.freebsd.org>
References:  <201211131824.qADIOmqx095958@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Log:
>  Remove unused/obsolete macros.

Many more style bugs to fix are visible in the patch:

> Modified: head/sys/sys/lock.h
> ==============================================================================
> --- head/sys/sys/lock.h	Tue Nov 13 17:16:03 2012	(r242987)
> +++ head/sys/sys/lock.h	Tue Nov 13 18:24:47 2012	(r242988)
> @@ -304,16 +304,5 @@ void	witness_thread_exit(struct thread *
> #define	WITNESS_LINE(lock) (0)

1. space instead of tab before the value
2. bogus parentheses around a single token.

All the nearby stub macros have similar low quality.  Bugs in the others
include:
    A. gross indentation for (void)0
    B. missing parentheses around (void)0
    C. non-bug: some plain 0's really are plain and are preceded by a tab
    D. space instead of tab in the line before the above
    E. these 2 lines with their space for indentation don't line up the
       value with the grossly indented values or the plain 0 values.

> #endif	/* WITNESS */

3. tab before comment on ifdef.

>
> -/*
> - * Helper macros to allow developers to add explicit lock order checks
> - * wherever they please without having to actually grab a lock to do so.
> - */
> -#define	witness_check(l)						\
> -	WITNESS_CHECKORDER(&(l)->lock_object, LOP_EXCLUSIVE, LOCK_FILE,	\
> -	    LOCK_LINE, NULL)
> -
> -#define	witness_check_shared(l)						\
> -	WITNESS_CHECKORDER(&(l)->lock_object, 0, LOCK_FILE, LOCK_LINE, NULL)
> -
> #endif	/* _KERNEL */
> #endif	/* _SYS_LOCK_H_ */
>

4. 2 more instances of tab before comment on endif.
5. no blank line before the final endif to match the one for its bracketing
    ifdef (or rather the define for this.  This blank line is also needed to
    provide one after the _KERNEL endif, to match the one before the
    bracketing kernel ifdef.
6. backwards comment on final endif.

The WITNESS #else and #endif are also missing blank lines to match
the ones for the WITNESS #ifdef.

The density of style bugs in sys/lock.h is otherwise not very high,
exceot for unsorted prototypes and macros.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121114074101.S3274>