Skip to contentSkip to conversation

xenperf: cleanup

PATCH In review Christoph Egger 2 participants 9 messages Jul 15, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenperf: cleanup

Hi,

Attached patch makes xenperf's functions static which have no prototypes.

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
tools/misc/xenperf.c +2 -2
diff -r bd6d194199e5 tools/misc/xenperf.c
@@ -68,7 +68,7 @@ const char *hypercall_name_table[64] =
 };
 #undef X
 
-int lock_pages(void *addr, size_t len)
+static int lock_pages(void *addr, size_t len)
 {
     int e = 0;
 #ifndef __sun__
@@ -77,7 +77,7 @@ int lock_pages(void *addr, size_t len)
     return (e);
 }
 
-void unlock_pages(void *addr, size_t len)
+static void unlock_pages(void *addr, size_t len)
 {
 #ifndef __sun__
     munlock(addr, len);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 1 line · On Tuesday 15 July 2008 15:39:42 Keir Fraser wrote:

How many more of these are there going to be?

One more (already sent). Then the tools build with the additional compiler flags:

-Wstrict-prototypes -Wswitch -Wmissing-prototypes -Wreturn-type -Wnested-externs -Wredundant-decls -Wfloat-equal -Wundef -Wimplicit-function-declaration

Is there a way to add them w/o adding them to the xen-kernel ?

Christoph

Quoted 9 lines

-- Keir

Quoted 5 lines · Christoph Egger

Hi,

Attached patch makes xenperf's functions static which have no prototypes.

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
#3 lore raw

Review

Quoted 6 lines · Christoph Egger

One more (already sent). Then the tools build with the additional compiler flags:

(quoted diff) +0 -3
-Wstrict-prototypes -Wswitch -Wmissing-prototypes -Wreturn-type
-Wnested-externs
-Wredundant-decls -Wfloat-equal -Wundef -Wimplicit-function-declaration

Do we really want these? Certainly I'm not going to play whack-a-warning with umpteen versions of gcc before 3.3 is out.

-- Keir

#4 lore raw
Quoted 10 lines · On Tuesday 15 July 2008 15:52:13 Keir Fraser wrote:

Review

Quoted 6 lines · Christoph Egger

One more (already sent). Then the tools build with the additional compiler flags:

(quoted diff) +0 -3
-Wstrict-prototypes -Wswitch -Wmissing-prototypes -Wreturn-type
-Wnested-externs
-Wredundant-decls -Wfloat-equal -Wundef -Wimplicit-function-declaration

Do we really want these? Certainly I'm not going to play whack-a-warning with umpteen versions of gcc before 3.3 is out.

Probably not all of them. -Wfloat-equal has no effect because there's no FPU code in Xen.

The flags -Wmissing-prototypes -Wnested-externs -Wredundant-decls
and -Wimplicit-function-declaration resulted in the patches I sent
yesterday and today.
These flags guarantee that future patches have a higher quality.

For the xen-kernel itself I'm not yet through with these flags. Nonetheless, I can send a patch you will like. :)

Christoph

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
#5 lore raw
Quoted 2 lines · Christoph Egger

For the xen-kernel itself I'm not yet through with these flags. Nonetheless, I can send a patch you will like. :)

I doubt it. :-)

-- keir

#6 lore raw

PATCH 1/1 cleanup (was: Re: [PATCH][TOOLS] xenperf: cleanup)

Quoted 7 lines · On Tuesday 15 July 2008 16:16:27 Keir Fraser wrote:
Quoted 2 lines · Christoph Egger

For the xen-kernel itself I'm not yet through with these flags. Nonetheless, I can send a patch you will like. :)

I doubt it. :-)

-- keir

Then check this out! :-)

Christoph

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
xen/common/sched_sedf.c +2 -2
diff -r 4b882c41c9b9 xen/common/sched_sedf.c
@@ -288,7 +288,7 @@ static inline void list_insert_sort(
 }
 
 #define DOMAIN_COMPARER(name, field, comp1, comp2)          \
-int name##_comp(struct list_head* el1, struct list_head* el2) \
+static int name##_comp(struct list_head* el1, struct list_head* el2) \
 {                                                           \
     struct sedf_vcpu_info *d1, *d2;                     \
     d1 = list_entry(el1,struct sedf_vcpu_info, field);  \
@@ -1067,7 +1067,7 @@ static inline int should_switch(struct v
     return 1;
 }
 
-void sedf_wake(struct vcpu *d)
+static void sedf_wake(struct vcpu *d)
 {
     s_time_t              now = NOW();
     struct sedf_vcpu_info* inf = EDOM_INFO(d);
xen/common/stop_machine.c +1 -0
diff -r 4b882c41c9b9 xen/common/stop_machine.c
@@ -25,6 +25,7 @@
 #include <xen/sched.h>
 #include <xen/spinlock.h>
 #include <xen/softirq.h>
+#include <xen/stop_machine.h>
 #include <xen/errno.h>
 #include <xen/smp.h>
 #include <asm/current.h>
xen/common/version.c +1 -0
diff -r 4b882c41c9b9 xen/common/version.c
@@ -1,4 +1,5 @@
 #include <xen/compile.h>
+#include <xen/version.h>
 
 const char *xen_compile_date(void)
 {
xen/drivers/acpi/reboot.c +1 -0
diff -r 4b882c41c9b9 xen/drivers/acpi/reboot.c
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <xen/pci.h>
+#include <xen/acpi.h>
 #include <acpi/acpi.h>
 
 void acpi_reboot(void)
xen/drivers/passthrough/amd/iommu_intr.c +1 -1
diff -r 4b882c41c9b9 xen/drivers/passthrough/amd/iommu_intr.c
@@ -25,7 +25,7 @@ DEFINE_SPINLOCK(int_remap_table_lock);
 DEFINE_SPINLOCK(int_remap_table_lock);
 void *int_remap_table = NULL;
 
-u8* get_intremap_entry(u8 vector, u8 dm)
+static u8* get_intremap_entry(u8 vector, u8 dm)
 {
     u8 *table;
     int offset = 0;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw

Re: [PATCH][XEN] cleanup (was: Re: [PATCH][TOOLS] xenperf: cleanup)

Quoted 11 lines · Christoph Egger
Quoted 7 lines · Christoph Egger
Quoted 2 lines

For the xen-kernel itself I'm not yet through with these flags. Nonetheless, I can send a patch you will like. :)

I doubt it. :-)

-- keir

Then check this out! :-)

Is that really the whole thing, and not 1 of N? It's very pleasantly surprising if so!

-- Keir

#8 lore raw

Re: [PATCH][XEN] cleanup (was: Re: [PATCH][TOOLS] xenperf: cleanup)

Quoted 9 lines · On Tuesday 15 July 2008 16:44:40 Keir Fraser wrote:
Quoted 8 lines · Christoph Egger
Quoted 7 lines · Christoph Egger
Quoted 2 lines

For the xen-kernel itself I'm not yet through with these flags. Nonetheless, I can send a patch you will like. :)

I doubt it. :-)

-- keir

Quoted 8 lines
Quoted 3 lines

Then check this out! :-)

Is that really the whole thing, and not 1 of N? It's very pleasantly surprising if so!

-- Keir

No, that's just the part you like :) All hypercall functions need a prototype, for example, and there are a lot of redundant declarations.

Christoph

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy