On Tue, Jan 31, 2017 at 10:25:53AM +0100, Hannes Reinecke wrote: > Split off _dechain_st() as separate function. > No functional change. > > Signed-off-by: Hannes Reinecke <hare@xxxxxxxx> > --- > drivers/scsi/mpt3sas/mpt3sas_base.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c > index 09d0008..120b317 100644 > --- a/drivers/scsi/mpt3sas/mpt3sas_base.c > +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c > @@ -2365,6 +2365,19 @@ static int mpt3sas_remove_dead_ioc_func(void *arg) > return smid; > } > > +static void > +_dechain_st(struct MPT3SAS_ADAPTER *ioc, struct scsiio_tracker *st) > +{ > + struct chain_tracker *chain_req; > + > + while (!list_empty(&st->chain_list)) { > + chain_req = list_first_entry(&st->chain_list, > + struct chain_tracker, > + tracker_list); > + list_move(&chain_req->tracker_list, &ioc->free_chain_list); > + } Why not just use list_splice_init?