/* cancel_pending - cancel all pending works. @ubi: UBI device description object  */
static void cancel_pending(struct ubi_device *ubi)
/* cancel_pending - cancel all pending works. @ubi: UBI device description object  */
static void cancel_pending(struct ubi_device *ubi)
{
	while (!list_empty(&ubi->works)) {
		struct ubi_work *wrk;
		wrk = list_entry(ubi->works.next, struct ubi_work, list);
		list_del(&wrk->list);
		wrk->func(ubi, wrk, 1);
		ubi->works_count -= 1;
		ubi_assert(ubi->works_count >= 0);
	}
}