Skip to contentSkip to conversation

lib/sort.c: small cleanups

PATCH In review Adrian Bunk 2 participants 2 messages Sep 3, 2005 – Sep 4, 2005 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/sort.c: small cleanups

This patch contains the following small cleanups:
- make two needlessly global functions static
- every file should #include the header files containing the prototypes of it's global functions

lib/sort.c renamed from lib/sort.c.old +3 -2
@@ -6,15 +6,16 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/sort.h>
 
-void u32_swap(void *a, void *b, int size)
+static void u32_swap(void *a, void *b, int size)
 {
 	u32 t = *(u32 *)a;
 	*(u32 *)a = *(u32 *)b;
 	*(u32 *)b = t;
 }
 
-void generic_swap(void *a, void *b, int size)
+static void generic_swap(void *a, void *b, int size)
 {
 	char t;
 
#1 lore raw
Quoted 4 lines · Adrian Bunk

This patch contains the following small cleanups:
- make two needlessly global functions static
- every file should #include the header files containing the prototypes of it's global functions

While this is a nice cleanup, does anybody remember, why the inner loops are duplicated in the source?

If there are no arguments for it, I would like to consolidate them to a function or a define, if they share to much state.

Or is the duplicate just considered cleaner?

Regards

Ingo Oeser