X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=libsysfs%2Fsysfs_device.c;h=d1c5b321f03133fca4cbca2f7301b7ab6dc1e1c1;hp=7087730d5f16d7a830c658d3ef22be8b44dd9c77;hb=197178360f5c4253aeb743b32224125e58e2fd5d;hpb=d4b611430083674ee1d3aa19b87c9894ac3e39d8 diff --git a/libsysfs/sysfs_device.c b/libsysfs/sysfs_device.c index 7087730d5..d1c5b321f 100644 --- a/libsysfs/sysfs_device.c +++ b/libsysfs/sysfs_device.c @@ -38,7 +38,6 @@ static int get_dev_driver(struct sysfs_device *dev) errno = EINVAL; return -1; } - memset(path, 0, SYSFS_PATH_MAX); memset(devpath, 0, SYSFS_PATH_MAX); safestrcpymax(path, dev->path, SYSFS_PATH_MAX); @@ -53,9 +52,9 @@ static int get_dev_driver(struct sysfs_device *dev) } /* - * Devices on on earlier kernels do not have the "driver" link. + * Devices on earlier kernels do not have the "driver" link. * Look it up in the bus directory. - */ + */ if (dev->bus[0] == '\0') return -1; memset(path, 0, SYSFS_PATH_MAX); @@ -81,7 +80,7 @@ static int get_dev_driver(struct sysfs_device *dev) safestrcat(devpath, drv); safestrcat(devpath, "/"); safestrcat(devpath, dev->bus_id); - if (sysfs_path_is_link(devpath) == 0) { + if (!sysfs_path_is_link(devpath)) { safestrcpy(dev->driver_name, drv); sysfs_close_list(drvlist); return 0; @@ -149,7 +148,7 @@ int sysfs_get_device_bus(struct sysfs_device *dev) safestrcat(path, SYSFS_DEVICES_NAME); safestrcat(path, "/"); safestrcat(path, dev->bus_id); - if ((sysfs_path_is_link(path)) == 0) { + if (!sysfs_path_is_link(path)) { memset(target, 0, SYSFS_PATH_MAX); if (sysfs_get_link(path, target, SYSFS_PATH_MAX)) {