Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev remove redundant null check
details: https://anonhg.NetBSD.org/src/rev/2d5387d7b8fb
branches: trunk
changeset: 349421:2d5387d7b8fb
user: maya <maya%NetBSD.org@localhost>
date: Sat Dec 10 16:08:04 2016 +0000
description:
remove redundant null check
allocating with KM_SLEEP can't fail
diffstat:
sys/dev/audio.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diffs (36 lines):
diff -r 39afa13cf070 -r 2d5387d7b8fb sys/dev/audio.c
--- a/sys/dev/audio.c Sat Dec 10 14:13:29 2016 +0000
+++ b/sys/dev/audio.c Sat Dec 10 16:08:04 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.271 2016/12/09 13:06:02 martin Exp $ */
+/* $NetBSD: audio.c,v 1.272 2016/12/10 16:08:04 maya Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.271 2016/12/09 13:06:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.272 2016/12/10 16:08:04 maya Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -1331,8 +1331,6 @@
size = min(size, AU_RING_SIZE);
stream->bufsize = size;
stream->start = kmem_zalloc(size, KM_SLEEP);
- if (stream->start == NULL)
- return ENOMEM;
frame_size = (param->precision + 7) / 8 * param->channels;
size = (size / frame_size) * frame_size;
stream->end = stream->start + size;
@@ -1864,8 +1862,6 @@
return ENXIO;
sc->sc_vchan[n] = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP);
- if (sc->sc_vchan[n] == NULL)
- return ENOMEM;
vc = sc->sc_vchan[n];
vc->sc_open = 0;
Home |
Main Index |
Thread Index |
Old Index