Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 All bow down before the Great Code Comp...



details:   https://anonhg.NetBSD.org/src/rev/e385059fc983
branches:  trunk
changeset: 351276:e385059fc983
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Feb 08 18:50:51 2017 +0000

description:
All bow down before the Great Code Compiler.

Specifically, it has been commanded that unused-functions is a warning,
and, as all should know, all warnings be errors.

Hence, since XEN kernels do not call set_sys_gdt(), that function
may not be included (and the XEN kernel  saves a few tens of bytes.)

An alternate fix would be to just remove "static" - but that would be
the equivalent to just giving the compiler the finger ...   hmm, maybe
that would have been a better fix...

diffstat:

 sys/arch/amd64/amd64/gdt.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r f0236fdd5380 -r e385059fc983 sys/arch/amd64/amd64/gdt.c
--- a/sys/arch/amd64/amd64/gdt.c        Wed Feb 08 18:21:23 2017 +0000
+++ b/sys/arch/amd64/amd64/gdt.c        Wed Feb 08 18:50:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $    */
+/*     $NetBSD: gdt.c,v 1.37 2017/02/08 18:50:51 kre Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.37 2017/02/08 18:50:51 kre Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -63,7 +63,9 @@
 int gdt_next;          /* next available slot for sweeping */
 int gdt_free;          /* next free slot; terminated with GNULL_SEL */
 
+#if defined(USER_LDT) || !defined(XEN)
 static void set_sys_gdt(int, void *, size_t, int, int, int);
+#endif
 void gdt_init(void);
 
 void
@@ -85,6 +87,7 @@
 #endif
 }
 
+#if defined(USER_LDT) || !defined(XEN)
 /*
  * Called on a newly-allocated GDT slot, so no race between CPUs.
  */
@@ -107,6 +110,7 @@
                update_descriptor(&ci->ci_gdt[idx + 1], &d.bits[1]);
        }
 }
+#endif /* USER_LDT || !XEN */
 
 /*
  * Initialize the GDT. We already have a gdtstore, which was temporarily used



Home | Main Index | Thread Index | Old Index