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, 29 Sep 2008 11:05:39 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Ingo Molnar <mingo@...e.hu>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	prasad@...ux.vnet.ibm.com,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Mathieu Desnoyers <compudj@...stal.dyndns.org>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	David Wilder <dwilder@...ibm.com>, hch@....de,
	Martin Bligh <mbligh@...gle.com>,
	Christoph Hellwig <hch@...radead.org>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Steven Rostedt <srostedt@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH v9] Unified trace buffer


On Sat, 27 Sep 2008, Ingo Molnar wrote:
> 
> > > no, it is not readable. My point was that you should do:
> > > > 
> > > >    RB_ENUM_TYPE,	/*
> > > > 			 * Comment
> > > > 			 */
> > > > 
> > > > The comment is not at the same line as the enum, which also looks 
> > > > unpleasing.
> > > 
> > > but you did:
> > > 
> > > >    RB_ENUM_TYPE,	/* Comment
> > > > 			 */
> > > 

OK, I did a quick survey of what others did in include/linux to handle 
multi line comments for enums. I ignored the single line comments since 
that is pretty standard. Here's what I found:

Those that do:

enum myenum {
	ENUM_PING_PONG,		/* Bounce a ball back and forth
				   till you have a winner. */
	ENUM_HONEY_CONE,	/* Soft and sweet a yummy for
				   the tummy. */
};

include/linux/atmdev.h
include/linux/fd.h
include/linux/hil.h
include/linux/if_pppol2tp.h
include/linux/ivtv.h
include/linux/libata.h
include/linux/mmzone.h
include/linux/reiserfs_fs.h
include/linux/reiserfs_fs_sb.h
include/linux/rtnetlink.h
include/linux/scc.h
include/linux/videodev2.h

Those that do:

enum myenum {
        ENUM_PING_PONG,         /* Bounce a ball back and forth */
                                /* till you have a winner.      */
        ENUM_HONEY_CONE,        /* Soft and sweet a yummy for   */
                                /* the tummy.                   */
};

include/linux/atmsvc.h
include/linux/pktcdvd.h


Those that do (what I did):

enum myenum {
        ENUM_PING_PONG,         /* Bounce a ball back and forth
                                 * till you have a winner.
				 */
        ENUM_HONEY_CONE,        /* Soft and sweet a yummy for
                                 * the tummy.
				 */
};

include/linux/buffer_head.h (with space between the two enums)
include/linux/personality.h


Those that do:

enum myenum {
	/*
	 * Bounce a ball back and forth
	 * till you have a winner.
	 */
        ENUM_PING_PONG,
	/*
	 * Soft and sweet a yummy for
	 * the tummy.
	 */
        ENUM_HONEY_CONE,
};

include/linux/cgroup.h
include/linux/cn_proc.h
include/linux/exportfs.h
include/linux/fb.h
include/linux/hil_mlc.h
include/linux/pci.h
include/linux/reiserfs_fs_i.h


And finally Doc book style:

/**
 * enum myenum
 * @ENUM_PING_PONG: Bounce a ball back and forth
 *                  till you have a winner.
 * @ENUM_HONEY_CONE: Soft and sweet a yummy for
 *                   the tummy.
 */
enum myenum {
	ENUM_PING_PONG,
	ENUM_HONEY_CONE,
};

Note I did not see any enum users that did what you asked:

enum myenum {
        ENUM_PING_PONG,		/*
				 * Bounce a ball back and forth
				 * till you have a winner.
				 */
        ENUM_HONEY_CONE,	/*
				 * Soft and sweet a yummy for
				 * the tummy.
				 */
};

So by adding that, I will be adding yet another format.

Actually I think the docbook style is the most appropriate for me. I'll go 
with that one.

Thanks,

-- Steve

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