From be864067da4745c8644bd654a549eeed63e952ad Mon Sep 17 00:00:00 2001 From: oster Date: Sat, 12 Feb 2005 03:44:41 +0000 Subject: [PATCH] The 'next' argument to rf_CreateDiskQueueData is always NULL. Since there is no particular reason to pass an extra NULL argument, turf it, and initialize p->next to NULL within the function. --- sys/dev/raidframe/rf_copyback.c | 8 ++++---- sys/dev/raidframe/rf_dagfuncs.c | 10 ++++------ sys/dev/raidframe/rf_diskqueue.c | 7 +++---- sys/dev/raidframe/rf_diskqueue.h | 4 ++-- sys/dev/raidframe/rf_reconstruct.c | 10 +++++----- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c index dc5c7d212c44..95b3eb933a5e 100644 --- a/sys/dev/raidframe/rf_copyback.c +++ b/sys/dev/raidframe/rf_copyback.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_copyback.c,v 1.29 2005/02/12 03:27:33 oster Exp $ */ +/* $NetBSD: rf_copyback.c,v 1.30 2005/02/12 03:44:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -38,7 +38,7 @@ ****************************************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.29 2005/02/12 03:27:33 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.30 2005/02/12 03:44:41 oster Exp $"); #include @@ -337,12 +337,12 @@ rf_CopybackOne(RF_CopybackDesc_t *desc, int typ, RF_RaidAddr_t addr, desc->readreq = rf_CreateDiskQueueData(RF_IO_TYPE_READ, spOffs, sectPerSU, desc->databuf, 0L, 0, (int (*) (void *, int)) rf_CopybackReadDoneProc, desc, - NULL, NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL, + NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL, PR_WAITOK); desc->writereq = rf_CreateDiskQueueData(RF_IO_TYPE_WRITE, testOffs, sectPerSU, desc->databuf, 0L, 0, (int (*) (void *, int)) rf_CopybackWriteDoneProc, desc, - NULL, NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL, + NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL, PR_WAITOK); desc->fcol = testCol; diff --git a/sys/dev/raidframe/rf_dagfuncs.c b/sys/dev/raidframe/rf_dagfuncs.c index 3427bf8596f9..b2bbb5815490 100644 --- a/sys/dev/raidframe/rf_dagfuncs.c +++ b/sys/dev/raidframe/rf_dagfuncs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_dagfuncs.c,v 1.21 2005/02/12 03:27:33 oster Exp $ */ +/* $NetBSD: rf_dagfuncs.c,v 1.22 2005/02/12 03:44:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.21 2005/02/12 03:27:33 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.22 2005/02/12 03:44:41 oster Exp $"); #include #include @@ -290,7 +290,7 @@ rf_DiskReadFuncForThreads(RF_DagNode_t *node) req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector, buf, parityStripeID, which_ru, (int (*) (void *, int)) node->wakeFunc, - node, NULL, + node, #if RF_ACC_TRACE > 0 node->dagHdr->tracerec, #else @@ -330,7 +330,7 @@ rf_DiskWriteFuncForThreads(RF_DagNode_t *node) req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector, buf, parityStripeID, which_ru, (int (*) (void *, int)) node->wakeFunc, - (void *) node, NULL, + (void *) node, #if RF_ACC_TRACE > 0 node->dagHdr->tracerec, #else @@ -364,7 +364,6 @@ rf_DiskUndoFunc(RF_DagNode_t *node) 0L, 0, NULL, 0L, 0, (int (*) (void *, int)) node->wakeFunc, (void *) node, - NULL, #if RF_ACC_TRACE > 0 node->dagHdr->tracerec, #else @@ -395,7 +394,6 @@ rf_DiskUnlockFuncForThreads(RF_DagNode_t *node) 0L, 0, NULL, 0L, 0, (int (*) (void *, int)) node->wakeFunc, (void *) node, - NULL, #if RF_ACC_TRACE > 0 node->dagHdr->tracerec, #else diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c index 94036f0b07a1..f6c4ed51765a 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.38 2005/02/12 03:27:33 oster Exp $ */ +/* $NetBSD: rf_diskqueue.c,v 1.39 2005/02/12 03:44:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -66,7 +66,7 @@ ****************************************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.38 2005/02/12 03:27:33 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.39 2005/02/12 03:44:41 oster Exp $"); #include @@ -444,7 +444,6 @@ rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect, RF_StripeNum_t parityStripeID, RF_ReconUnitNum_t which_ru, int (*wakeF) (void *, int), void *arg, - RF_DiskQueueData_t *next, RF_AccTraceEntry_t *tracerec, RF_Raid_t *raidPtr, RF_DiskQueueDataFlags_t flags, void *kb_proc, int waitflag) @@ -476,7 +475,7 @@ rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect, p->which_ru = which_ru; p->CompleteFunc = wakeF; p->argument = arg; - p->next = next; + p->next = NULL; p->tracerec = tracerec; p->priority = RF_IO_NORMAL_PRIORITY; p->raidPtr = raidPtr; diff --git a/sys/dev/raidframe/rf_diskqueue.h b/sys/dev/raidframe/rf_diskqueue.h index 37d0f337c48a..cc6299518eb0 100644 --- a/sys/dev/raidframe/rf_diskqueue.h +++ b/sys/dev/raidframe/rf_diskqueue.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_diskqueue.h,v 1.18 2005/02/12 03:27:33 oster Exp $ */ +/* $NetBSD: rf_diskqueue.h,v 1.19 2005/02/12 03:44:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -157,7 +157,7 @@ RF_DiskQueueData_t *rf_CreateDiskQueueData(RF_IoType_t, RF_SectorNum_t, RF_SectorCount_t , caddr_t, RF_StripeNum_t, RF_ReconUnitNum_t, int (*wakeF) (void *, int), - void *, RF_DiskQueueData_t *, + void *, RF_AccTraceEntry_t *, RF_Raid_t *, RF_DiskQueueDataFlags_t, void *, int); diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index cc0436f085ec..722c6d5ad965 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.85 2005/02/12 03:27:33 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.86 2005/02/12 03:44:41 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ************************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.85 2005/02/12 03:27:33 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.86 2005/02/12 03:44:41 oster Exp $"); #include #include @@ -1184,7 +1184,7 @@ TryToRead(RF_Raid_t *raidPtr, RF_RowCol_t col) /* should be ok to use a NULL proc pointer here, all the bufs we use * should be in kernel space */ req = rf_CreateDiskQueueData(RF_IO_TYPE_READ, ctrl->diskOffset, sectorsPerRU, ctrl->rbuf->buffer, psid, which_ru, - ReconReadDoneProc, (void *) ctrl, NULL, + ReconReadDoneProc, (void *) ctrl, #if RF_ACC_TRACE > 0 &raidPtr->recon_tracerecs[col], #else @@ -1372,7 +1372,7 @@ IssueNextWriteRequest(RF_Raid_t *raidPtr) req = rf_CreateDiskQueueData(RF_IO_TYPE_WRITE, rbuf->spOffset, sectorsPerRU, rbuf->buffer, rbuf->parityStripeID, rbuf->which_ru, - ReconWriteDoneProc, (void *) rbuf, NULL, + ReconWriteDoneProc, (void *) rbuf, #if RF_ACC_TRACE > 0 &raidPtr->recon_tracerecs[fcol], #else @@ -1701,7 +1701,7 @@ rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap, /* use NULL b_proc b/c all addrs * should be in kernel space */ req = rf_CreateDiskQueueData(RF_IO_TYPE_READ, offset + which_ru * sectorsPerRU, sectorsPerRU, new_rbuf->buffer, - psid, which_ru, (int (*) (void *, int)) ForceReconReadDoneProc, (void *) new_rbuf, NULL, + psid, which_ru, (int (*) (void *, int)) ForceReconReadDoneProc, (void *) new_rbuf, NULL, (void *) raidPtr, 0, NULL, PR_WAITOK); new_rbuf->arg = req;