All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Peter Chan <accusys.sw5@gmail.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	jeffchang@accusys.com.tw, ythuang@accusys.com.tw
Subject: Re: Add ACCUSYS RAID driver for Linux i386/x86-64
Date: Wed, 24 Oct 2007 00:08:32 -0700	[thread overview]
Message-ID: <20071024000832.af31fc90.akpm@linux-foundation.org> (raw)
In-Reply-To: <cbc61c0d0710220317w68f4f119xceb10192f2ad0158@mail.gmail.com>

On Mon, 22 Oct 2007 18:17:49 +0800 "Peter Chan" <accusys.sw5@gmail.com> wrote:

> Dear Morton
> 
> Thanks for your doing.
> We modified source code as your requested. If you have any comment please
> let me know.
> Do you need RAID HBA to test at this stage? If "yes", Which address can i
> ship RAID HBA for you?

Please, you really will need to become a bit more familiar with the way we
work.  As far as I know, nobody in the linux world uses RAR format - that's
a windows thing.  I doubt if anyone except I has actually gone to the
effort to decrypt that attachment.

Start with

Documentation/SubmittingPatches
Documentation/SubmittingDrivers
Documentation/SubmitChecklist
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
http://linux.yyz.us/patch-format.html

There are a number of remaining stylistic things which we can look at more
closely when we have patches which are in a usable form.

- Linux doesn't use capitalisation in variable names.  Use "tail", not "Tail"

- Linux uses underscored to separate words.  Use "reply_frame", not
  "replyframe" or "ReplyFrame".

- We don't like to see code which has any dependency on
  LINUX_VERSION_CODE or KENREL_VERSION: the code in Linux is suppsoed to
  work correctly in the version of the kernel which it s found and that's
  it.

- I don't know what this:

+#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
+       #define MODVERSIONS
+#endif

  is doing, but it's probably wrong.

- Use request_node, not RequestNode, etc.

- Don't parenthesise the argument to `return'.

- I see at least one U32 in there.  Please use u32. (Does U32 even work?)

- This:

+static int acs_ame_get_log(
+		struct Acs_Adapter *acs_adt,
+		struct EventLog *event_log)

  isn't preferred style.  Use


static int acs_ame_get_log(struct Acs_Adapter *acs_adt,
				struct EventLog *event_log)

  or, if you particularly dislike that, blow the 80-col rule and do

static int acs_ame_get_log(struct Acs_Adapter *acs_adt, struct EventLog *event_log)

- This

+       writel((replyframe), base_addr+AME_REPLY_MSG_PORT);

  is overparenthesised.

- Beware that the scatter/gather APIs just got significantly changed. 
  You code might need adjustment to work against the latest mainline tree.

- What does CHAR_DEV do?  Probably it should be a Kconfig CONFIG_* option.

- All the code around acs_ame_schedule_command() (which is incorrectly
  identified as arcmsr_schedule_command in its comment block) is indented a
  tab stop.  That's really weird.  Please make it normal.

- acs_ame_schedule_command() has an up-to-sixty-second busywait.  Bad. 
  Can we get a sleep+wakeup in there?

- This:

+	    struct
+	    {
+		unsigned int   vendor_id;
+		unsigned int   device_id;
+	    } const	acs_ame_devices[] = {
+		{ 0x14D6, DEVICEID_ACS_61000_XX }
+		, { 0x14D6, DEVICEID_ACS_62000_08 }
+		, { 0x1AB6, DEVICEID_ACS_61000_XX }
+		, { 0x1AB6, DEVICEID_ACS_62000_08 }
+	    };

 should be

	static const struct {
		unsigned int   vendor_id;
		unsigned int   device_id;
	} acs_ame_devices[] = {
		{ 0x14D6, DEVICEID_ACS_61000_XX },
		{ 0x14D6, DEVICEID_ACS_62000_08 },
		{ 0x1AB6, DEVICEID_ACS_61000_XX },
		{ 0x1AB6, DEVICEID_ACS_62000_08 },
	};

  which has many changes from the original.

  I'd have thought that the kernel already has a data type for this, but
  I can't find it.  Most drivers just rely upon the normal PCI device ID
  tables.  It is suspicious that this one doesn't.


Anyway, that's just from a quick scan.  There are a huge number of similar
issues in there.  Please take some time to study some well-maintained Linux
driver code and the interfaces which scsi and PCI drivers use and try to
make this driver a lot more Linux-like, thanks.




  parent reply	other threads:[~2007-10-24  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cbc61c0d0710220317w68f4f119xceb10192f2ad0158@mail.gmail.com>
2007-10-23  1:45 ` Add ACCUSYS RAID driver for Linux i386/x86-64 Peter Chan
2007-10-23  2:02   ` David Miller
2007-10-23  3:07     ` Dave Jones
2007-10-24  7:08 ` Andrew Morton [this message]
     [not found] <10BD353233FA5448B2E9C3C9005057584471D7@exchange2.accusys.com.tw>
2007-08-30  6:58 ` Andrew Morton
2007-08-30  6:58   ` Andrew Morton

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=20071024000832.af31fc90.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=accusys.sw5@gmail.com \
    --cc=jeffchang@accusys.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ythuang@accusys.com.tw \
    /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.