Messages in this thread | | | Date | Mon, 29 Sep 2008 11:05:39 -0400 (EDT) | From | Steven Rostedt <> | 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
| |