public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <krh@redhat.com>
To: Christoph Hellwig <hch@infradead.org>,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	linux-kernel@vger.kernel.org, Kristian H??gsberg <krh@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux1394-devel <linux1394-devel@lists.sourceforge.net>
Subject: Re: [PATCH 1/6] firewire: handling of cards, buses, nodes
Date: Mon, 07 May 2007 19:42:15 -0400	[thread overview]
Message-ID: <463FB957.40707@redhat.com> (raw)
In-Reply-To: <20070502192214.GA1248@infradead.org>

Christoph Hellwig wrote:
> On Wed, May 02, 2007 at 02:15:42PM +0200, Stefan Richter wrote:
>> +/*						-*- c-basic-offset: 8 -*-
> 
> Please don't pollute the code with annotation for some editors.

OK.

>> + * fw-card.c - card level functions
> 
> Please don't put the filename into a comment inside the filename.
> It's not actually useful and it gets out of date very easily.

Yeah, true.

>> +static DECLARE_RWSEM(card_rwsem);
> 
> this one is only ever used with down_read/up_read so a normal
> mutex would probably better suited.

down_write/up_write, but yes, I'll change that to a mutex.  The card_rwsem was 
previously subsystem.rwsem, but that went away.

>> +static LIST_HEAD(card_list);
> 
> 
> 
>> +#define bib_pmc			((1) << 27)
>> +#define bib_bmc			((1) << 28)
>> +#define bib_isc			((1) << 29)
>> +#define bib_cmc			((1) << 30)
>> +#define bib_imc			((1) << 31)
> 
> These are rather odd names for constants.  They should at least
> start with an uppercase letter if not be all uppercase.  Also
> an enum might be right here.

Sure, I'll do that... all those uppercase letters hurt my eyes, though.

>> +static u32 *
>> +generate_config_rom (struct fw_card *card, size_t *config_rom_length)
> 
> Please don't put white spaces after the function identifier.

Ugh, yeah, I don't know why I keep doing that...

>> +	/* Initialize contents of config rom buffer.  On the OHCI
>> +	 * controller, block reads to the config rom accesses the host
>> +	 * memory, but quadlet read access the hardware bus info block
>> +	 * registers.  That's just crack, but it means we should make
>> +	 * sure the contents of bus info block in host memory mathces
>> +	 * the version stored in the OHCI registers. */
> 
> Normal style for block comments is:
> 
> 	/*
> 	 * Initialize contents of config rom buffer.  On the OHCI
> 	 * controller, block reads to the config rom accesses the host
> 	 * memory, but quadlet read access the hardware bus info block
> 	 * registers.  That's just crack, but it means we should make
> 	 * sure the contents of bus info block in host memory mathces
> 	 * the version stored in the OHCI registers.
> 	 */

Oh, ok, I can clean that up.

>> +struct fw_node {
>> +	u16 node_id;
>> +	u8 color;
>> +	u8 port_count;
>> +	unsigned link_on : 1;
>> +	unsigned initiated_reset : 1;
>> +	unsigned b_path : 1;
>> +	u8 phy_speed : 3; /* As in the self ID packet. */
>> +	u8 max_speed : 5; /* Minimum of all phy-speeds and port speeds on
>> +			   * the path from the local node to this node. */
>> +	u8 max_depth : 4; /* Maximum depth to any leaf node */
>> +	u8 max_hops : 4;  /* Max hops in this sub tree */
> 
> I don't think we need to save the few bits here and can just use
> u8 instead of bitfields.

These bitfields aren't used on the wire or anywhere outside the driver... what 
the problem? Perfomance?

>> +		/* Pop the child nodes off the stack and push the new node. */
>> +		__list_del(h->prev, &stack);
> 
> Please don't ever use __list_del directly, it's an interna implementation
> detail.

Do you have an alternative suggestion here?  I need to take a sub-list of the 
list, which is exactly what __list_del does.  I could loop through the 
sublist, but it's pretty pointless since I have both ends of the sublist.

> I also notices that close to none of the export functions have kerneldoc
> comment blocks.  I think we really should have them on something that
> is a driver API.

Yeah... I'll sit down and try to document it better.

thanks
Kristian

  reply	other threads:[~2007-05-07 23:44 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01 20:27 [git pull] New firewire stack Kristian Høgsberg
2007-05-01 21:34 ` Stefan Richter
2007-05-02  9:00 ` Christoph Hellwig
2007-05-02 12:13   ` Stefan Richter
2007-05-02 12:15     ` [PATCH 1/6] firewire: handling of cards, buses, nodes Stefan Richter
2007-05-02 12:16       ` [PATCH 2/6] firewire: isochronous and asynchronous I/O Stefan Richter
2007-05-02 12:17         ` [PATCH 3/6] firewire: char device interface Stefan Richter
2007-05-02 12:18           ` [PATCH 4/6] firewire: OHCI-1394 lowlevel driver Stefan Richter
2007-05-02 12:18             ` [PATCH 5/6] firewire: SBP-2 highlevel driver Stefan Richter
2007-05-02 12:19               ` [PATCH 6/6] firewire: add it all to kbuild Stefan Richter
2007-05-02 18:05                 ` Stefan Richter
2007-05-02 19:44                 ` Christoph Hellwig
2007-05-02 23:01                   ` Stefan Richter
2007-05-03  4:15                     ` Sam Ravnborg
2007-05-03  8:10                     ` Christoph Hellwig
2007-05-08  0:14                       ` Kristian Høgsberg
2007-05-02 19:44               ` [PATCH 5/6] firewire: SBP-2 highlevel driver Christoph Hellwig
2007-05-02 21:53                 ` Stefan Richter
2007-05-02 22:10                   ` Stefan Richter
2007-05-04  9:53                   ` Christoph Hellwig
2007-05-04 11:20                     ` Stefan Richter
2007-05-09 21:05                 ` Kristian Høgsberg
2007-05-09 21:48                   ` Stefan Richter
2007-05-09 21:57                   ` Stefan Richter
2007-05-09 22:13                     ` Kristian Høgsberg
2007-05-09 22:56                       ` Stefan Richter
2007-05-04 11:11             ` [PATCH 4/6] firewire: OHCI-1394 lowlevel driver Christoph Hellwig
2007-05-09 23:40               ` Kristian Høgsberg
2007-05-02 15:35           ` [PATCH 3/6] firewire: char device interface John Stoffel
2007-05-02 16:06             ` Stefan Richter
2007-05-02 21:11             ` Kristian Høgsberg
2007-05-04  9:48               ` Christoph Hellwig
2007-05-08  0:19                 ` Kristian Høgsberg
2007-05-02 19:30           ` Christoph Hellwig
2007-05-08  0:08             ` Kristian Høgsberg
2007-05-02 19:29         ` [PATCH 2/6] firewire: isochronous and asynchronous I/O Christoph Hellwig
2007-05-03  0:08           ` Kristian Høgsberg
2007-05-03  8:54             ` Stefan Richter
2007-05-02 15:55       ` [PATCH 1/6] firewire: handling of cards, buses, nodes Pekka Enberg
2007-05-02 19:16         ` Stefan Richter
2007-05-02 20:35           ` Pekka Enberg
2007-05-07 22:02             ` Kristian Høgsberg
2007-05-02 21:16         ` Kristian Høgsberg
2007-05-02 19:22       ` Christoph Hellwig
2007-05-07 23:42         ` Kristian Høgsberg [this message]
2007-05-02 20:00     ` [git pull] New firewire stack Kristian Høgsberg
2007-05-02 12:21 ` Olaf Hering
2007-05-02 12:48   ` Stefan Richter
2007-05-02 13:56     ` Gene Heskett
2007-05-02 18:51       ` Stefan Richter
2007-05-02 15:27     ` Adrian Bunk
2007-05-02 20:03       ` Kristian Høgsberg
2007-05-02 19:53   ` Kristian Høgsberg
2007-05-02 20:03     ` Olaf Hering
2007-05-10 17:26 ` [git pull] New firewire stack (updated) Stefan Richter
2007-05-10 17:38   ` Christoph Hellwig
2007-05-10 17:51     ` Adrian Bunk
2007-05-10 17:56     ` Stefan Richter
2007-05-10 18:05     ` Stefan Richter

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=463FB957.40707@redhat.com \
    --to=krh@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox