Module Name: src Committed By: christos Date: Sat May 25 16:30:18 UTC 2019
Modified Files: src/sys/dev/ata: ata.c Log Message: use PR_ZERO To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/dev/ata/ata.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ata/ata.c diff -u src/sys/dev/ata/ata.c:1.148 src/sys/dev/ata/ata.c:1.149 --- src/sys/dev/ata/ata.c:1.148 Fri Apr 5 20:35:25 2019 +++ src/sys/dev/ata/ata.c Sat May 25 12:30:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.148 2019/04/06 00:35:25 uwe Exp $ */ +/* $NetBSD: ata.c,v 1.149 2019/05/25 16:30:18 christos Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.148 2019/04/06 00:35:25 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.149 2019/05/25 16:30:18 christos Exp $"); #include "opt_ata.h" @@ -1278,17 +1278,8 @@ ata_activate_xfer_locked(struct ata_chan struct ata_xfer * ata_get_xfer(struct ata_channel *chp, bool waitok) { - struct ata_xfer *xfer; - - xfer = pool_get(&ata_xfer_pool, waitok ? PR_WAITOK : PR_NOWAIT); - KASSERT(!waitok || xfer != NULL); - - if (xfer != NULL) { - /* zero everything */ - memset(xfer, 0, sizeof(*xfer)); - } - - return xfer; + return pool_get(&ata_xfer_pool, + PR_ZERO | (waitok ? PR_WAITOK : PR_NOWAIT)); } /*