Skip to contentSkip to conversation

kernel/sys.c: Add build-time check for UNAME26

PATCH In review Geert Uytterhoeven 2 participants 2 messages Mar 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/sys.c: Add build-time check for UNAME26

Add a build-time check for the major version number, to make sure Linus will update the UNAME26 implementation (and the comment at the top of the function) at the next version increase.

---
 kernel/sys.c | 1 +
 1 file changed, 1 insertion(+)
kernel/sys.c +1 -0
index a03d9cd23ed779b2..ead9bd7b8a47eee4 100644
@@ -1128,6 +1128,7 @@ static int override_release(char __user *release, size_t len)
 				break;
 			rest++;
 		}
+		BUILD_BUG_ON((LINUX_VERSION_CODE >> 16) != 4);
 		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
 		copy = clamp_t(size_t, len, 1, sizeof(buf));
 		copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · Geert Uytterhoeven

Add a build-time check for the major version number, to make sure Linus will update the UNAME26 implementation (and the comment at the top of the function) at the next version increase.

I really can't imagine that anybody ever cares about the exact "2.6.x" value, as long as x > 40. So even the original "update 40 to 60" was borderline. I don't think I will ever accept an update to this any more.

If anything, I'd just say "fix it at 2.6.60" or something, and get rid of the insane version code "emulation" crap. Nobody cares.

Linus