Commit 972aa1a1 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/amd/display: Use str_yes_no()

Remove the local yesno() implementation and adopt the str_yes_no() from
linux/string_helpers.h.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220126093951.1470898-8-lucas.demarchi@intel.com
parent ea4692c7
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* *
*/ */
#include <linux/string_helpers.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include "dc.h" #include "dc.h"
...@@ -49,11 +50,6 @@ struct dmub_debugfs_trace_entry { ...@@ -49,11 +50,6 @@ struct dmub_debugfs_trace_entry {
uint32_t param1; uint32_t param1;
}; };
static inline const char *yesno(bool v)
{
return v ? "yes" : "no";
}
/* parse_write_buffer_into_params - Helper function to parse debugfs write buffer into an array /* parse_write_buffer_into_params - Helper function to parse debugfs write buffer into an array
* *
* Function takes in attributes passed to debugfs write entry * Function takes in attributes passed to debugfs write entry
...@@ -853,12 +849,12 @@ static int psr_capability_show(struct seq_file *m, void *data) ...@@ -853,12 +849,12 @@ static int psr_capability_show(struct seq_file *m, void *data)
if (!(link->connector_signal & SIGNAL_TYPE_EDP)) if (!(link->connector_signal & SIGNAL_TYPE_EDP))
return -ENODEV; return -ENODEV;
seq_printf(m, "Sink support: %s", yesno(link->dpcd_caps.psr_caps.psr_version != 0)); seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_caps.psr_version != 0));
if (link->dpcd_caps.psr_caps.psr_version) if (link->dpcd_caps.psr_caps.psr_version)
seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_caps.psr_version); seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_caps.psr_version);
seq_puts(m, "\n"); seq_puts(m, "\n");
seq_printf(m, "Driver support: %s", yesno(link->psr_settings.psr_feature_enabled)); seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled));
if (link->psr_settings.psr_version) if (link->psr_settings.psr_version)
seq_printf(m, " [0x%02x]", link->psr_settings.psr_version); seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
seq_puts(m, "\n"); seq_puts(m, "\n");
...@@ -1207,8 +1203,8 @@ static int dp_dsc_fec_support_show(struct seq_file *m, void *data) ...@@ -1207,8 +1203,8 @@ static int dp_dsc_fec_support_show(struct seq_file *m, void *data)
drm_modeset_drop_locks(&ctx); drm_modeset_drop_locks(&ctx);
drm_modeset_acquire_fini(&ctx); drm_modeset_acquire_fini(&ctx);
seq_printf(m, "FEC_Sink_Support: %s\n", yesno(is_fec_supported)); seq_printf(m, "FEC_Sink_Support: %s\n", str_yes_no(is_fec_supported));
seq_printf(m, "DSC_Sink_Support: %s\n", yesno(is_dsc_supported)); seq_printf(m, "DSC_Sink_Support: %s\n", str_yes_no(is_dsc_supported));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment