Re: [PATCH] Driver Core patches for 2.6.9

From: Kronos
Date: Sat Oct 23 2004 - 15:26:39 EST


Greg KH <greg@xxxxxxxxx> ha scritto:
> ChangeSet 1.1867.3.4, 2004/09/15 11:36:09-07:00, greg@xxxxxxxxx
>
> kevent: standardize on the event types
>
> This prevents any potential typos from happening.

[cut]

> diff -Nru a/lib/kobject_uevent.c b/lib/kobject_uevent.c
> --- a/lib/kobject_uevent.c 2004-10-19 09:22:44 -07:00
> +++ b/lib/kobject_uevent.c 2004-10-19 09:22:44 -07:00
> @@ -19,9 +19,29 @@
> #include <linux/skbuff.h>
> #include <linux/netlink.h>
> #include <linux/string.h>
> +#include <linux/kobject_uevent.h>
> #include <linux/kobject.h>
> #include <net/sock.h>
>
> +/*
> + * These must match up with the values for enum kobject_action
> + * as found in include/linux/kobject_uevent.h
> + */
> +static char *actions[] = {
> + "add", /* 0x00 */
> + "remove", /* 0x01 */
> + "change", /* 0x02 */
> + "mount", /* 0x03 */
> +};

Hi Greg,
maybe it's just a matter of taste but I think that is better to do
something like this:

static char *actions[] = {
[KOBJ_ADD] = "add",
[KOBJ_REMOVE] = "remove",
[KOBJ_CHANGE] = "change",
[KOBJ_MOUNT] = "mount",
};

This would prevent the insertion of a new action in the wrong place.

Luca
--
Home: http://kronoz.cjb.net
#include <stdio.h>
int main(void) {printf("\t\t\b\b\b\b\b\b");
printf("\t\t\b\b\b\b\b\b");return 0;}
-
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/