From: Wang Chen Date: Tue, 14 Oct 2008 05:30:33 +0000 (+0800) Subject: airo: Kill directly reference of netdev->priv X-Git-Tag: v2.6.29-rc1~581^2~879 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faf3994a9f65fd95a68bbcc03c318a427cd1e7d3;p=pandora-kernel.git 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 Cc: John W. Linville Cc: Dan Williams Signed-off-by: John W. Linville --- Reading git-diff-tree failed