summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_diskqueue.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2019-02-09 03:33:59 +0000
committerchristos <christos@NetBSD.org>2019-02-09 03:33:59 +0000
commitf9496794ff5670818d14b58cb9ffda8f702eaed7 (patch)
tree44b46fe0fb83d0c2f7514745778b296e33474227 /sys/dev/raidframe/rf_diskqueue.c
parent96d63dcbe0bd602859527fcd9c280042831fea01 (diff)
- Change the allocation macros to be more like function calls
- Change sizeof(type) -> sizeof(*variable) - Use macros for the long buffer length allocations - Remove "bit polishing" memsets() -- do them only once - Remove unnecessary casts Thanks to oster@ for finding bugs and testing.
Diffstat (limited to 'sys/dev/raidframe/rf_diskqueue.c')
-rw-r--r--sys/dev/raidframe/rf_diskqueue.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c
index 33e42772f91..f4e39cb8054 100644
--- a/sys/dev/raidframe/rf_diskqueue.c
+++ b/sys/dev/raidframe/rf_diskqueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.c,v 1.53 2011/05/05 06:04:09 mrg Exp $ */
+/* $NetBSD: rf_diskqueue.c,v 1.54 2019/02/09 03:34:00 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -66,7 +66,7 @@
****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.53 2011/05/05 06:04:09 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.54 2019/02/09 03:34:00 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -225,10 +225,9 @@ rf_ConfigureDiskQueues(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
}
raidPtr->qType = p;
- RF_MallocAndAdd(diskQueues,
- (raidPtr->numCol + RF_MAXSPARE) *
- sizeof(RF_DiskQueue_t), (RF_DiskQueue_t *),
- raidPtr->cleanupList);
+ diskQueues = RF_MallocAndAdd(
+ (raidPtr->numCol + RF_MAXSPARE) * sizeof(*diskQueues),
+ raidPtr->cleanupList);
if (diskQueues == NULL)
return (ENOMEM);
raidPtr->Queues = diskQueues;
@@ -372,7 +371,7 @@ rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect,
if (p == NULL)
return (NULL);
- memset(p, 0, sizeof(RF_DiskQueueData_t));
+ memset(p, 0, sizeof(*p));
if (waitflag == PR_WAITOK) {
p->bp = getiobuf(NULL, true);
} else {