003-mwlwifi-replace-get-set_fs-calls.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 16e51cb83f9fa1717383c9d67f5531df7348347c Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Wed, 30 Mar 2022 19:51:56 +0200
  4. Subject: [PATCH] mwlwifi: replace get/set_fs() calls
  5. Since kernel 5.9 the get/set_fs() call implementation have started to get
  6. dropped from individual architectures, ARM64 one got dropped in 5.11.
  7. Replace the get/set_fs() calls with force_uaccess_begin/end() to allow
  8. compiling on newer kernels.
  9. There is no need to add kernel version checks as the replacement functions
  10. are available since kernel 5.9.
  11. Signed-off-by: Robert Marko <[email protected]>
  12. ---
  13. hif/pcie/pcie.c | 5 ++---
  14. 1 file changed, 2 insertions(+), 3 deletions(-)
  15. --- a/hif/pcie/pcie.c
  16. +++ b/hif/pcie/pcie.c
  17. @@ -1293,8 +1293,7 @@ static void pcie_bf_mimo_ctrl_decode(str
  18. char *buf = &str_buf[0];
  19. mm_segment_t oldfs;
  20. - oldfs = get_fs();
  21. - set_fs(KERNEL_DS);
  22. + oldfs = force_uaccess_begin();
  23. buf += sprintf(buf, "\nMAC: %pM\n", bf_mimo_ctrl->rec_mac);
  24. buf += sprintf(buf, "SU_0_MU_1: %d\n", bf_mimo_ctrl->type);
  25. @@ -1314,7 +1313,7 @@ static void pcie_bf_mimo_ctrl_decode(str
  26. filename, (unsigned int)fp_data);
  27. }
  28. - set_fs(oldfs);
  29. + force_uaccess_end(oldfs);
  30. }
  31. static void pcie_process_account(struct ieee80211_hw *hw)