All of lore.kernel.org
 help / color / mirror / Atom feed
From: mfidelman@meetinghouse.net (Miles Fidelman)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Which comments is unnessary?
Date: Tue, 14 Jul 2015 13:38:24 -0400	[thread overview]
Message-ID: <55A54910.4060508@meetinghouse.net> (raw)
In-Reply-To: <20150714170713.GA12270@debian>

Seems to me that every comment there is useful to someone who might come 
along later and try to understand that piece of code, and what it's doing.

Navy wrote:
> Hi,
> Here is a code fragment, which comments is unnessary? I think the all the comments should be remove because the comments should show "What to do rather than "How to do?". Am I right?
>
>
> /************************************************************************
>   * Unit flag definitions for un_flags.
>   ************************************************************************/
> #define UN_ISOPEN	0x0001		/* Device is open		*/
> #define UN_CLOSING	0x0002		/* Line is being closed		*/
> #define UN_IMM		0x0004		/* Service immediately		*/
> #define UN_BUSY		0x0008		/* Some work this channel	*/
> #define UN_BREAKI	0x0010		/* Input break received		*/
> #define UN_PWAIT	0x0020		/* Printer waiting for terminal	*/
> #define UN_TIME		0x0040		/* Waiting on time		*/
> #define UN_EMPTY	0x0080		/* Waiting output queue empty	*/
> #define UN_LOW		0x0100		/* Waiting output low water mark*/
> #define UN_EXCL_OPEN	0x0200		/* Open for exclusive use	*/
> #define UN_WOPEN	0x0400		/* Device waiting for open	*/
> #define UN_WIOCTL	0x0800		/* Device waiting for open	*/
> #define UN_HANGUP	0x8000		/* Carrier lost			*/
>
> struct device;
>
> /************************************************************************
>   * Structure for terminal or printer unit.
>   ************************************************************************/
> struct un_t {
> 	int	magic;		/* Unit Magic Number.			*/
> 	struct	channel_t *un_ch;
> 	ulong	un_time;
> 	uint	un_type;
> 	uint	un_open_count;	/* Counter of opens to port		*/
> 	struct tty_struct *un_tty;/* Pointer to unit tty structure	*/
> 	uint	un_flags;	/* Unit flags				*/
> 	wait_queue_head_t un_flags_wait; /* Place to sleep to wait on unit */
> 	uint	un_dev;		/* Minor device number			*/
> 	struct device *un_sysfs;
> };
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


-- 
In theory, there is no difference between theory and practice.
In practice, there is.   .... Yogi Berra

      reply	other threads:[~2015-07-14 17:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 17:07 Which comments is unnessary? Navy
2015-07-14 17:38 ` Miles Fidelman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A54910.4060508@meetinghouse.net \
    --to=mfidelman@meetinghouse.net \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.