Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Nake return values from bounds_check_with_label() c...



details:   https://anonhg.NetBSD.org/src/rev/1b24b0405cb6
branches:  trunk
changeset: 545804:1b24b0405cb6
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Apr 16 15:00:59 2003 +0000

description:
Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().

diffstat:

 sys/arch/arc/arc/disksubr.c                   |  7 +++----
 sys/arch/arm/arm/disksubr.c                   |  7 +++----
 sys/arch/bebox/bebox/disksubr.c               |  7 +++----
 sys/arch/cobalt/cobalt/disksubr.c             |  7 +++----
 sys/arch/evbmips/evbmips/disksubr.c           |  4 ++--
 sys/arch/evbppc/evbppc/disksubr.c             |  7 +++----
 sys/arch/hp700/hp700/disksubr.c               |  7 +++----
 sys/arch/hpc/hpc/disksubr.c                   |  7 +++----
 sys/arch/i386/i386/disksubr.c                 |  9 ++++-----
 sys/arch/mac68k/mac68k/disksubr.c             |  7 +++----
 sys/arch/macppc/macppc/disksubr.c             |  7 +++----
 sys/arch/mvmeppc/mvmeppc/disksubr.c           |  7 +++----
 sys/arch/ofppc/ofppc/disksubr.c               |  7 +++----
 sys/arch/playstation2/playstation2/disksubr.c |  7 +++----
 sys/arch/pmppc/pmppc/disksubr.c               |  7 +++----
 sys/arch/prep/prep/disksubr.c                 |  7 +++----
 sys/arch/sandpoint/sandpoint/disksubr.c       |  7 +++----
 sys/arch/sbmips/sbmips/disksubr.c             |  7 +++----
 sys/arch/sh3/sh3/disksubr.c                   |  7 +++----
 sys/arch/vax/mba/hp.c                         |  4 ++--
 sys/arch/x68k/x68k/disksubr.c                 |  7 +++----
 sys/arch/x86_64/x86_64/disksubr.c             |  7 +++----
 22 files changed, 65 insertions(+), 85 deletions(-)

diffs (truncated from 567 to 300 lines):

diff -r 86200370231f -r 1b24b0405cb6 sys/arch/arc/arc/disksubr.c
--- a/sys/arch/arc/arc/disksubr.c       Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/arc/arc/disksubr.c       Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.13 2003/01/19 10:06:12 tsutsui Exp $    */
+/*     $NetBSD: disksubr.c,v 1.14 2003/04/16 15:00:59 bouyer Exp $     */
 /*     $OpenBSD: disksubr.c,v 1.14 1997/05/08 00:14:29 deraadt Exp $   */
 /*     NetBSD: disksubr.c,v 1.40 1999/05/06 15:45:51 christos Exp      */
 
@@ -530,7 +530,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return 0;
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -558,6 +558,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/arm/arm/disksubr.c
--- a/sys/arch/arm/arm/disksubr.c       Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/arm/arm/disksubr.c       Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.3 2002/08/27 17:30:02 thorpej Exp $     */
+/*     $NetBSD: disksubr.c,v 1.4 2003/04/16 15:01:00 bouyer Exp $      */
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -404,7 +404,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -432,8 +432,7 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
 
 /* End of disksubr.c */
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/bebox/bebox/disksubr.c
--- a/sys/arch/bebox/bebox/disksubr.c   Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/bebox/bebox/disksubr.c   Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.9 2002/02/19 17:09:43 wiz Exp $ */
+/*     $NetBSD: disksubr.c,v 1.10 2003/04/16 15:01:01 bouyer Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -483,7 +483,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -511,6 +511,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/cobalt/cobalt/disksubr.c
--- a/sys/arch/cobalt/cobalt/disksubr.c Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/cobalt/cobalt/disksubr.c Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.7 2002/02/19 17:09:43 wiz Exp $ */
+/*     $NetBSD: disksubr.c,v 1.8 2003/04/16 15:01:01 bouyer Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -424,7 +424,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -452,6 +452,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/evbmips/evbmips/disksubr.c
--- a/sys/arch/evbmips/evbmips/disksubr.c       Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/evbmips/evbmips/disksubr.c       Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.2 2003/03/19 03:05:43 simonb Exp $ */
+/* $NetBSD: disksubr.c,v 1.3 2003/04/16 15:01:01 bouyer Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -271,5 +271,5 @@
        return (1);
 bad:
        bp->b_flags |= B_ERROR;
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/evbppc/evbppc/disksubr.c
--- a/sys/arch/evbppc/evbppc/disksubr.c Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/evbppc/evbppc/disksubr.c Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.1 2003/03/04 07:51:01 matt Exp $        */
+/*     $NetBSD: disksubr.c,v 1.2 2003/04/16 15:01:02 bouyer Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -278,7 +278,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -306,6 +306,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/hp700/hp700/disksubr.c
--- a/sys/arch/hp700/hp700/disksubr.c   Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/hp700/hp700/disksubr.c   Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.1 2002/06/06 19:48:05 fredette Exp $    */
+/*     $NetBSD: disksubr.c,v 1.2 2003/04/16 15:01:02 bouyer Exp $      */
 
 /*     $OpenBSD: disksubr.c,v 1.6 2000/10/18 21:00:34 mickey Exp $     */
 
@@ -854,7 +854,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -880,6 +880,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/hpc/hpc/disksubr.c
--- a/sys/arch/hpc/hpc/disksubr.c       Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/hpc/hpc/disksubr.c       Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.3 2002/02/19 17:09:43 wiz Exp $ */
+/*     $NetBSD: disksubr.c,v 1.4 2003/04/16 15:01:03 bouyer Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -469,7 +469,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -497,6 +497,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/i386/i386/disksubr.c
--- a/sys/arch/i386/i386/disksubr.c     Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/i386/i386/disksubr.c     Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.48 2003/01/31 15:35:04 fvdl Exp $       */
+/*     $NetBSD: disksubr.c,v 1.49 2003/04/16 15:01:03 bouyer Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.48 2003/01/31 15:35:04 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.49 2003/04/16 15:01:03 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -490,7 +490,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -518,6 +518,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/mac68k/mac68k/disksubr.c
--- a/sys/arch/mac68k/mac68k/disksubr.c Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/mac68k/mac68k/disksubr.c Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.42 2002/06/29 19:44:52 scottr Exp $     */
+/*     $NetBSD: disksubr.c,v 1.43 2003/04/16 15:01:04 bouyer Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -639,7 +639,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return (0);
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -669,6 +669,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return (0);
+       return (-1);
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/macppc/macppc/disksubr.c
--- a/sys/arch/macppc/macppc/disksubr.c Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/macppc/macppc/disksubr.c Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.25 2002/09/28 01:17:10 dbj Exp $        */
+/*     $NetBSD: disksubr.c,v 1.26 2003/04/16 15:01:04 bouyer Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -727,7 +727,7 @@
                if (sz == 0) {
                        /* If axactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;
-                       goto done;
+                       return 0;
                }
                if (sz < 0) {
                        /* If past end of disk, return EINVAL. */
@@ -746,6 +746,5 @@
 
 bad:
        bp->b_flags |= B_ERROR;
-done:
-       return 0;
+       return -1;
 }
diff -r 86200370231f -r 1b24b0405cb6 sys/arch/mvmeppc/mvmeppc/disksubr.c
--- a/sys/arch/mvmeppc/mvmeppc/disksubr.c       Wed Apr 16 14:58:32 2003 +0000
+++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c       Wed Apr 16 15:00:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.2 2003/03/19 03:05:43 simonb Exp $      */
+/*     $NetBSD: disksubr.c,v 1.3 2003/04/16 15:01:05 bouyer Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -481,7 +481,7 @@
                if (sz == 0) {
                        /* If exactly at end of disk, return EOF. */
                        bp->b_resid = bp->b_bcount;



Home | Main Index | Thread Index | Old Index