• 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

88.68
/src/shared/install-printf.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include "alloc-util.h"
4
#include "install.h"
5
#include "install-printf.h"
6
#include "specifier.h"
7
#include "string-util.h"
8
#include "unit-name.h"
9

10
static int specifier_prefix_and_instance(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
2✔
11
        const InstallInfo *i = ASSERT_PTR(userdata);
2✔
12
        _cleanup_free_ char *prefix = NULL;
2✔
13
        int r;
2✔
14

15
        assert(ret);
2✔
16

17
        r = unit_name_to_prefix_and_instance(i->name, &prefix);
2✔
18
        if (r < 0)
2✔
19
                return r;
20

21
        if (endswith(prefix, "@") && i->default_instance) {
2✔
22
                char *ans;
×
23

24
                ans = strjoin(prefix, i->default_instance);
×
25
                if (!ans)
×
26
                        return -ENOMEM;
27
                *ret = ans;
×
28
        } else
29
                *ret = TAKE_PTR(prefix);
2✔
30

31
        return 0;
32
}
33

34
static int specifier_name(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
2✔
35
        const InstallInfo *i = ASSERT_PTR(userdata);
2✔
36

37
        if (unit_name_is_valid(i->name, UNIT_NAME_TEMPLATE) && i->default_instance)
2✔
38
                return unit_name_replace_instance(i->name, i->default_instance, ret);
×
39

40
        return strdup_to(ret, i->name);
2✔
41
}
42

43
static int specifier_prefix(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
3✔
44
        const InstallInfo *i = ASSERT_PTR(userdata);
3✔
45

46
        return unit_name_to_prefix(i->name, ret);
3✔
47
}
48

49
static int specifier_instance(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
1✔
50
        const InstallInfo *i = ASSERT_PTR(userdata);
1✔
51
        char *instance;
1✔
52
        int r;
1✔
53

54
        assert(ret);
1✔
55

56
        r = unit_name_to_instance(i->name, &instance);
1✔
57
        if (r < 0)
1✔
58
                return r;
1✔
59

60
        if (isempty(instance)) {
1✔
61
                r = free_and_strdup(&instance, strempty(i->default_instance));
2✔
62
                if (r < 0)
1✔
63
                        return r;
64
        }
65

66
        *ret = instance;
1✔
67
        return 0;
1✔
68
}
69

70
static int specifier_last_component(char specifier, const void *data, const char *root, const void *userdata, char **ret) {
1✔
71
        _cleanup_free_ char *prefix = NULL;
1✔
72
        char *dash;
1✔
73
        int r;
1✔
74

75
        assert(ret);
1✔
76

77
        r = specifier_prefix(specifier, data, root, userdata, &prefix);
1✔
78
        if (r < 0)
1✔
79
                return r;
80

81
        dash = strrchr(prefix, '-');
1✔
82
        if (dash)
1✔
83
                return strdup_to(ret, dash + 1);
×
84

85
        *ret = TAKE_PTR(prefix);
1✔
86
        return 0;
1✔
87
}
88

89
int install_name_printf(
1,011✔
90
                RuntimeScope scope,
91
                const InstallInfo *info,
92
                const char *format,
93
                char **ret) {
94
        /* This is similar to unit_name_printf() */
95

96
        const Specifier table[] = {
1,011✔
97
                { 'i', specifier_instance,            NULL },
98
                { 'j', specifier_last_component,      NULL },
99
                { 'n', specifier_name,                NULL },
100
                { 'N', specifier_prefix_and_instance, NULL },
101
                { 'p', specifier_prefix,              NULL },
102

103
                COMMON_SYSTEM_SPECIFIERS,
104

105
                COMMON_CREDS_SPECIFIERS(scope),
1,011✔
106
                {}
107
        };
108

109
        assert(info);
1,011✔
110
        assert(format);
1,011✔
111
        assert(ret);
1,011✔
112

113
        return specifier_printf(format, UNIT_NAME_MAX, table, info->root, info, ret);
1,011✔
114
}
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