diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-03-20 10:52:35 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-03-20 10:52:35 +0000 |
commit | d44c43192e771ba81e9bb56363da34c349de4d36 (patch) | |
tree | a6033b0f0fe32d0b4e4de706acc38ee78be964f0 /sys/dev/ic/ami.c | |
parent | 71543092aac27eb8c39afbae121d36f810a97524 (diff) |
remove kernel printfs that say "unable to allocate memory" just before
returning ENOMEM and the like. userland can say that for us while keeping
our dmesg clean.
Diffstat (limited to 'sys/dev/ic/ami.c')
-rw-r--r-- | sys/dev/ic/ami.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index f67b4115cd3..e517733342c 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.134 2006/03/20 10:49:53 dlg Exp $ */ +/* $OpenBSD: ami.c,v 1.135 2006/03/20 10:52:34 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -1810,14 +1810,11 @@ ami_ioctl_inq(struct ami_softc *sc, struct bioc_inq *bi) u_int8_t ch, tg; p = malloc(sizeof *p, M_DEVBUF, M_NOWAIT); - if (!p) { - printf("%s: no memory for disk array\n", DEVNAME(sc)); + if (!p) return (ENOMEM); - } plist = malloc(AMI_BIG_MAX_PDRIVES, M_DEVBUF, M_NOWAIT); if (!plist) { - printf("%s: no memory for disk list\n", DEVNAME(sc)); error = ENOMEM; goto bail; } @@ -1895,10 +1892,8 @@ ami_vol(struct ami_softc *sc, struct bioc_vol *bv, struct ami_big_diskarray *p) u_int8_t ch, tg; plist = malloc(AMI_BIG_MAX_PDRIVES, M_DEVBUF, M_NOWAIT); - if (!plist) { - printf("%s: no memory for disk list\n", DEVNAME(sc)); + if (!plist) return (ENOMEM); - } memset(plist, 0, AMI_BIG_MAX_PDRIVES); @@ -1972,10 +1967,8 @@ ami_disk(struct ami_softc *sc, struct bioc_disk *bd, u_int8_t ch, tg; plist = malloc(AMI_BIG_MAX_PDRIVES, M_DEVBUF, M_NOWAIT); - if (!plist) { - printf("%s: no memory for disk list\n", DEVNAME(sc)); + if (!plist) return (ENOMEM); - } memset(plist, 0, AMI_BIG_MAX_PDRIVES); @@ -2069,10 +2062,8 @@ ami_ioctl_vol(struct ami_softc *sc, struct bioc_vol *bv) int error = 0; p = malloc(sizeof *p, M_DEVBUF, M_NOWAIT); - if (!p) { - printf("%s: no memory for raw interface\n", DEVNAME(sc)); + if (!p) return (ENOMEM); - } if (ami_mgmt(sc, AMI_FCOP, AMI_FC_RDCONF, 0, 0, sizeof *p, p)) { error = EINVAL; @@ -2153,10 +2144,8 @@ ami_ioctl_disk(struct ami_softc *sc, struct bioc_disk *bd) u_int16_t ch, tg; p = malloc(sizeof *p, M_DEVBUF, M_NOWAIT); - if (!p) { - printf("%s: no memory for raw interface\n", DEVNAME(sc)); + if (!p) return (ENOMEM); - } if (ami_mgmt(sc, AMI_FCOP, AMI_FC_RDCONF, 0, 0, sizeof *p, p)) { error = EINVAL; @@ -2314,10 +2303,8 @@ ami_ioctl_setstate(struct ami_softc *sc, struct bioc_setstate *bs) case BIOC_SSHOTSPARE: p = malloc(sizeof *p, M_DEVBUF, M_NOWAIT); - if (!p) { - printf("%s: no memory for setstate\n", DEVNAME(sc)); + if (!p) return (ENOMEM); - } if (ami_mgmt(sc, AMI_FCOP, AMI_FC_RDCONF, 0, 0, sizeof *p, p)) goto bail; |