[PATCH net-next v6 1/5] kselftest: factor out list manipulation to a helper