All of lore.kernel.org
 help / color / mirror / Atom feed
* Which comments is unnessary?
@ 2015-07-14 17:07 Navy
  2015-07-14 17:38 ` Miles Fidelman
  0 siblings, 1 reply; 2+ messages in thread
From: Navy @ 2015-07-14 17:07 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Which comments is unnessary?
  2015-07-14 17:07 Which comments is unnessary? Navy
@ 2015-07-14 17:38 ` Miles Fidelman
  0 siblings, 0 replies; 2+ messages in thread
From: Miles Fidelman @ 2015-07-14 17:38 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-14 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 17:07 Which comments is unnessary? Navy
2015-07-14 17:38 ` Miles Fidelman

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.