1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

[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().
This commit is contained in:
kay.sievers@vrfy.org 2004-11-28 14:01:43 +01:00 committed by Greg KH
parent 4497fcbf71
commit 45a7b668ec
7 changed files with 5 additions and 13 deletions

View File

@ -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);

2
udev.c
View File

@ -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");

2
udev.h
View File

@ -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];

View File

@ -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 */

View File

@ -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';

View File

@ -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);

View File

@ -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);