Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2020-12-21 14:08:58 -08:00
2 changed files with 24 additions and 9 deletions

View File

@@ -139,8 +139,11 @@ function patch_kernel {
# files") # v4.2.
if kernel_version_le 2.6.29 "$1" && kernel_version_lt "$1" 4.2; then
# Tell the kernel that we are using gcc 4.6 since older kernel
# versions do not support recent gcc versions.
patch -f -s -p1 <<'EOF' ||
# versions do not support recent gcc versions. See also commit
# 9c695203a7dd ("compiler-gcc.h: gcc-4.5 needs noclone and
# noinline on __naked functions") # v2.6.35.
if kernel_version_le 2.6.35 "$1"; then
patch -f -s -p1 <<'EOF'
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 02ae99e8e6d3..47e12c19c965 100644
--- a/include/linux/compiler-gcc.h
@@ -155,7 +158,8 @@ index 02ae99e8e6d3..47e12c19c965 100644
#if !defined(__noclone)
#define __noclone /* not needed */
EOF
patch -f -s -p1 <<'EOF'
else
patch -f -s -p1 <<'EOF'
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index a3ed7cb8ca34..c5a6b8b52db4 100644
--- a/include/linux/compiler-gcc.h
@@ -167,7 +171,11 @@ index a3ed7cb8ca34..c5a6b8b52db4 100644
-#include gcc_header(__GNUC__)
+#include "linux/compiler-gcc4.h"
EOF
patch -f -s -p1 <<'EOF' ||
fi
# See also commit 733ed6e43756 ("compiler-gcc{3,4}.h: Use
# GCC_VERSION macro") # v3.9.
if kernel_version_le 3.9 "$1"; then
patch -f -s -p1 <<'EOF'
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 769e19864632..2ec6c7a11502 100644
--- a/include/linux/compiler-gcc4.h
@@ -187,7 +195,8 @@ index 769e19864632..2ec6c7a11502 100644
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
EOF
patch -f -s -p1 <<'EOF'
else
patch -f -s -p1 <<'EOF'
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 412bc6c2b023..901ca31be7f8 100644
--- a/include/linux/compiler-gcc4.h
@@ -207,6 +216,7 @@ index 412bc6c2b023..901ca31be7f8 100644
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
EOF
fi
fi
;;
esac
@@ -666,7 +676,7 @@ EOF
# See also commit e33a814e772c ("scripts/dtc: Remove redundant YYLOC global
# declaration") # v5.6~10^2.
if kernel_version_lt "$1" 5.6; then
if kernel_version_le 2.6.38 "$1" && kernel_version_lt "$1" 5.6; then
patch -p1 -f -s <<'EOF'
From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dmueller@suse.com>

View File

@@ -1057,8 +1057,9 @@ int scst_get_suspend_count(void)
static int scst_register_device(struct scsi_device *scsidp)
{
int res;
DECLARE_COMPLETION_ONSTACK(c);
struct scst_device *dev, *d;
int res;
TRACE_ENTRY();
@@ -1128,8 +1129,9 @@ out_del_unlocked:
scst_pr_clear_dev(dev);
out_free_dev:
dev->remove_completion = &c;
percpu_ref_kill(&dev->refcnt);
wait_for_completion(&c);
scst_free_device(dev);
out_unlock:
@@ -1283,9 +1285,10 @@ out:
int scst_register_virtual_device_node(struct scst_dev_type *dev_handler,
const char *dev_name, int nodeid)
{
int res;
DECLARE_COMPLETION_ONSTACK(c);
struct scst_device *dev, *d;
bool sysfs_del = false;
int res;
TRACE_ENTRY();
@@ -1405,7 +1408,9 @@ out_free_dev:
mutex_unlock(&scst_mutex);
if (sysfs_del)
scst_dev_sysfs_del(dev);
dev->remove_completion = &c;
percpu_ref_kill(&dev->refcnt);
wait_for_completion(&c);
scst_free_device(dev);
goto out;