coresight: Add explicit member initializers to coresight_dev_type
authorJames Clark <james.clark@arm.com>
Mon, 29 Jan 2024 15:40:40 +0000 (15:40 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 12 Feb 2024 10:21:38 +0000 (10:21 +0000)
These could potentially become wrong silently if the enum is changed,
so explicitly initialize them.

Signed-off-by: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20240129154050.569566-10-james.clark@arm.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
drivers/hwtracing/coresight/coresight-sysfs.c

index 5992f2c2200a401ab1e12ec862d6e6d09cedc621..fa52297c73d2fe01c47dd7db124e3904949d92c3 100644 (file)
@@ -378,22 +378,22 @@ static struct attribute *coresight_source_attrs[] = {
 ATTRIBUTE_GROUPS(coresight_source);
 
 struct device_type coresight_dev_type[] = {
-       {
+       [CORESIGHT_DEV_TYPE_SINK] = {
                .name = "sink",
                .groups = coresight_sink_groups,
        },
-       {
+       [CORESIGHT_DEV_TYPE_LINK] = {
                .name = "link",
        },
-       {
+       [CORESIGHT_DEV_TYPE_LINKSINK] = {
                .name = "linksink",
                .groups = coresight_sink_groups,
        },
-       {
+       [CORESIGHT_DEV_TYPE_SOURCE] = {
                .name = "source",
                .groups = coresight_source_groups,
        },
-       {
+       [CORESIGHT_DEV_TYPE_HELPER] = {
                .name = "helper",
        }
 };