[PATCH v3 3/3] backports: fix compilation error against v4.4 kernel

AceLan Kao <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
Add the smp_acquire__after_ctrl_dep macro to compat/lib-refcount.c to
fix the compilation error

/tmp/tmp.Z85sMNyuzD/backports-5.1-rc1-test1/backports-5.1-rc1/compat/lib-refcount.c:
In function 'backport_refcount_sub_and_test_checked':
/tmp/tmp.Z85sMNyuzD/backports-5.1-rc1-test1/backports-5.1-rc1/compat/lib-refcount.c:198:3:
error: implicit declaration of function 'smp_acquire__after_ctrl_dep'
[-Werror=implicit-function-declaration]
   smp_acquire__after_ctrl_dep();
   ^

Signed-off-by: AceLan Kao <[email protected]>
---
 patches/lib-refcount.patch | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/patches/lib-refcount.patch b/patches/lib-refcount.patch
index 28106342..ae568f8d 100644
--- a/patches/lib-refcount.patch
+++ b/patches/lib-refcount.patch
@@ -2,11 +2,15 @@ diff --git a/compat/lib-refcount.c b/compat/lib-refcount.c
 index 5d0582a..8d108f9 100644
 --- a/compat/lib-refcount.c
 +++ b/compat/lib-refcount.c
-@@ -39,6 +39,7 @@
+@@ -42,6 +42,11 @@
  #include <linux/refcount.h>
  #include <linux/spinlock.h>
  #include <linux/bug.h>
 +#include <linux/export.h>
++
++#ifndef smp_acquire__after_ctrl_dep
++#define smp_acquire__after_ctrl_dep()           smp_rmb()
++#endif
  
  /**
   * refcount_add_not_zero_checked - add a value to a refcount unless it is 0
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.