Skip to contentSkip to conversation

compat: fix compilation for 3.10-rc1 and older

PATCH In review Jonas Gorski 2 participants 4 messages May 19, 2013

lore
Share & tools
lore
#0 lore raw

cover compat: fix compilation for 3.10-rc1 and older

These two patches fix two issues that I encountered/found while compiling (a slightly older) compat-drivers against 3.10-rc1:

a) compat-3.10.h was missing an include in the #else branch, causing build failure.

b) random32() was renamed to prandom_u32(), so older kernels were missing an appropriate alias.

Jonas Gorski (2):
compat: add missing include in #else for compat-3.10.h
compat: handle renaming of random32() to prandom_u32()

 include/linux/compat-3.10.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 compat: add missing include in #else for compat-3.10.h

When compiling against 3.10-rc1, the build fails as follows:

CC [M] compat/main.o
In file included from include/linux/compat-2.6.h:75:0,

                 from <command-line>:0:

include/linux/compat-3.10.h:91:52: warning: 'struct fb_info' declared inside parameter list [enabled by default] include/linux/compat-3.10.h:91:52: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] include/linux/compat-3.10.h: In function 'backport_fb_enable_skip_vt_switch':
include/linux/compat-3.10.h:93:6: error: dereferencing pointer to incomplete type

Fix this adding the missing include to the else branch to stay true to the original commit, instead of pulling it out of the #if #else #endif block.

---
 include/linux/compat-3.10.h |    2 ++
 1 file changed, 2 insertions(+)
include/linux/compat-3.10.h +2 -0
index f972203..9d6e55c 100644
@@ -87,6 +87,8 @@ static inline void fb_enable_skip_vt_switch(struct fb_info *info)
  * clash on the backport for 3.12 as the routine would
  * already be defined *but* we'd need it for 3.11.
  */
+#include <linux/fb.h>
+
 #define fb_enable_skip_vt_switch LINUX_BACKPORT(fb_enable_skip_vt_switch)
 static inline void fb_enable_skip_vt_switch(struct fb_info *info)
 {
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 compat: handle renaming of random32() to prandom_u32()

In reply to Jonas Gorski

496f2f93b1cc286f5a4f4f9acdc1e5314978683f renamed random32() to prandom_u32(), so add an appropriate macro for older kernels.

---
 include/linux/compat-3.10.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
include/linux/compat-3.10.h +14 -0
index 9d6e55c..ac1dcfa 100644
@@ -75,6 +75,20 @@ static inline void fb_enable_skip_vt_switch(struct fb_info *info)
 	module_driver(__pcmcia_driver, pcmcia_register_driver, \
 			pcmcia_unregister_driver)
 
+/**
+ * backport of:
+ *
+ * commit 496f2f93b1cc286f5a4f4f9acdc1e5314978683f
+ * Author: Akinobu Mita <[email protected]>
+ * Date:   Mon Dec 17 16:04:23 2012 -0800
+ *
+ *    random32: rename random32 to prandom
+ *
+ */
+#define prandom_u32()			random32()
+#define prandom_seed(seed)		srandom32(seed)
+#define	prandom_u32_state(state)	prandom32(state)
+
 #else /* kernel is >= 3.10 */
 /*
  * We'd delete this upstream ever got this, we use our
Signature · 1 line
1.7.10.4
#3 lore raw
In reply to Jonas Gorski
Quoted 6 lines · Jonas Gorski

These two patches fix two issues that I encountered/found while compiling (a slightly older) compat-drivers against 3.10-rc1:

a) compat-3.10.h was missing an include in the #else branch, causing build failure.

Quoted 6 lines

b) random32() was renamed to prandom_u32(), so older kernels were missing an appropriate alias.

Jonas Gorski (2):
compat: add missing include in #else for compat-3.10.h
compat: handle renaming of random32() to prandom_u32()

Thanks Jonas but for v3.10 we've moved onto a new tree, backports.git:

git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/backports.git

The first v3.10 based release is available for testing:

https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.10-rc1/backports-3.10-rc1-1.tar.bz2

The release page:

http://drvbp1.linux-foundation.org/~mcgrof/rel-html/backports/

The backports tree will have branches for each stable release, so there is a linux-3.10.y branch on it. Before applying patches to that branch I will however want code comited on the master branch, and then refer that sha1sum on the branch.

Please take a look / test and let me know how it goes. Also daily snapshots are referenced on the release page.

Luis