diff options
| author | christos <christos@NetBSD.org> | 2019-02-09 03:33:59 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2019-02-09 03:33:59 +0000 |
| commit | f9496794ff5670818d14b58cb9ffda8f702eaed7 (patch) | |
| tree | 44b46fe0fb83d0c2f7514745778b296e33474227 /sys/dev/raidframe/rf_raid4.c | |
| parent | 96d63dcbe0bd602859527fcd9c280042831fea01 (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_raid4.c')
| -rw-r--r-- | sys/dev/raidframe/rf_raid4.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/raidframe/rf_raid4.c b/sys/dev/raidframe/rf_raid4.c index 5d66cc8fe85..db24418deeb 100644 --- a/sys/dev/raidframe/rf_raid4.c +++ b/sys/dev/raidframe/rf_raid4.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_raid4.c,v 1.12 2006/11/16 01:33:23 christos Exp $ */ +/* $NetBSD: rf_raid4.c,v 1.13 2019/02/09 03:34:00 christos Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ***************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_raid4.c,v 1.12 2006/11/16 01:33:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_raid4.c,v 1.13 2019/02/09 03:34:00 christos Exp $"); #include "rf_raid.h" #include "rf_dag.h" @@ -62,13 +62,14 @@ rf_ConfigureRAID4(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr, int i; /* create a RAID level 4 configuration structure ... */ - RF_MallocAndAdd(info, sizeof(RF_Raid4ConfigInfo_t), (RF_Raid4ConfigInfo_t *), raidPtr->cleanupList); + info = RF_MallocAndAdd(sizeof(*info), raidPtr->cleanupList); if (info == NULL) return (ENOMEM); layoutPtr->layoutSpecificInfo = (void *) info; /* ... and fill it in. */ - RF_MallocAndAdd(info->stripeIdentifier, raidPtr->numCol * sizeof(RF_RowCol_t), (RF_RowCol_t *), raidPtr->cleanupList); + info->stripeIdentifier = RF_MallocAndAdd(raidPtr->numCol * + sizeof(*info->stripeIdentifier), raidPtr->cleanupList); if (info->stripeIdentifier == NULL) return (ENOMEM); for (i = 0; i < raidPtr->numCol; i++) |
