linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-wireless@vger.kernel.org,
	"John W.Linville" <linville@tuxdriver.com>,
	Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH V2] Add iwlwifi wireless drivers
Date: Tue, 28 Aug 2007 15:25:44 +0800	[thread overview]
Message-ID: <1188285945.13078.242.camel@debian.sh.intel.com> (raw)
In-Reply-To: <20070827131026.GA21137@infradead.org>

On Mon, 2007-08-27 at 14:10 +0100, Christoph Hellwig wrote:
> Btw, strong NACK from me until you sort out the mess with the common
> files. Including C files with cpp symbols defined or not is not how we
> do driver development in Linux.  Please split out really common code
> into common files, and build driver specific code into files of it's
> own.  Having a slight amount of duplicated code is much better than
> having such a mess for maintaince.

It's not a "slight amount" of duplicated code.

$ expr `grep -e '^{$' iwl-base.c |wc -l` - ` sed -e '/^{$/,/^}$/{/#if
IWL == /,/^}$/d}' iwl-base.c |grep -e '^}$' |wc -l`
34

Additional 34 functions have to be splited out from iwl-base.c into
their own hardware specific files. If you look at the code, most of
these functions are only with little difference which are caused by the
difference of the hardware. In the future, when we add new hardware
support for iwlwifi, it's more maintainable to extend the current
functions with new hardware difference than copy all the 34 functions
into a new file and only make slight changes to each of them.

I know the method is not common used in the Linux drivers, but this is
decided by the hardware layout. For 3945 and 4965, 90% of the
hardware/firmware layout are the same and only 10% are different. This
makes it possible to support two slightly differs hardwares in one
driver. If the hardwares differ a lot (i.e 2100 and 2200), I won't even
think about to do it in this way.

Thanks,
-yi

  reply	other threads:[~2007-08-28  7:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-27  5:20 [PATCH V2] Add iwlwifi wireless drivers Zhu Yi
2007-08-27 13:10 ` Christoph Hellwig
2007-08-28  7:25   ` Zhu Yi [this message]
2007-08-28  8:50     ` Johannes Berg
2007-08-28  9:07       ` Zhu Yi
2007-08-28  9:28         ` Johannes Berg
2007-08-28 12:28       ` Christoph Hellwig
2007-08-28 13:37         ` Tomas Winkler
2007-08-31 20:55 ` John W. Linville
2007-08-31 22:03   ` Johannes Berg
2007-09-01 10:04     ` Johannes Berg
2007-09-04  2:25   ` Zhu Yi
2007-09-04 14:13     ` Johannes Berg
2007-09-06  1:32       ` Ian Schram
2007-09-06  2:20         ` Larry Finger
2007-09-06 12:00         ` Johannes Berg
2007-09-06 14:04           ` Tomas Winkler
2007-09-06 14:14             ` Johannes Berg
2007-09-06 14:31               ` Tomas Winkler
2007-09-06 14:40                 ` Johannes Berg

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=1188285945.13078.242.camel@debian.sh.intel.com \
    --to=yi.zhu@intel.com \
    --cc=hch@infradead.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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;
as well as URLs for NNTP newsgroup(s).