Re: [KJ][PATCH] Correct misc_register return code handling inseveral drivers

From: Alan Cox
Date: Mon Oct 23 2006 - 13:39:06 EST


Ar Llu, 2006-10-23 am 13:19 -0400, ysgrifennodd Neil Horman:
> + for_each_online_node(node) {
> + if(timers[node] != NULL)
> + kfree(timers[node]);
> + }

The if test appears to be redundant as kfree(NULL) is a valid no-op.

> + if (misc_register(&hp_sdc_rtc_dev) != 0)
> + printk(KERN_INFO "Could not register misc. dev for sdc\n");

Many users will misconstrue this has a hard disk name - is there a
better name to use.

> if (ret)
> printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);

These all really show that we should pass the name into the misc
register and do the printk there to cut down on random name variants and
kernel size. Separate problem, just noting it in case someone feels
inspired 8)

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/