From: kay.sievers@vrfy.org Date: Sun, 28 Nov 2004 13:01:43 +0000 (+0100) Subject: [PATCH] remove unused variables X-Git-Tag: 047~23 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=45a7b668eca398831c0cfc39e4237494b3d603e9;hp=4497fcbf7159975560b680fd8130adcd414d3d67;p=elogind.git [PATCH] remove unused variables Remove udev.bus, cause it's currently unused and newer kernels will pass it in the hotplug environment as PHYSDEVBUS. Remove udev.action, cause it's unused. Rename udev_set_values() to udev_init_device(). --- diff --git a/namedev.c b/namedev.c index 8976b8d40..c043cf339 100644 --- a/namedev.c +++ b/namedev.c @@ -708,7 +708,6 @@ try_parent: return -ENODEV; dbg("sysfs_device->path='%s'", sysfs_device->path); dbg("sysfs_device->bus_id='%s'", sysfs_device->bus_id); - dbg("sysfs_device->bus='%s'", sysfs_device->bus); } } @@ -742,7 +741,6 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d dbg("found devices device: path='%s', bus_id='%s', bus='%s'", sysfs_device->path, sysfs_device->bus_id, sysfs_device->bus); strfieldcpy(udev->bus_id, sysfs_device->bus_id); - strfieldcpy(udev->bus, sysfs_device->bus); } strfieldcpy(udev->kernel_name, class_dev->name); diff --git a/udev.c b/udev.c index 958fa4eb0..847cc5dad 100644 --- a/udev.c +++ b/udev.c @@ -119,7 +119,7 @@ int main(int argc, char *argv[], char *envp[]) /* trigger timeout to interrupt blocking syscalls */ alarm(ALARM_TIMEOUT); - udev_set_values(&udev, devpath, subsystem, action); + udev_init_device(&udev, devpath, subsystem); if (strstr(argv[0], "udevstart") || (argv[1] != NULL && strstr(argv[1], "udevstart"))) { dbg("udevstart"); diff --git a/udev.h b/udev.h index ace843f0a..2c5270a4c 100644 --- a/udev.h +++ b/udev.h @@ -50,7 +50,6 @@ struct udevice { char devpath[DEVPATH_SIZE]; char subsystem[SUBSYSTEM_SIZE]; - char action[ACTION_SIZE]; char name[NAME_SIZE]; char owner[OWNER_SIZE]; char group[GROUP_SIZE]; @@ -65,7 +64,6 @@ struct udevice { char config_file[NAME_SIZE]; long config_uptime; char bus_id[SYSFS_NAME_LEN]; - char bus[SYSFS_NAME_LEN]; char program_result[NAME_SIZE]; char kernel_number[NAME_SIZE]; char kernel_name[NAME_SIZE]; diff --git a/udev_start.c b/udev_start.c index 1a86163cd..8c7a06b5a 100644 --- a/udev_start.c +++ b/udev_start.c @@ -105,7 +105,7 @@ static int add_device(char *devpath, char *subsystem) return -ENODEV; } - udev_set_values(&udev, devpath, subsystem, "add"); + udev_init_device(&udev, devpath, subsystem); udev_add_device(&udev, class_dev); /* run dev.d/ scripts if we created a node or changed a netif name */ diff --git a/udev_utils.c b/udev_utils.c index bdf0233e3..aa5c75f74 100644 --- a/udev_utils.c +++ b/udev_utils.c @@ -36,8 +36,7 @@ #include "list.h" -void udev_set_values(struct udevice *udev, const char* devpath, - const char *subsystem, const char* action) +void udev_init_device(struct udevice *udev, const char* devpath, const char *subsystem) { memset(udev, 0x00, sizeof(struct udevice)); @@ -45,8 +44,6 @@ void udev_set_values(struct udevice *udev, const char* devpath, strfieldcpy(udev->devpath, devpath); if (subsystem) strfieldcpy(udev->subsystem, subsystem); - if (action) - strfieldcpy(udev->action, action); if (strcmp(udev->subsystem, "block") == 0) udev->type = 'b'; diff --git a/udev_utils.h b/udev_utils.h index b9b0fda67..e36255f52 100644 --- a/udev_utils.h +++ b/udev_utils.h @@ -76,8 +76,7 @@ do { \ # define asmlinkage /* nothing */ #endif -extern void udev_set_values(struct udevice *udev, const char* devpath, - const char *subsystem, const char* action); +extern void udev_init_device(struct udevice *udev, const char* devpath, const char *subsystem); extern int kernel_release_satisfactory(int version, int patchlevel, int sublevel); extern int create_path(const char *path); extern int file_map(const char *filename, char **buf, size_t *bufsize); diff --git a/udevtest.c b/udevtest.c index 9cc23f0ac..38e2bb756 100644 --- a/udevtest.c +++ b/udevtest.c @@ -97,7 +97,7 @@ int main(int argc, char *argv[], char *envp[]) subsystem = argv[2]; /* fill in values and test_run flag*/ - udev_set_values(&udev, devpath, subsystem, "add"); + udev_init_device(&udev, devpath, subsystem); /* open the device */ snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, udev.devpath);