X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fkobject_uevent.c;h=2fa545a631607dc1d0498a7c2bff592ad7d115bb;hb=551395ae667d699189014f762355e9131fc03e79;hp=0d56dad319ad33b8354c1396866158a6a0de4c91;hpb=2d38f9a4f8d2ebdc799f03eecf82345825495711;p=linux-2.6 diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 0d56dad319..2fa545a631 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -19,12 +19,10 @@ #include #include -#ifdef CONFIG_NET #include #include #include #include -#endif u64 uevent_seqnum; @@ -59,7 +57,7 @@ int kobject_action_type(const char *buf, size_t count, enum kobject_action action; int ret = -EINVAL; - if (count && buf[count-1] == '\n') + if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) count--; if (!count) @@ -103,7 +101,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, int retval = 0; pr_debug("kobject: '%s' (%p): %s\n", - kobject_name(kobj), kobj, __FUNCTION__); + kobject_name(kobj), kobj, __func__); /* search the kset we belong to */ top_kobj = kobj; @@ -113,7 +111,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, if (!top_kobj->kset) { pr_debug("kobject: '%s' (%p): %s: attempted to send uevent " "without kset!\n", kobject_name(kobj), kobj, - __FUNCTION__); + __func__); return -EINVAL; } @@ -125,7 +123,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, if (!uevent_ops->filter(kset, kobj)) { pr_debug("kobject: '%s' (%p): %s: filter function " "caused the event to drop!\n", - kobject_name(kobj), kobj, __FUNCTION__); + kobject_name(kobj), kobj, __func__); return 0; } @@ -137,7 +135,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, if (!subsystem) { pr_debug("kobject: '%s' (%p): %s: unset subsystem caused the " "event to drop!\n", kobject_name(kobj), kobj, - __FUNCTION__); + __func__); return 0; } @@ -179,7 +177,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, if (retval) { pr_debug("kobject: '%s' (%p): %s: uevent() returned " "%d\n", kobject_name(kobj), kobj, - __FUNCTION__, retval); + __func__, retval); goto exit; } }