Skip to content
  • Wang Chen's avatar
    airo: Kill directly reference of netdev->priv · faf3994a
    Wang Chen authored
    
    
    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: default avatarWang Chen <wangchen@cn.fujitsu.com>
    Cc: John W. Linville <linville@tuxdriver.com>
    Cc: Dan Williams <dcbw@redhat.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    faf3994a