mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@linux-foundation.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Cc: linux-kernel@vger.kernel.org
Subject: [-mm patch] arch/i386/xen/: possible cleanups
Date: Thu, 1 Mar 2007 11:48:17 +0100	[thread overview]
Message-ID: <20070301104817.GB10921@stusta.de> (raw)
In-Reply-To: <20070217215146.30e7ffa3.akpm@linux-foundation.org>

This patch contains the following possible cleanups:
- every file should #include the headers containing the prototypes for
  it's global functions
  - the xen_set_pud() prototype mismatch gcc was now able to detect
    is corrected
- make the following needlessly global variable static:
  - events.c: virq_to_irq[]
- make the following needlessly global functions static:
  - setup.c: xen_idle()
  - events.c: mask_evtchn()
  - events.c: unmask_evtchn()
  - mmu.c: xen_pgd_unpin()
- remove the following unused variables:
  - setup.c: pfn_to_mfn_frame_list
  - setup.c: pfn_to_mfn_frame_list_list
- #if 0 the following unused global function:
  - mmu.c: xen_set_pte_atomic()
- remove the following empty unused global functions:
  - mmu.c: xen_pte_update()
  - mmu.c: xen_pte_update_defer()
- remove the following unused EXPORT_SYMBOL:
  - setup.c: HYPERVISOR_shared_info

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

BTW: Can we get a MAINTAINERS entry for Xen?

 arch/i386/xen/events.c |    9 ++++-----
 arch/i386/xen/mmu.c    |   16 ++++++----------
 arch/i386/xen/mmu.h    |    4 ----
 arch/i386/xen/setup.c  |    6 +++---
 4 files changed, 13 insertions(+), 22 deletions(-)

--- linux-2.6.20-mm2/arch/i386/xen/setup.c.old	2007-02-26 23:15:34.000000000 +0100
+++ linux-2.6.20-mm2/arch/i386/xen/setup.c	2007-02-28 01:04:40.000000000 +0100
@@ -14,6 +14,8 @@
 #include <xen/interface/physdev.h>
 #include <xen/features.h>
 
+#include "xen-ops.h"
+
 /* These are code, but not functions.  Defined in entry.S */
 extern const char xen_hypervisor_callback[];
 extern const char xen_failsafe_callback[];
@@ -25,10 +27,8 @@
  * page as soon as fixmap is up and running.
  */
 struct shared_info *HYPERVISOR_shared_info = &init_shared;
-EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
 unsigned long *phys_to_machine_mapping;
-unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[16];
 EXPORT_SYMBOL(phys_to_machine_mapping);
 
 /**
@@ -45,7 +45,7 @@
 	return "Xen";
 }
 
-void xen_idle(void)
+static void xen_idle(void)
 {
 	local_irq_disable();
 
--- linux-2.6.20-mm2/arch/i386/xen/events.c.old	2007-03-01 01:12:52.000000000 +0100
+++ linux-2.6.20-mm2/arch/i386/xen/events.c	2007-03-01 01:14:38.000000000 +0100
@@ -8,6 +8,7 @@
 #include <asm/irq.h>
 #include <asm/sync_bitops.h>
 #include <asm/xen/hypercall.h>
+#include <asm/xen/hypervisor.h>
 
 #include <xen/events.h>
 #include <xen/interface/xen.h>
@@ -22,7 +23,7 @@
 static DEFINE_SPINLOCK(irq_mapping_update_lock);
 
 /* IRQ <-> VIRQ mapping. */
-DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1};
+static DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1};
 
 /* Packed IRQ information: binding type, sub-type index, and event channel. */
 struct packed_irq
@@ -158,14 +159,13 @@
 }
 EXPORT_SYMBOL_GPL(notify_remote_via_irq);
 
-void mask_evtchn(int port)
+static void mask_evtchn(int port)
 {
 	struct shared_info *s = HYPERVISOR_shared_info;
 	sync_set_bit(port, &s->evtchn_mask[0]);
 }
-EXPORT_SYMBOL_GPL(mask_evtchn);
 
-void unmask_evtchn(int port)
+static void unmask_evtchn(int port)
 {
 	struct shared_info *s = HYPERVISOR_shared_info;
 	unsigned int cpu = smp_processor_id();
@@ -192,7 +192,6 @@
 				   &vcpu_info->evtchn_pending_sel))
 		vcpu_info->evtchn_upcall_pending = 1;
 }
-EXPORT_SYMBOL_GPL(unmask_evtchn);
 
 static int find_unbound_irq(void)
 {
--- linux-2.6.20-mm2/arch/i386/xen/mmu.h.old	2007-03-01 01:22:08.000000000 +0100
+++ linux-2.6.20-mm2/arch/i386/xen/mmu.h	2007-03-01 01:23:27.000000000 +0100
@@ -9,8 +9,6 @@
 void fastcall xen_set_pte_at(struct mm_struct *mm, u32 addr,
 			     pte_t *ptep, pte_t pteval);
 void fastcall xen_set_pmd(pmd_t *pmdp, pmd_t pmdval);
-void fastcall xen_pte_update(struct mm_struct *mm, u32 addr, pte_t *ptep);
-void fastcall xen_pte_update_defer(struct mm_struct *mm, u32 addr, pte_t *ptep);
 
 fastcall void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next);
 fastcall void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
@@ -19,7 +17,6 @@
 fastcall pte_t xen_ptep_get_and_clear(pte_t *ptep);
 
 void xen_pgd_pin(pgd_t *pgd);
-void xen_pgd_unpin(pgd_t *pgd);
 
 #ifdef CONFIG_X86_PAE
 fastcall unsigned long long xen_pte_val(pte_t);
@@ -32,7 +29,6 @@
 
 fastcall void xen_set_pte_at(struct mm_struct *mm, u32 addr,
 			     pte_t *ptep, pte_t pteval);
-fastcall void xen_set_pte_atomic(pte_t *ptep, pte_t pte);
 fastcall void xen_set_pud(pud_t *ptr, pud_t val);
 fastcall void xen_pte_clear(struct mm_struct *mm, u32 addr,pte_t *ptep);
 fastcall void xen_pmd_clear(pmd_t *pmdp);
--- linux-2.6.20-mm2/arch/i386/xen/mmu.c.old	2007-03-01 01:16:08.000000000 +0100
+++ linux-2.6.20-mm2/arch/i386/xen/mmu.c	2007-03-01 01:23:33.000000000 +0100
@@ -11,6 +11,8 @@
 #include <xen/page.h>
 #include <xen/interface/xen.h>
 
+#include "mmu.h"
+
 xmaddr_t arbitrary_virt_to_machine(unsigned long address)
 {
 	pte_t *pte = lookup_address(address);
@@ -83,7 +85,7 @@
 }
 
 #ifdef CONFIG_X86_PAE
-fastcall void xen_set_pud(pmd_t *ptr, pud_t val)
+fastcall void xen_set_pud(pud_t *ptr, pud_t val)
 {
 	struct mmu_update u;
 
@@ -139,19 +141,13 @@
 		xen_set_pte(ptep, pteval);
 }
 
-void fastcall xen_pte_update(struct mm_struct *mm, u32 addr, pte_t *ptep)
-{
-}
-
-void fastcall xen_pte_update_defer(struct mm_struct *mm, u32 addr, pte_t *ptep)
-{
-}
-
 #ifdef CONFIG_X86_PAE
+#if 0
 void fastcall xen_set_pte_atomic(pte_t *ptep, pte_t pte)
 {
 	set_64bit((u64 *)ptep, pte_val_ma(pte));
 }
+#endif  /*  0  */
 
 void fastcall xen_pte_clear(struct mm_struct *mm, u32 addr,pte_t *ptep)
 {
@@ -369,7 +365,7 @@
 }
 
 /* Release a pagetables pages back as normal RW */
-void xen_pgd_unpin(pgd_t *pgd)
+static void xen_pgd_unpin(pgd_t *pgd)
 {
 	struct mmuext_op op;
 


  parent reply	other threads:[~2007-03-01 10:48 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18  5:51 2.6.20-mm2 Andrew Morton
2007-02-18  6:18 ` 2.6.20-mm2 Dave Airlie
2007-02-18  6:34   ` 2.6.20-mm2 Andrew Morton
2007-02-18 12:44 ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-18 19:43   ` 2.6.20-mm2 Andrew Morton
2007-02-18 23:25     ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-18 23:39       ` 2.6.20-mm2 Michal Piotrowski
2007-02-19  0:00       ` 2.6.20-mm2 Andrew Morton
2007-02-19 11:28         ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-19 11:45           ` 2.6.20-mm2 Michal Piotrowski
2007-02-20  0:04             ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-20 21:16               ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-20 21:46                 ` 2.6.20-mm2 Jeff Garzik
2007-02-20  0:43         ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-20  1:20     ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-20  6:31       ` 2.6.20-mm2 Andrew Morton
2007-02-20 22:12         ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-18 13:06 ` 2.6.20-mm2: Oops in generic_make_request Laurent Riffard
2007-02-18 17:58   ` Mattia Dongili
2007-02-18 19:49     ` Andrew Morton
2007-02-18 20:05       ` Michal Piotrowski
2007-02-20 13:04         ` [-mm patch] fix locking in __make_request (was Re: 2.6.20-mm2: Oops in generic_make_request) Frederik Deweerdt
2007-02-19 13:34           ` Jens Axboe
2007-02-20 14:29             ` Frederik Deweerdt
2007-02-19 13:52           ` Michal Piotrowski
2007-02-19 14:08             ` Michal Piotrowski
2007-02-20 14:32               ` Frederik Deweerdt
2007-02-18 18:20 ` 2.6.20-mm2 Michal Piotrowski
2007-02-18 23:32 ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-19  0:28   ` 2.6.20-mm2 Andrew Morton
2007-02-19  5:13     ` 2.6.20-mm2 David Brownell
2007-02-20 22:07       ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-22  3:57         ` 2.6.20-mm2 David Brownell
2007-02-22  8:33           ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-22 22:17             ` 2.6.20-mm2 David Brownell
2007-02-23 16:36         ` 2.6.20-mm2 David Brownell
2007-03-04 22:36           ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-19 18:28     ` 2.6.20-mm2 Rafael J. Wysocki
2007-02-18 23:33 ` 2.6.20-mm2: compilation fix Rafael J. Wysocki
2007-02-19  0:29   ` Andrew Morton
2007-02-19 11:33     ` Rafael J. Wysocki
2007-02-20  0:07 ` [-mm patch] fs/9p/vfs_addr.c: make 2 functions static Adrian Bunk
2007-02-20  0:54   ` Eric Van Hensbergen
2007-02-20  0:07 ` [-mm patch] drivers/mmc/Kconfig source drivers/mmc/card/Kconfig Adrian Bunk
2007-02-20  6:45   ` Pierre Ossman
2007-02-20  0:08 ` [-mm patch] drivers/video/sm501fb.c: make 4 functions static Adrian Bunk
2007-02-20  0:08 ` 2.6.20-mm2: BLOCK=n compile error Adrian Bunk
2007-02-20  0:08 ` [-mm patch] UNION_FS must depend on SLAB Adrian Bunk
2007-02-20  6:37   ` Pekka Enberg
2007-02-20 15:13     ` Josef Sipek
2007-02-21  3:07       ` [Unionfs] " hooanon05
2007-02-21 22:19       ` Andrew Morton
2007-02-22  2:00         ` Josef Sipek
2007-02-22  2:26           ` Andrew Morton
2007-02-22  3:10             ` Josef Sipek
2007-02-22  6:17             ` Pekka Enberg
2007-02-22  6:18               ` Pekka Enberg
2007-02-22  6:28                 ` Josef Sipek
2007-02-22  6:42               ` Christoph Lameter
2007-02-22  2:33           ` [Unionfs] " Erez Zadok
2007-02-21  5:19   ` Josef Sipek
2007-02-20  7:39 ` 2.6.20-mm2 KAMEZAWA Hiroyuki
2007-02-20 10:06 ` 2.6.20-mm2 Andy Whitcroft
2007-02-20 11:14 ` 2.6.20-mm2 Maciej Rutecki
2007-02-20 11:38 ` 2.6.20-mm2 Maciej Rutecki
2007-02-20 21:23 ` 2.6.20-mm2: possible recursive locking detected (reiserfs-related) Rafael J. Wysocki
2007-02-20 22:48   ` Tilman Schmidt
2007-02-21 10:52 ` [-mm patch] MTD_UBI_DEBUG must depend on SYSFS Adrian Bunk
2007-02-21 11:57 ` [-mm patch] i386 mpparse.c: remove an unused variable Adrian Bunk
2007-02-25 13:15 ` 2.6.20-mm2 Jean Delvare
2007-02-27 20:25   ` 2.6.20-mm2 Andrew Morton
2007-02-28  9:07     ` 2.6.20-mm2 Jean Delvare
2007-02-26 22:23 ` [-mm patch] LGUEST must depend on NET Adrian Bunk
2007-02-26 23:42   ` Rusty Russell
2007-03-01 10:48 ` Adrian Bunk [this message]
2007-03-01 10:53   ` [-mm patch] arch/i386/xen/: possible cleanups Jeremy Fitzhardinge
2007-03-01 11:55     ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070301104817.GB10921@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®