Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/powerpc There is not much point in of_compa...



details:   https://anonhg.NetBSD.org/src/rev/c752091b9a3b
branches:  trunk
changeset: 1018240:c752091b9a3b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jan 27 03:17:24 2021 +0000

description:
There is not much point in of_compatible() returning -1 for "no match"
and >= 0 for "match".  Just make it return 0 for "no match" and >0 for
"match" so it can be treated like a boolean expression.

diffstat:

 sys/arch/powerpc/powerpc/ofw_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0bb05b7e7106 -r c752091b9a3b sys/arch/powerpc/powerpc/ofw_machdep.c
--- a/sys/arch/powerpc/powerpc/ofw_machdep.c    Wed Jan 27 03:10:18 2021 +0000
+++ b/sys/arch/powerpc/powerpc/ofw_machdep.c    Wed Jan 27 03:17:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_machdep.c,v 1.25 2014/02/28 05:44:39 matt Exp $    */
+/*     $NetBSD: ofw_machdep.c,v 1.26 2021/01/27 03:17:24 thorpej Exp $ */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.25 2014/02/28 05:44:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.26 2021/01/27 03:17:24 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -151,7 +151,7 @@
         * according to comments in FreeBSD all Apple OF has 32bit values in
         * "available", no matter what the cell sizes are
         */
-       if (of_compatible(hroot, macrisc) != -1) {
+       if (of_compatible(hroot, macrisc)) {
                DPRINTF("this appears to be a mac...\n");
                acells = 1;
                scells = 1;



Home | Main Index | Thread Index | Old Index