]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
ras-events: fix -d option to work again
authorTomohiro Misono <misono.tomohiro@fujitsu.com>
Thu, 8 Aug 2024 09:21:17 +0000 (09:21 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 18 Nov 2024 12:21:29 +0000 (13:21 +0100)
It seems commit 3e9a59a184ca("Add dynamic switch of ras events support.")
inadvertedly introduced the change to ignore -d option.
Fix this so that -d will disable all trace events at once like before.

Signed-off-by: Tomohiro Misono <misono.tomohiro@fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c

index b6e80b2927cd1ba0e8aacb0fb8f56e5e79db24c9..fb405ca4192a069b4472bd4cc377fc6b3d3f3798 100644 (file)
@@ -193,7 +193,8 @@ static int __toggle_ras_mc_event(struct ras_events *ras,
        int fd, rc;
        char fname[MAX_PATH + 1];
 
-       enable = is_disabled_event(group, event) ? 0 : 1;
+       if (enable)
+               enable = is_disabled_event(group, event) ? 0 : 1;
 
        snprintf(fname, sizeof(fname), "%s%s:%s\n",
                 enable ? "" : "!",