• Larry Finger's avatar
    rtlwifi: rtl8192ce: rtl8192cu: Fix endian issue · e41c5135
    Larry Finger authored
    Commit e996db69 (rtlwifi: rtl8192c: Add init codes for "fw_version"
    and "fw_subversion") added initialization for fw_version, but failed to
    note that the variable in the firmware header is little-endian. The
    following Sparse warning results:
    
      CHECK   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
    drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36: warning: incorrect type in assignment (different base types)
    drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36:    expected unsigned short [unsigned] [usertype] fw_version
    drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36:    got restricted __le16 [usertype] version
    
    When fixing this problem, I noticed that several of the drivers contain
    nearly identical copies of the firmware header struct, and that only the one
    used in rtl8192c{e,u} had correct endian notation. The struct has been
    moved into a common header, and the other drivers will be fixed in
    subsequant patches.
    Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    e41c5135
fw_common.h 4.09 KB