• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 24373971178

14 Apr 2026 12:08AM UTC coverage: 72.291% (+0.2%) from 72.107%
24373971178

push

github

web-flow
hwdb: Add extended SteelSeries Arctis headset device support (#41628)

Add USB device IDs for additional SteelSeries Arctis headset models to
the sound card hardware database.

Newly added device IDs:

- Arctis Nova 7x v2 (22AD)
- Arctis Nova 7 Diablo IV (22A9)
- Arctis Nova 7X (22A4)
- Arctis Nova 7X (22A5)
- Arctis Nova 7P V2 (22A7)

321138 of 444232 relevant lines covered (72.29%)

1277257.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.36
/src/basic/device-nodes.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <stdio.h>
4
#include <string.h>
5
#include <sys/stat.h>
6

7
#include "device-nodes.h"
8
#include "path-util.h"
9
#include "stat-util.h"
10
#include "stdio-util.h"
11
#include "string-util.h"
12
#include "utf8.h"
13

14
int allow_listed_char_for_devnode(char c, const char *additional) {
8,375,139✔
15
        return
8,375,139✔
16
                ascii_isdigit(c) ||
14,926,590✔
17
                ascii_isalpha(c) ||
6,551,451✔
18
                strchr("#+-.:=@_", c) ||
10,022,261✔
19
                (additional && strchr(additional, c));
421,605✔
20
}
21

22
int encode_devnode_name(const char *str, char *str_enc, size_t len) {
8,985✔
23
        size_t i, j;
8,985✔
24

25
        if (!str || !str_enc)
8,985✔
26
                return -EINVAL;
27

28
        for (i = 0, j = 0; str[i] != '\0'; i++) {
116,859✔
29
                int seqlen;
107,874✔
30

31
                seqlen = utf8_encoded_valid_unichar(str + i, SIZE_MAX);
107,874✔
32
                if (seqlen > 1) {
107,874✔
33

34
                        if (len-j < (size_t) seqlen)
4✔
35
                                return -EINVAL;
36

37
                        memcpy(&str_enc[j], &str[i], seqlen);
4✔
38
                        j += seqlen;
4✔
39
                        i += (seqlen-1);
4✔
40

41
                } else if (str[i] == '\\' || !allow_listed_char_for_devnode(str[i], NULL)) {
107,870✔
42

43
                        if (len-j < 5)
39,071✔
44
                                return -EINVAL;
45

46
                        assert_se(snprintf_ok(&str_enc[j], 5, "\\x%02x", (unsigned char) str[i]));
39,071✔
47
                        j += 4;
39,071✔
48

49
                } else {
50
                        if (len-j < 1)
68,799✔
51
                                return -EINVAL;
52

53
                        str_enc[j] = str[i];
68,799✔
54
                        j++;
68,799✔
55
                }
56
        }
57

58
        if (len-j < 1)
8,985✔
59
                return -EINVAL;
60

61
        str_enc[j] = '\0';
8,985✔
62
        return 0;
8,985✔
63
}
64

65
int devnode_same(const char *a, const char *b) {
×
66
        struct stat sa, sb;
×
67
        int r;
×
68

69
        assert(a);
×
70
        assert(b);
×
71

72
        if (!valid_device_node_path(a) || !valid_device_node_path(b))
×
73
                return -EINVAL;
×
74

75
        if (stat(a, &sa) < 0)
×
76
                return -errno;
×
77
        r = stat_verify_device_node(&sa);
×
78
        if (r < 0)
×
79
                return r;
80

81
        if (stat(b, &sb) < 0)
×
82
                return -errno;
×
83
        r = stat_verify_device_node(&sb);
×
84
        if (r < 0)
×
85
                return r;
86

87
        if (((sa.st_mode ^ sb.st_mode) & S_IFMT) != 0) /* both inode same device node type? */
×
88
                return false;
89

90
        return sa.st_rdev == sb.st_rdev;
×
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc