question about drivers/mtd/ubi/cdev.c

Julia Lawall julia at diku.dk
Tue Aug 3 16:12:08 EDT 2010


I was wondering about the following code in the function rename_volumes in 
the file drivers/mtd/ubi/cdev.c:

list_for_each_entry(re, &rename_list, list) {
	...
        if (no_remove_needed)
                continue;
	...
        re = kzalloc(sizeof(struct ubi_rename_entry), GFP_KERNEL);
	if (!re) { ... }
        re->remove = 1;
        re->desc = desc;
        list_add(&re->list, &rename_list);
	...
}

Is there a danger of repeating computation since re is redefined and moved 
back to the beginning of the list?

julia



More information about the linux-mtd mailing list