006-header-fix-compile-error-on-PowerPC-PPC_85xx.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. From f192535ab136905d87bc75a4e848b66f0aef315e Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <[email protected]>
  3. Date: Sun, 1 Oct 2017 16:05:24 +0200
  4. Subject: header: fix compile error on PowerPC (PPC_85xx)
  5. Including linux/interrupt.h in linux/hrtimer.h causes this error message
  6. on PowerPC builds on x86, ARM and MIPS it works:
  7. CC [M] /backports-4.14-rc2-1/compat/main.o
  8. In file included from /backports-4.14-rc2-1/backport-include/linux/printk.h:5:0,
  9. from ./include/linux/kernel.h:13,
  10. from /backports-4.14-rc2-1/backport-include/linux/kernel.h:3,
  11. from ./include/linux/list.h:8,
  12. from /backports-4.14-rc2-1/backport-include/linux/list.h:3,
  13. from ./include/linux/module.h:9,
  14. from /backports-4.14-rc2-1/backport-include/linux/module.h:3,
  15. from /backports-4.14-rc2-1/compat/main.c:1:
  16. ./include/linux/ratelimit.h: In function 'ratelimit_state_exit':
  17. ./include/linux/ratelimit.h:62:11: error: dereferencing pointer to incomplete type 'struct task_struct'
  18. current->comm, rs->missed);
  19. ^
  20. ./include/linux/printk.h:279:37: note: in definition of macro 'pr_warning'
  21. printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
  22. ^
  23. ./include/linux/ratelimit.h:61:3: note: in expansion of macro 'pr_warn'
  24. pr_warn("%s: %d output lines suppressed due to ratelimiting\n",
  25. ^
  26. The backport of the hrtimer_start() functions needs the
  27. linux/interrupt.h because some parts are defined there. Fix this by
  28. moving the hrtimer_start() backport to the linux/interrupt.h backport
  29. header file.
  30. Signed-off-by: Hauke Mehrtens <[email protected]>
  31. ---
  32. backport-include/linux/hrtimer.h | 17 -----------------
  33. backport-include/linux/interrupt.h | 17 ++++++++++++++++-
  34. 2 files changed, 16 insertions(+), 18 deletions(-)
  35. delete mode 100644 backport-include/linux/hrtimer.h
  36. --- a/backport-include/linux/hrtimer.h
  37. +++ /dev/null
  38. @@ -1,17 +0,0 @@
  39. -#ifndef _BP_HRTIMER_H
  40. -#define _BP_HRTIMER_H
  41. -#include <linux/version.h>
  42. -#include_next <linux/hrtimer.h>
  43. -#include <linux/interrupt.h>
  44. -
  45. -#if LINUX_VERSION_IS_LESS(4,10,0)
  46. -static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
  47. - const enum hrtimer_mode mode)
  48. -{
  49. - ktime_t _time = { .tv64 = time };
  50. - hrtimer_start(timer, _time, mode);
  51. -}
  52. -#define hrtimer_start LINUX_BACKPORT(hrtimer_start)
  53. -#endif
  54. -
  55. -#endif /* _BP_HRTIMER_H */
  56. --- a/backport-include/linux/interrupt.h
  57. +++ b/backport-include/linux/interrupt.h
  58. @@ -1,2 +1,17 @@
  59. -#include <linux/hrtimer.h>
  60. +#ifndef _BP_LINUX_INTERRUPT_H
  61. +#define _BP_LINUX_INTERRUPT_H
  62. +#include <linux/version.h>
  63. #include_next <linux/interrupt.h>
  64. +#include <linux/ktime.h>
  65. +
  66. +#if LINUX_VERSION_IS_LESS(4,10,0)
  67. +static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
  68. + const enum hrtimer_mode mode)
  69. +{
  70. + ktime_t _time = { .tv64 = time };
  71. + hrtimer_start(timer, _time, mode);
  72. +}
  73. +#define hrtimer_start LINUX_BACKPORT(hrtimer_start)
  74. +#endif
  75. +
  76. +#endif /* _BP_LINUX_INTERRUPT_H */