Skip to contentSkip to conversation

NULL vs. 0 cleanups

PATCH New Geert Uytterhoeven 1 participant 1 message Oct 2, 2004

Subsystems (3)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

PATCH 1/1 NULL vs. 0 cleanups

A few more NULL vs. 0 cleanups, as detected by sparse.

arch/m68k/kernel/setup.c +1 -1
@@ -352,7 +343,7 @@
 #ifndef CONFIG_SUN3
 	startmem= m68k_memory[0].addr;
 	endmem = startmem + m68k_memory[0].size;
-	high_memory = PAGE_OFFSET;
+	high_memory = (void *)PAGE_OFFSET;
 	for (i = 0; i < m68k_num_memory; i++) {
 		m68k_memory[i].size &= MASK_256K;
 		if (m68k_memory[i].addr < startmem)
arch/m68k/mm/memory.c +1 -1
@@ -77,7 +77,7 @@
 		ptable_desc *new;
 
 		if (!(page = (void *)get_zeroed_page(GFP_KERNEL)))
-			return 0;
+			return NULL;
 
 		flush_tlb_kernel_page(page);
 		nocache_page(page);
include/asm-generic/dma-mapping-broken.h +1 -1
@@ -9,7 +9,7 @@
 		   int flag)
 {
 	BUG();
-	return 0;
+	return NULL;
 }
 
 static inline void
drivers/char/amiserial.c +6 -6
@@ -647,7 +651,7 @@
 	/*
 	 * and set the speed of the serial port
 	 */
-	change_speed(info, 0);
+	change_speed(info, NULL);
 
 	info->flags |= ASYNC_INITIALIZED;
 	local_irq_restore(flags);
@@ -693,7 +697,7 @@
 
 	if (info->xmit.buf) {
 		free_page((unsigned long) info->xmit.buf);
-		info->xmit.buf = 0;
+		info->xmit.buf = NULL;
 	}
 
 	info->IER = 0;
@@ -1209,7 +1215,7 @@
 				info->tty->alt_speed = 230400;
 			if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
 				info->tty->alt_speed = 460800;
-			change_speed(info, 0);
+			change_speed(info, NULL);
 		}
 	} else
 		retval = startup(info);
@@ -1564,7 +1570,7 @@
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	info->event = 0;
-	info->tty = 0;
+	info->tty = NULL;
 	if (info->blocked_open) {
 		if (info->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
@@ -1657,7 +1663,7 @@
 	info->event = 0;
 	state->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
 }
 
@@ -1913,7 +1919,7 @@
 		info->magic = SERIAL_MAGIC;
 		info->flags = state->flags;
 		info->quot = 0;
-		info->tty = 0;
+		info->tty = NULL;
 	}
 	local_irq_save(flags);
 	status = ciab.pra;

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds