summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-04-21 20:23:54 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-04-21 20:23:54 +0000
commita3e3c3ee20c4d48e275035339f8d1444199af3a5 (patch)
tree183b4c758d2d97578308dcc91c0a2258e264a7c4 /sys-fs/vhba
parentmarked x86 per bug 412985 (diff)
downloadgentoo-2-a3e3c3ee20c4d48e275035339f8d1444199af3a5.tar.gz
gentoo-2-a3e3c3ee20c4d48e275035339f8d1444199af3a5.tar.bz2
gentoo-2-a3e3c3ee20c4d48e275035339f8d1444199af3a5.zip
Fix build failure with kernels 3.4-rc1 and higher with CONFIG_ENABLE_WARN_DEPRECATED (bug #411459, thanks to darkbasic for reporting).
(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/vhba')
-rw-r--r--sys-fs/vhba/ChangeLog8
-rw-r--r--sys-fs/vhba/files/vhba-20110915-3.4-kmap_atomic.patch100
-rw-r--r--sys-fs/vhba/vhba-20110915.ebuild4
3 files changed, 110 insertions, 2 deletions
diff --git a/sys-fs/vhba/ChangeLog b/sys-fs/vhba/ChangeLog
index 02158036a33a..7b980e078813 100644
--- a/sys-fs/vhba/ChangeLog
+++ b/sys-fs/vhba/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-fs/vhba
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.31 2012/04/09 12:08:48 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.32 2012/04/21 20:23:54 tetromino Exp $
+
+ 21 Apr 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
+ vhba-20110915.ebuild, +files/vhba-20110915-3.4-kmap_atomic.patch:
+ Fix build failure with kernels 3.4-rc1 and higher with
+ CONFIG_ENABLE_WARN_DEPRECATED (bug #411459, thanks to darkbasic for
+ reporting).
09 Apr 2012; Markus Meier <maekke@gentoo.org> vhba-20110915.ebuild:
x86 stable, bug #406941
diff --git a/sys-fs/vhba/files/vhba-20110915-3.4-kmap_atomic.patch b/sys-fs/vhba/files/vhba-20110915-3.4-kmap_atomic.patch
new file mode 100644
index 000000000000..43bd58dacfaa
--- /dev/null
+++ b/sys-fs/vhba/files/vhba-20110915-3.4-kmap_atomic.patch
@@ -0,0 +1,100 @@
+From 0e051e8655c1d68d748d4b6976261aee7d2c248a Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sat, 21 Apr 2012 14:16:59 -0400
+Subject: [PATCH] VHBA: 2-argument k[un]map_atomic is deprecated in >=3.4-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The 1-argument form of k[un]map_atomic was introduced in 2.6.37-rc1, and
+the old 2-argument form is deprecated in 3.4-rc1 and higher. As a
+result, building vhba for a 3.4-rc* kernel that has
+CONFIG_ENABLE_WARN_DEPRECATED fails:
+
+/tmp/cdemu/vhba-module/vhba.c: In function ‘do_request’:
+/tmp/cdemu/vhba-module/vhba.c:487:33: error: ‘kmap_atomic_deprecated’ is
+deprecated (declared at include/linux/highmem.h:125)
+[-Werror=deprecated-declarations]
+/tmp/cdemu/vhba-module/vhba.c:492:1: error: ‘__kunmap_atomic_deprecated’
+is deprecated (declared at include/linux/highmem.h:135)
+[-Werror=deprecated-declarations]
+/tmp/cdemu/vhba-module/vhba.c: In function ‘do_response’:
+/tmp/cdemu/vhba-module/vhba.c:570:33: error: ‘kmap_atomic_deprecated’ is
+deprecated (declared at include/linux/highmem.h:125)
+[-Werror=deprecated-declarations]
+/tmp/cdemu/vhba-module/vhba.c:575:1: error: ‘__kunmap_atomic_deprecated’
+is deprecated (declared at include/linux/highmem.h:135)
+[-Werror=deprecated-declarations]
+cc1: all warnings being treated as errors
+
+To work around this problem, add vhba_k[un]map_atomic wrappers that
+default to the 1-argument form of k[un]map_atomic for 2.6.37 and newer,
+and to the old 2-argument form for older kernels.
+---
+ vhba-module/vhba.c | 23 +++++++++++++++++------
+ 1 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/vhba-module/vhba.c b/vhba-module/vhba.c
+index 8937b94..a36fd59 100644
+--- a/vhba-module/vhba.c
++++ b/vhba-module/vhba.c
+@@ -27,6 +27,7 @@
+ #include <linux/miscdevice.h>
+ #include <linux/poll.h>
+ #include <linux/slab.h>
++#include <linux/version.h>
+ #ifdef CONFIG_COMPAT
+ #include <linux/compat.h>
+ #endif
+@@ -64,6 +65,16 @@ MODULE_LICENSE("GPL");
+ #define DATA_TO_DEVICE(dir) ((dir) == DMA_TO_DEVICE || (dir) == DMA_BIDIRECTIONAL)
+ #define DATA_FROM_DEVICE(dir) ((dir) == DMA_FROM_DEVICE || (dir) == DMA_BIDIRECTIONAL)
+
++/* 1-argument form of k[un]map_atomic was introduced in 2.6.37-rc1;
++ 2-argument form was deprecated in 3.4-rc1 */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
++#define vhba_kmap_atomic kmap_atomic
++#define vhba_kunmap_atomic kunmap_atomic
++#else
++#define vhba_kmap_atomic(page) kmap_atomic(page, KM_USER0)
++#define vhba_kunmap_atomic(page) kunmap_atomic(page, KM_USER0)
++#endif
++
+ enum vhba_req_state {
+ VHBA_REQ_FREE,
+ VHBA_REQ_PENDING,
+@@ -473,12 +484,12 @@ static ssize_t do_request(struct scsi_cmnd *cmd, char __user *buf, size_t buf_le
+ size_t len = sg[i].length;
+
+ #ifdef KAT_SCATTERLIST_HAS_PAGE_LINK
+- kaddr = kmap_atomic(sg_page(&sg[i]), KM_USER0);
++ kaddr = vhba_kmap_atomic(sg_page(&sg[i]));
+ #else
+- kaddr = kmap_atomic(sg[i].page, KM_USER0);
++ kaddr = vhba_kmap_atomic(sg[i].page);
+ #endif
+ memcpy(kbuf, kaddr + sg[i].offset, len);
+- kunmap_atomic(kaddr, KM_USER0);
++ vhba_kunmap_atomic(kaddr);
+
+ if (copy_to_user(uaddr, kbuf, len)) {
+ if (kbuf != buf_stack)
+@@ -556,12 +567,12 @@ static ssize_t do_response(struct scsi_cmnd *cmd, const char __user *buf, size_t
+ uaddr += len;
+
+ #ifdef KAT_SCATTERLIST_HAS_PAGE_LINK
+- kaddr = kmap_atomic(sg_page(&sg[i]), KM_USER0);
++ kaddr = vhba_kmap_atomic(sg_page(&sg[i]));
+ #else
+- kaddr = kmap_atomic(sg[i].page, KM_USER0);
++ kaddr = vhba_kmap_atomic(sg[i].page);
+ #endif
+ memcpy(kaddr + sg[i].offset, kbuf, len);
+- kunmap_atomic(kaddr, KM_USER0);
++ vhba_kunmap_atomic(kaddr);
+
+ to_read -= len;
+ if (to_read == 0)
+--
+1.7.8.5
+
diff --git a/sys-fs/vhba/vhba-20110915.ebuild b/sys-fs/vhba/vhba-20110915.ebuild
index d99c815646d9..e1c2112b6aee 100644
--- a/sys-fs/vhba/vhba-20110915.ebuild
+++ b/sys-fs/vhba/vhba-20110915.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20110915.ebuild,v 1.5 2012/04/09 12:08:48 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20110915.ebuild,v 1.6 2012/04/21 20:23:54 tetromino Exp $
EAPI="4"
@@ -33,6 +33,8 @@ pkg_setup() {
}
src_prepare() {
+ # Build failure with >=3.4-rc1 and CONFIG_ENABLE_WARN_DEPRECATED, #411459
+ epatch "${FILESDIR}/${P}-3.4-kmap_atomic.patch"
# Avoid "make jobserver unavailable" warning
sed -e 's:\t$(KMAKE):\t+$(KMAKE):g' -i Makefile || die "sed failed"
}