[PATCH] HID: Intel-thc-hid: Intel-thc: Use str_true_false() helper

liu.xuemei1@zte.com.cn posted 1 patch 2 months, 2 weeks ago
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] HID: Intel-thc-hid: Intel-thc: Use str_true_false() helper
Posted by liu.xuemei1@zte.com.cn 2 months, 2 weeks ago
From: Liu Song <liu.song13@zte.com.cn>

Remove hard-coded strings by using the str_true_false() helper function.

Signed-off-by: Liu Song <liu.song13@zte.com.cn>
---
 drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
index 6f2263869b20..2b794bb481a0 100644
--- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
+++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
@@ -4,6 +4,7 @@
 #include <linux/bitfield.h>
 #include <linux/math.h>
 #include <linux/regmap.h>
+#include <linux/string_choices.h>

 #include "intel-thc-dev.h"
 #include "intel-thc-hw.h"
@@ -664,7 +665,7 @@ int thc_interrupt_quiesce(const struct thc_device *dev, bool int_quiesce)
 	if (ret) {
 		dev_err_once(dev->dev,
 			     "Timeout while waiting THC idle, target quiesce state = %s\n",
-			     int_quiesce ? "true" : "false");
+			     str_true_false(int_quiesce));
 		return ret;
 	}

-- 
2.27.0
Re: [PATCH] HID: Intel-thc-hid: Intel-thc: Use str_true_false() helper
Posted by Jiri Kosina 1 month, 3 weeks ago
On Thu, 24 Jul 2025, liu.xuemei1@zte.com.cn wrote:

> From: Liu Song <liu.song13@zte.com.cn>
> 
> Remove hard-coded strings by using the str_true_false() helper function.
> 
> Signed-off-by: Liu Song <liu.song13@zte.com.cn>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs
RE: [PATCH] HID: Intel-thc-hid: Intel-thc: Use str_true_false() helper
Posted by Xu, Even 2 months, 2 weeks ago

> -----Original Message-----
> From: liu.xuemei1@zte.com.cn <liu.xuemei1@zte.com.cn>
> Sent: Thursday, July 24, 2025 10:36 AM
> To: jikos@kernel.org; bentiss@kernel.org
> Cc: Xu, Even <even.xu@intel.com>; Sun, Xinpeng <xinpeng.sun@intel.com>;
> srinivas.pandruvada@linux.intel.com; liu.song13@zte.com.cn; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] HID: Intel-thc-hid: Intel-thc: Use str_true_false() helper
> 
> From: Liu Song <liu.song13@zte.com.cn>
> 
> Remove hard-coded strings by using the str_true_false() helper function.
> 
> Signed-off-by: Liu Song <liu.song13@zte.com.cn>
> ---
>  drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-
> thc-hid/intel-thc/intel-thc-dev.c
> index 6f2263869b20..2b794bb481a0 100644
> --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
> +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
> @@ -4,6 +4,7 @@
>  #include <linux/bitfield.h>
>  #include <linux/math.h>
>  #include <linux/regmap.h>
> +#include <linux/string_choices.h>
> 
>  #include "intel-thc-dev.h"
>  #include "intel-thc-hw.h"
> @@ -664,7 +665,7 @@ int thc_interrupt_quiesce(const struct thc_device *dev,
> bool int_quiesce)
>  	if (ret) {
>  		dev_err_once(dev->dev,
>  			     "Timeout while waiting THC idle, target quiesce state
> = %s\n",
> -			     int_quiesce ? "true" : "false");
> +			     str_true_false(int_quiesce));
>  		return ret;
>  	}
> 

Thanks for the patch! Looks good to me!

Reviewed-by: Even Xu <even.xu@intel.com>

> --
> 2.27.0