diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-10-14 09:30:33 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-01 02:00:22 +0300 |
commit | faf3994a9f65fd95a68bbcc03c318a427cd1e7d3 (patch) | |
tree | 800dcc297eb751d512d86c6cb0e8809f8e21e096 /drivers/char/snsc.h | |
parent | b706e65b40417e03c2451bb3f92488f3736843fa (diff) | |
download | linux-faf3994a9f65fd95a68bbcc03c318a427cd1e7d3.tar.xz |
airo: Kill directly reference of netdev->priv
We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it
directly.
OK, becasue Dave S. Miller said, "every direct netdev->priv usage is a bug",
and I want to kill netdev->priv later, I decided to convert all the direct
reference of netdev->priv first.
In this driver, I don't simply use netdev_priv() to replace netdev->priv.
The reason is:
Pointer netdev->priv was changed in this driver, but it shouldn't.
Because the memory was allocated when alloc_netdev() and netdev->priv
should always point to that memory.
So I use netdev->ml_priv to replace netdev->priv.
After replacing, both ai and ai->wifidev->ml_priv point to the same memory.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/char/snsc.h')
0 files changed, 0 insertions, 0 deletions