thunderbolt: Use str_enabled_disabled() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 8 Oct 2022 19:45:01 +0000 (22:45 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Sun, 23 Oct 2022 06:46:05 +0000 (09:46 +0300)
Use str_enabled_disabled() helper instead of open coding the same.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c
drivers/thunderbolt/xdomain.c

index 60da5c23ccaf437c568066620121219f470aa69b..363d712aa364347c25e361f8b79bca470be47a8a 100644 (file)
@@ -8,12 +8,13 @@
 
 #include <linux/delay.h>
 #include <linux/idr.h>
+#include <linux/module.h>
 #include <linux/nvmem-provider.h>
 #include <linux/pm_runtime.h>
 #include <linux/sched/signal.h>
 #include <linux/sizes.h>
 #include <linux/slab.h>
-#include <linux/module.h>
+#include <linux/string_helpers.h>
 
 #include "tb.h"
 
@@ -644,7 +645,7 @@ static int __tb_port_enable(struct tb_port *port, bool enable)
        if (ret)
                return ret;
 
-       tb_port_dbg(port, "lane %sabled\n", enable ? "en" : "dis");
+       tb_port_dbg(port, "lane %s\n", str_enabled_disabled(enable));
        return 0;
 }
 
index f00b2f62d8e3c92841ba8bb6276d583724e7c31d..ddd8fd2d06f8654d32fbf97daaa2a3543ab9830a 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <linux/prandom.h>
+#include <linux/string_helpers.h>
 #include <linux/utsname.h>
 #include <linux/uuid.h>
 #include <linux/workqueue.h>
@@ -1344,7 +1345,7 @@ static int tb_xdomain_bond_lanes_uuid_high(struct tb_xdomain *xd)
        tb_port_update_credits(port);
        tb_xdomain_update_link_attributes(xd);
 
-       dev_dbg(&xd->dev, "lane bonding %sabled\n", width == 2 ? "en" : "dis");
+       dev_dbg(&xd->dev, "lane bonding %s\n", str_enabled_disabled(width == 2));
        return 0;
 }