summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruebayasi <uebayasi@openbsd.org>2014-07-21 17:25:47 +0000
committeruebayasi <uebayasi@openbsd.org>2014-07-21 17:25:47 +0000
commitb33b2f20ae70796395eb93729c5c2ec759e89c6a (patch)
treed8c0865f0eae7a5c4f98ed7e95939ffa32eac3ef
parentKristaps points out that the current HTTP/1.1 draft standard (RFC (diff)
downloadwireguard-openbsd-b33b2f20ae70796395eb93729c5c2ec759e89c6a.tar.xz
wireguard-openbsd-b33b2f20ae70796395eb93729c5c2ec759e89c6a.zip
boot(9): Reduce annoying style diffs
- Always use either: ((x & RB_XXX) != 0) or ((x & RB_XXX) == 0) in boolean context (mostly if (x), or x ? y : z) - prom_halt() in alpha is confirmed to take int as boolean Converted by coccinelle. No functional change intended.
-rw-r--r--sys/arch/alpha/alpha/machdep.c12
-rw-r--r--sys/arch/amd64/amd64/machdep.c12
-rw-r--r--sys/arch/armish/armish/armish_machdep.c8
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c9
-rw-r--r--sys/arch/aviion/aviion/machdep.c6
-rw-r--r--sys/arch/hppa/hppa/machdep.c10
-rw-r--r--sys/arch/hppa64/hppa64/machdep.c10
-rw-r--r--sys/arch/i386/i386/machdep.c14
-rw-r--r--sys/arch/landisk/landisk/machdep.c8
-rw-r--r--sys/arch/loongson/loongson/machdep.c8
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c8
-rw-r--r--sys/arch/macppc/macppc/machdep.c8
-rw-r--r--sys/arch/octeon/octeon/machdep.c8
-rw-r--r--sys/arch/sgi/sgi/machdep.c8
-rw-r--r--sys/arch/socppc/socppc/machdep.c6
-rw-r--r--sys/arch/solbourne/solbourne/machdep.c10
-rw-r--r--sys/arch/sparc/sparc/machdep.c12
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c12
-rw-r--r--sys/arch/vax/vax/machdep.c6
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c10
20 files changed, 93 insertions, 92 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index 204a8906f01..4d9adfcdbba 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.163 2014/07/20 18:24:34 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.164 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
@@ -1035,7 +1035,8 @@ haltsys:
config_suspend(mainbus, DVACT_POWERDOWN);
#ifdef BOOTKEY
- printf("hit any key to %s...\n", howto & RB_HALT ? "halt" : "reboot");
+ printf("hit any key to %s...\n",
+ (howto & RB_HALT) != 0 ? "halt" : "reboot");
cnpollc(1); /* for proper keyboard command handling */
cngetc();
cnpollc(0);
@@ -1043,13 +1044,14 @@ haltsys:
#endif
/* Finally, powerdown/halt/reboot the system. */
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN &&
+ if ((howto & RB_POWERDOWN) != 0 &&
platform.powerdown != NULL) {
(*platform.powerdown)();
printf("WARNING: powerdown failed!\n");
}
- printf("%s\n\n", howto & RB_HALT ? "halted." : "rebooting...");
- prom_halt(howto & RB_HALT);
+ printf("%s\n\n",
+ (howto & RB_HALT) != 0 ? "halted." : "rebooting...");
+ prom_halt((howto & RB_HALT) != 0);
for (;;) ;
/* NOTREACHED */
}
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index c275f588b15..1754f3c6dcc 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.188 2014/07/13 22:53:38 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.189 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -748,7 +748,7 @@ boot(int howto)
{
struct device *mainbus;
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_POWERDOWN) != 0)
lid_suspend = 0;
if (cold) {
@@ -776,7 +776,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -789,13 +789,13 @@ haltsys:
x86_broadcast_ipi(X86_IPI_HALT);
#endif
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
#if NACPI > 0 && !defined(SMALL_KERNEL)
extern int acpi_enabled;
if (acpi_enabled) {
delay(500000);
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_POWERDOWN) != 0)
acpi_powerdown();
}
#endif
@@ -811,7 +811,7 @@ haltsys:
if (cpureset_delay > 0)
delay(cpureset_delay * 1000);
cpu_reset();
- for(;;) ;
+ for (;;) ;
/* NOTREACHED */
}
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c
index 0c7dc79c1bc..ef68fe60777 100644
--- a/sys/arch/armish/armish/armish_machdep.c
+++ b/sys/arch/armish/armish/armish_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armish_machdep.c,v 1.30 2014/07/13 22:53:38 uebayasi Exp $ */
+/* $OpenBSD: armish_machdep.c,v 1.31 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -264,7 +264,7 @@ boot(int howto)
* that it cannot page part of the binary in as the filesystem has
* been unmounted.
*/
- if (!(howto & RB_NOSYNC))
+ if ((howto & RB_NOSYNC) == 0)
bootsync(howto);
if_downall();
@@ -285,8 +285,8 @@ haltsys:
/* Make sure IRQ's are disabled */
IRQdisable;
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0) {
board_powerdown();
printf("WARNING: powerdown failed!\n");
}
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index f1fc83a64f1..803de690670 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.13 2014/07/13 22:53:38 uebayasi Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.14 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -280,7 +280,7 @@ boot(int howto)
* that it cannot page part of the binary in as the filesystem has
* been unmounted.
*/
- if (!(howto & RB_NOSYNC))
+ if ((howto & RB_NOSYNC) == 0)
bootsync(howto);
if_downall();
@@ -299,9 +299,8 @@ boot(int howto)
/* Make sure IRQ's are disabled */
IRQdisable;
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN) {
-
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0) {
printf("\nAttempting to power down...\n");
delay(500000);
platform_powerdown();
diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c
index 0e5bb03e0f9..8735ca2fe32 100644
--- a/sys/arch/aviion/aviion/machdep.c
+++ b/sys/arch/aviion/aviion/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.70 2014/07/13 22:53:38 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.71 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
*
@@ -321,7 +321,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -330,7 +330,7 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
printf("System halted.\n\n");
bootstack();
cmmu_shutdown();
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 0a149c0283b..a9bc5cb41e7 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.231 2014/07/13 22:53:38 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.232 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -908,7 +908,7 @@ boot(int howto)
boothowto = howto | (boothowto & RB_HALT);
- if (!(howto & RB_NOSYNC)) {
+ if ((howto & RB_NOSYNC) == 0) {
waittime = 0;
vfs_shutdown();
@@ -924,7 +924,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -941,8 +941,8 @@ haltsys:
if (cold_hook)
(*cold_hook)(HPPA_COLD_COLD);
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN && cold_hook) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0 && cold_hook) {
printf("Powering off...");
DELAY(2000000);
(*cold_hook)(HPPA_COLD_OFF);
diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c
index 88a80d651fa..5578ef0ba60 100644
--- a/sys/arch/hppa64/hppa64/machdep.c
+++ b/sys/arch/hppa64/hppa64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.69 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.70 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -545,7 +545,7 @@ boot(int howto)
boothowto = howto | (boothowto & RB_HALT);
- if (!(howto & RB_NOSYNC)) {
+ if ((howto & RB_NOSYNC) == 0) {
waittime = 0;
vfs_shutdown();
@@ -561,7 +561,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -574,8 +574,8 @@ haltsys:
if (cold_hook)
(*cold_hook)(HPPA_COLD_COLD);
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN && cold_hook) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0 && cold_hook) {
printf("Powering off...");
DELAY(2000000);
(*cold_hook)(HPPA_COLD_OFF);
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 559b4302ccf..e51d974b695 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.549 2014/07/14 08:36:31 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.550 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2559,7 +2559,7 @@ boot(int howto)
{
struct device *mainbus;
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_POWERDOWN) != 0)
lid_suspend = 0;
if (cold) {
@@ -2587,7 +2587,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -2600,19 +2600,19 @@ haltsys:
i386_broadcast_ipi(I386_IPI_HALT);
#endif
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
#if NACPI > 0 && !defined(SMALL_KERNEL)
extern int acpi_enabled;
if (acpi_enabled) {
delay(500000);
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_POWERDOWN) != 0)
acpi_powerdown();
}
#endif
#if NAPM > 0
- if (howto & RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
int rv;
printf("\nAttempting to power down...\n");
@@ -2656,7 +2656,7 @@ haltsys:
printf("rebooting...\n");
cpu_reset();
- for(;;) ;
+ for (;;) ;
/* NOTREACHED */
}
diff --git a/sys/arch/landisk/landisk/machdep.c b/sys/arch/landisk/landisk/machdep.c
index b9af60ddfc5..6056240da89 100644
--- a/sys/arch/landisk/landisk/machdep.c
+++ b/sys/arch/landisk/landisk/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.39 2014/07/14 08:36:31 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.40 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*-
@@ -217,7 +217,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -226,14 +226,14 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
_reg_write_1(LANDISK_PWRMNG, PWRMNG_POWEROFF);
delay(1 * 1000 * 1000);
printf("POWEROFF FAILED!\n");
howto |= RB_HALT;
}
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
printf("\n");
printf("The operating system has halted.\n");
printf("Please press any key to reboot.\n\n");
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index 60f2a66f214..584ba772985 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.57 2014/07/19 18:01:23 pirofti Exp $ */
+/* $OpenBSD: machdep.c,v 1.58 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -930,7 +930,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -941,8 +941,8 @@ haltsys:
config_suspend(mainbus, DVACT_POWERDOWN);
}
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0) {
if (sys_platform->powerdown != NULL) {
printf("System Power Down.\n");
(*(sys_platform->powerdown))();
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index 514aad9d4be..05dbd012b93 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.107 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.108 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -495,7 +495,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -505,13 +505,13 @@ haltsys:
config_suspend(mainbus, DVACT_POWERDOWN);
/* LUNA-88K supports automatic powerdown */
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
printf("attempting to power down...\n");
powerdown();
/* if failed, fall through. */
}
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
printf("halted\n\n");
} else {
/* Reset all cpus, which causes reboot */
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 9a6fcee994e..7f56fadc9c1 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.159 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.160 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -829,7 +829,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -838,8 +838,8 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0) {
#if NADB > 0
delay(1000000);
adb_poweroff();
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index eda7c3ee7f0..311f6ed59c8 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.59 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.60 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -694,7 +694,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -703,8 +703,8 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0)
printf("System Power Down not supported,"
" halting system.\n");
else
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index 02cdb50b676..71884fc5f99 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.147 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.148 2014/07/21 17:25:47 uebayasi Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -857,7 +857,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -866,8 +866,8 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0)
printf("System Power Down.\n");
else
printf("System Halt.\n");
diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c
index d3ef1e90087..230d5319c28 100644
--- a/sys/arch/socppc/socppc/machdep.c
+++ b/sys/arch/socppc/socppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.54 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.55 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -1066,8 +1066,8 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
+ if ((howto & RB_HALT) != 0) {
+ if ((howto & RB_POWERDOWN) != 0) {
;
}
diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c
index fd0008a6071..e0ae61fae7a 100644
--- a/sys/arch/solbourne/solbourne/machdep.c
+++ b/sys/arch/solbourne/solbourne/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.41 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.42 2014/07/21 17:25:47 uebayasi Exp $ */
/* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */
/*
@@ -544,7 +544,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -553,16 +553,16 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if ((howto & RB_HALT) || (howto & RB_POWERDOWN)) {
+ if ((howto & RB_HALT) != 0 || (howto & RB_POWERDOWN) != 0) {
printf("halted\n\n");
romhalt();
}
printf("rebooting\n\n");
i = 1;
- if (howto & RB_SINGLE)
+ if ((howto & RB_SINGLE) != 0)
str[i++] = 's';
- if (howto & RB_KDB)
+ if ((howto & RB_KDB) != 0)
str[i++] = 'd';
if (i > 1) {
str[0] = '-';
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index ccc910cdc9c..2f12ff2f840 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.163 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.164 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -553,7 +553,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -562,9 +562,9 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if ((howto & RB_HALT) || (howto & RB_POWERDOWN)) {
+ if ((howto & RB_HALT) != 0 || (howto & RB_POWERDOWN) != 0) {
#if defined(SUN4M)
- if (howto & RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
printf("attempting to power down...\n");
#if NTCTRL > 0
tadpole_powerdown();
@@ -582,9 +582,9 @@ haltsys:
printf("rebooting\n\n");
i = 1;
- if (howto & RB_SINGLE)
+ if ((howto & RB_SINGLE) != 0)
str[i++] = 's';
- if (howto & RB_KDB)
+ if ((howto & RB_KDB) != 0)
str[i++] = 'd';
if (i > 1) {
str[0] = '-';
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 35c6b864aa9..3389bc4cfe2 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.166 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.167 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -643,7 +643,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -653,7 +653,7 @@ haltsys:
config_suspend(mainbus, DVACT_POWERDOWN);
/* If powerdown was requested, do it. */
- if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
/* Let the OBP do the work. */
OF_poweroff();
printf("WARNING: powerdown failed!\n");
@@ -662,7 +662,7 @@ haltsys:
*/
}
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
printf("halted\n\n");
OF_exit();
panic("PROM exit failed");
@@ -682,9 +682,9 @@ haltsys:
str[0] = '\0';
}
- if (howto & RB_SINGLE)
+ if ((howto & RB_SINGLE) != 0)
str[i++] = 's';
- if (howto & RB_KDB)
+ if ((howto & RB_KDB) != 0)
str[i++] = 'd';
if (i > 1) {
if (str[0] == '\0')
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index fbe919ee027..68bcd968f6b 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.142 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.143 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -535,7 +535,7 @@ boot(int howto)
splhigh();
cold = 1;
- if (howto & RB_DUMP)
+ if ((howto & RB_DUMP) != 0)
dumpsys();
haltsys:
@@ -544,7 +544,7 @@ haltsys:
if (mainbus != NULL)
config_suspend(mainbus, DVACT_POWERDOWN);
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
if (dep_call->cpu_halt)
(*dep_call->cpu_halt) ();
printf("halting (in tight loop); hit\n\t^P\n\tHALT\n\n");
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index bae292985bd..60c96d83b64 100644
--- a/sys/arch/zaurus/zaurus/zaurus_machdep.c
+++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_machdep.c,v 1.50 2014/07/13 22:53:39 uebayasi Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.51 2014/07/21 17:25:47 uebayasi Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -295,7 +295,7 @@ boot(int howto)
struct device *mainbus;
extern int lid_suspend;
- if (howto & RB_POWERDOWN)
+ if ((howto & RB_POWERDOWN) != 0)
lid_suspend = 0;
if (cold) {
@@ -311,7 +311,7 @@ boot(int howto)
* that it cannot page part of the binary in as the filesystem has
* been unmounted.
*/
- if (!(howto & RB_NOSYNC))
+ if ((howto & RB_NOSYNC) == 0)
bootsync(howto);
if_downall();
@@ -332,9 +332,9 @@ haltsys:
/* Make sure IRQ's are disabled */
IRQdisable;
- if (howto & RB_HALT) {
+ if ((howto & RB_HALT) != 0) {
#if NAPM > 0
- if (howto & RB_POWERDOWN) {
+ if ((howto & RB_POWERDOWN) != 0) {
printf("\nAttempting to power down...\n");
delay(6000000);