]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: update iteration logic for the non-standard error decoding functions
authorShiju Jose <shiju.jose@huawei.com>
Mon, 17 Jun 2019 14:28:49 +0000 (15:28 +0100)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 18:38:37 +0000 (15:38 -0300)
This patch updates the iteration logic for the non-standard
error decoding functions.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
non-standard-hisi_hip07.c
ras-non-standard-handler.c
ras-non-standard-handler.h

index 19a5c479f148e3a1050c834c71af6056d42eeaba..bb2576eb8e241899f8a75b31827e3456af11c11f 100644 (file)
@@ -134,11 +134,11 @@ struct ras_ns_dec_tab hisi_ns_dec_tab[] = {
                .sec_type = "fbc2d923ea7a453dab132949f5af9e53",
                .decode = decode_hip07_hns_error,
        },
+       { /* sentinel */ }
 };
 
 __attribute__((constructor))
 static void hip07_init(void)
 {
-       hisi_ns_dec_tab[0].len = ARRAY_SIZE(hisi_ns_dec_tab);
        register_ns_dec_tab(hisi_ns_dec_tab);
 }
index d343a2ab2eb16d1a1f8fbc0856bbdd0b877ef24f..392bb27af2f9b631acc90ae6707ffe235c56e58e 100644 (file)
@@ -163,7 +163,7 @@ int ras_non_standard_event_handler(struct trace_seq *s,
 
        for (count = 0; count < dec_tab_count && !dec_done; count++) {
                dec_tab = ns_dec_tab[count];
-               for (i = 0; i < dec_tab[0].len; i++) {
+               for (i = 0; dec_tab[i].decode; i++) {
                        if (uuid_le_cmp(ev.sec_type,
                                        dec_tab[i].sec_type) == 0) {
                                dec_tab[i].decode(s, ev.error);
index b9e9fb10974ea7ab204e2404fd609c8ea0d67a35..b2c9743885cfedf6fd0a2790cab15e52abb4eced 100644 (file)
@@ -23,7 +23,6 @@
 typedef struct ras_ns_dec_tab {
        const char *sec_type;
        int (*decode)(struct trace_seq *s, const void *err);
-       size_t len;
 } *p_ns_dec_tab;
 
 int ras_non_standard_event_handler(struct trace_seq *s,