public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* connector.h
@ 2005-04-01  1:31 Andrew Morton
  2005-04-01  7:09 ` connector.h Evgeniy Polyakov
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2005-04-01  1:31 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: linux-kernel


> 
> struct cb_id
> {
> 	__u32			idx;
> 	__u32			val;
> };

It is vital that all data structures be skilfully commented - they are the
key to understanding the code.  Why the struct exists, which actor passes
it to which other actor(s), whether the data structure is communicated with
userspace, what other data structures it is aggregated with or linked to,
locking rules, etc.

> struct cn_msg
> {

Please do

	struct cn_msg {

> 
> #define CN_CBQ_NAMELEN		32

Commentary?



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

* Re: connector.h
  2005-04-01  1:31 connector.h Andrew Morton
@ 2005-04-01  7:09 ` Evgeniy Polyakov
  2005-04-01  7:44   ` connector.h Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Evgeniy Polyakov @ 2005-04-01  7:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

On Thu, 2005-03-31 at 17:31 -0800, Andrew Morton wrote:
> > 
> > struct cb_id
> > {
> > 	__u32			idx;
> > 	__u32			val;
> > };
> 
> It is vital that all data structures be skilfully commented - they are the
> key to understanding the code.  Why the struct exists, which actor passes
> it to which other actor(s), whether the data structure is communicated with
> userspace, what other data structures it is aggregated with or linked to,
> locking rules, etc.

It is described in Documentation/connector/connector.txt.
Should it also be placed here?

> > struct cn_msg
> > {
> 
> Please do
>
> 	struct cn_msg {

Neither structure declaration should have opening brace on the new
string?

> > 
> > #define CN_CBQ_NAMELEN		32
> 
> Commentary?

Maximum allowed callback name - name will be truncated if 
it exceeds that limit.

I will place this doc in the code.

-- 
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: connector.h
  2005-04-01  7:09 ` connector.h Evgeniy Polyakov
@ 2005-04-01  7:44   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2005-04-01  7:44 UTC (permalink / raw)
  To: johnpol; +Cc: linux-kernel

Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
>
> On Thu, 2005-03-31 at 17:31 -0800, Andrew Morton wrote:
> > > 
> > > struct cb_id
> > > {
> > > 	__u32			idx;
> > > 	__u32			val;
> > > };
> > 
> > It is vital that all data structures be skilfully commented - they are the
> > key to understanding the code.  Why the struct exists, which actor passes
> > it to which other actor(s), whether the data structure is communicated with
> > userspace, what other data structures it is aggregated with or linked to,
> > locking rules, etc.
> 
> It is described in Documentation/connector/connector.txt.
> Should it also be placed here?

I think it's better to document these things in the code.  Those structs
which are communicated to userspace should be described in connector.txt
because they are part of the API.  But a lot of the structs you have there
are purely knerel-internal.

> > > struct cn_msg
> > > {
> > 
> > Please do
> >
> > 	struct cn_msg {
> 
> Neither structure declaration should have opening brace on the new
> string?

I don't understand your question.

We lay out struct definitions thusly:

struct foo {
	int a;
	int b;
};



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

end of thread, other threads:[~2005-04-01  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-01  1:31 connector.h Andrew Morton
2005-04-01  7:09 ` connector.h Evgeniy Polyakov
2005-04-01  7:44   ` connector.h Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox