const char *syspath, *key = NULL, *value = NULL, *major = NULL, *minor = NULL;
char *path;
size_t uevent_len;
- unsigned i;
int r;
enum {
device->uevent_loaded = true;
- for (i = 0; i < uevent_len; i++)
+ for (size_t i = 0; i < uevent_len; i++)
switch (state) {
case PRE_KEY:
if (!strchr(NEWLINE, uevent[i])) {
pos = strrchr(subdir, '/');
if (!pos || pos < subdir + 2)
- break;
+ return -ENODEV;
*pos = '\0';
return 0;
}
-
- return -ENODEV;
}
_public_ int sd_device_get_parent(sd_device *child, sd_device **ret) {
int device_read_db_internal_filename(sd_device *device, const char *filename) {
_cleanup_free_ char *db = NULL;
const char *value;
- size_t db_len, i;
+ size_t db_len;
char key;
int r;
device->db_loaded = true;
- for (i = 0; i < db_len; i++) {
+ for (size_t i = 0; i < db_len; i++) {
switch (state) {
case PRE_KEY:
if (!strchr(NEWLINE, db[i])) {
db[i] = '\0';
r = handle_db_line(device, key, value);
if (r < 0)
- log_device_debug_errno(device, r, "sd-device: Failed to handle db entry '%c:%s', ignoring: %m", key, value);
+ log_device_debug_errno(device, r, "sd-device: Failed to handle db entry '%c:%s', ignoring: %m",
+ key, value);
state = PRE_KEY;
}