tree-wide: drop unnecessary initializations
This commit is contained in:
parent
2c740afd16
commit
c679e12af1
|
@ -305,7 +305,7 @@ int manager_process_button_device(Manager *m, sd_device *d) {
|
|||
button_free(b);
|
||||
|
||||
} else {
|
||||
const char *sn = NULL;
|
||||
const char *sn;
|
||||
|
||||
r = manager_add_button(m, sysname, &b);
|
||||
if (r < 0)
|
||||
|
|
|
@ -268,17 +268,18 @@ static DeviceType detect_device_type(sd_device *dev) {
|
|||
|
||||
static int session_device_verify(SessionDevice *sd) {
|
||||
_cleanup_(sd_device_unrefp) sd_device *p = NULL;
|
||||
const char *sp, *node;
|
||||
sd_device *dev;
|
||||
const char *sp = NULL, *node;
|
||||
int r;
|
||||
|
||||
if (sd_device_new_from_devnum(&p, 'c', sd->dev) < 0)
|
||||
return -ENODEV;
|
||||
r = sd_device_new_from_devnum(&p, 'c', sd->dev);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
dev = p;
|
||||
|
||||
(void) sd_device_get_syspath(dev, &sp);
|
||||
if (sd_device_get_devname(dev, &node) < 0)
|
||||
if (sd_device_get_syspath(dev, &sp) < 0 ||
|
||||
sd_device_get_devname(dev, &node) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* detect device type so we can find the correct sysfs parent */
|
||||
|
|
|
@ -40,7 +40,7 @@ static int show_sysfs_one(
|
|||
max_width = n_columns;
|
||||
|
||||
while (*i_dev < n_dev) {
|
||||
const char *sysfs, *sn, *name = NULL, *subsystem = NULL, *sysname = NULL;
|
||||
const char *sysfs, *sn, *name = NULL, *subsystem, *sysname;
|
||||
_cleanup_free_ char *k = NULL, *l = NULL;
|
||||
size_t lookahead;
|
||||
bool is_master;
|
||||
|
@ -53,7 +53,10 @@ static int show_sysfs_one(
|
|||
sn = "seat0";
|
||||
|
||||
/* Explicitly also check for tag 'seat' here */
|
||||
if (!streq(seat, sn) || sd_device_has_tag(dev_list[*i_dev], "seat") <= 0) {
|
||||
if (!streq(seat, sn) ||
|
||||
sd_device_has_tag(dev_list[*i_dev], "seat") <= 0 ||
|
||||
sd_device_get_subsystem(dev_list[*i_dev], &subsystem) < 0 ||
|
||||
sd_device_get_sysname(dev_list[*i_dev], &sysname) < 0) {
|
||||
(*i_dev)++;
|
||||
continue;
|
||||
}
|
||||
|
@ -63,9 +66,6 @@ static int show_sysfs_one(
|
|||
if (sd_device_get_sysattr_value(dev_list[*i_dev], "name", &name) < 0)
|
||||
(void) sd_device_get_sysattr_value(dev_list[*i_dev], "id", &name);
|
||||
|
||||
(void) sd_device_get_subsystem(dev_list[*i_dev], &subsystem);
|
||||
(void) sd_device_get_sysname(dev_list[*i_dev], &sysname);
|
||||
|
||||
/* Look if there's more coming after this */
|
||||
for (lookahead = *i_dev + 1; lookahead < n_dev; lookahead++) {
|
||||
const char *lookahead_sysfs;
|
||||
|
|
Loading…
Reference in a new issue