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:	Thu, 8 Sep 2011 20:42:00 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Jason Baron <jbaron@...hat.com>, gregkh@...e.de,
	jim.cromie@...il.com, bvanassche@....org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] dynamic_debug: consolidate repetitive struct
 _ddebug descriptor definitions

On Thu, 08 Sep 2011 19:13:16 -0700 Joe Perches <joe@...ches.com> wrote:

> On Thu, 2011-09-08 at 16:52 -0700, Andrew Morton wrote:
> > On Tue, 30 Aug 2011 14:28:41 -0400
> > Jason Baron <jbaron@...hat.com> wrote:
> > > Replace the repetitive struct _ddebug descriptor definitions with
> > > a new DECLARE_DYNAMIC_DEBUG_META_DATA(name, fmt) macro.
> > > +#define DECLARE_DYNAMIC_DEBUG_METADATA(name, fmt)		\
> > > +	static struct _ddebug __used __aligned(8)		\
> > > +	__attribute__((section("__verbose"))) name = {		\
> > > +		.modname = KBUILD_MODNAME,			\
> > > +		.function = __func__,				\
> > > +		.filename = __FILE__,				\
> > > +		.format = (fmt),				\
> > > +		.lineno = __LINE__,				\
> > > +		.flags =  _DPRINTK_FLAGS_DEFAULT,		\
> > > +		.enabled = false,				\
> > > +	}
> > <anal>That macro implements a definition, not a declaration</anal>
> 
> Andrew, that's not quite true

It's precisely true.

: Exercise 2.8
: 
: A declaration introduces a name and a type for something.  It does not
: necessarily reserve any storage.
: 
: Exercise 2.9
: 
: A definition is a declaration that also reserves storage.

(http://publications.gbdirect.co.uk/c_book/answers/chapter_2.html)

> and that's how
> DECLARE is normally used in linux.

It's how it's sometimes used, when we screwed up.

> DECLARE_BITMAP, DECLARE_COMPLETION, DECLARE_RWSEM, etc.

Mistakes.
--
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