linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Bing Zhao <bzhao@marvell.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Kiran Divekar <dkiran@marvell.com>,
	Frank Huang <frankh@marvell.com>
Subject: Re: [PATCH] mwifiex: remove linked list implementation
Date: Sun, 09 Jan 2011 10:47:17 +0100	[thread overview]
Message-ID: <1294566437.5345.1.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1294449014-15078-1-git-send-email-bzhao@marvell.com>

On Fri, 2011-01-07 at 17:10 -0800, Bing Zhao wrote:

> +	tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)
> +					priv->tx_ba_stream_tbl_ptr.next;

Don't do that. Always use list_first_entry() etc, because otherwise the
struct list_head must be the first member in the struct, which is very
non-ideomatic and everybody who is used to the kernel will get it wrong
when modifying your driver.

Treat struct list_head as completely opaque -- never look into it. There
are macros for any kind of manipulation with it.

Also, all your loops are open coded -- use list_for_each_entry() instead
of doing that (even the code I quoted above is from an open coded loop)

johannes


  reply	other threads:[~2011-01-09  9:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-08  1:10 [PATCH] mwifiex: remove linked list implementation Bing Zhao
2011-01-09  9:47 ` Johannes Berg [this message]
2011-01-10 19:51   ` Bing Zhao

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=1294566437.5345.1.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=akarwar@marvell.com \
    --cc=bzhao@marvell.com \
    --cc=dkiran@marvell.com \
    --cc=frankh@marvell.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).