Skip to contentSkip to conversation

e820.c: quiet sparse noise about plain integer as NULL pointer

PATCH New H Hartley Sweeten 1 participant 1 message Sep 9, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e820.c: quiet sparse noise about plain integer as NULL pointer

The last parameter to sort() is a pointer to the function used to swap items. This parameter should be NULL, not 0, when not used. This quiets the following sparse warning:

warning: Using plain integer as NULL pointer

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Kamal Mostafa <[email protected]>
Cc Paul Gortmaker <[email protected]>
Cc Mike Ditto <[email protected]>

---

arch/x86/kernel/e820.c +1 -1
index f655f80..d6bd853 100644
@@ -296,7 +296,7 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
 	chg_nr = chgidx;
 
 	/* sort change-point list by memory addresses (low -> high) */
-	sort(change_point, chg_nr, sizeof *change_point, cpcompare, 0);
+	sort(change_point, chg_nr, sizeof *change_point, cpcompare, NULL);
 
 	/* create a new bios memory map, removing overlaps */
 	overlap_entries = 0;	 /* number of entries in the overlap table */