Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220126093951.1470898-8-lucas.demarchi@intel.com

+5 -9
+5 -9
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
··· 23 23 * 24 24 */ 25 25 26 + #include <linux/string_helpers.h> 26 27 #include <linux/uaccess.h> 27 28 28 29 #include "dc.h" ··· 49 48 uint32_t param0; 50 49 uint32_t param1; 51 50 }; 52 - 53 - static inline const char *yesno(bool v) 54 - { 55 - return v ? "yes" : "no"; 56 - } 57 51 58 52 /* parse_write_buffer_into_params - Helper function to parse debugfs write buffer into an array 59 53 * ··· 849 853 if (!(link->connector_signal & SIGNAL_TYPE_EDP)) 850 854 return -ENODEV; 851 855 852 - seq_printf(m, "Sink support: %s", yesno(link->dpcd_caps.psr_caps.psr_version != 0)); 856 + seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_caps.psr_version != 0)); 853 857 if (link->dpcd_caps.psr_caps.psr_version) 854 858 seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_caps.psr_version); 855 859 seq_puts(m, "\n"); 856 860 857 - seq_printf(m, "Driver support: %s", yesno(link->psr_settings.psr_feature_enabled)); 861 + seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled)); 858 862 if (link->psr_settings.psr_version) 859 863 seq_printf(m, " [0x%02x]", link->psr_settings.psr_version); 860 864 seq_puts(m, "\n"); ··· 1203 1207 drm_modeset_drop_locks(&ctx); 1204 1208 drm_modeset_acquire_fini(&ctx); 1205 1209 1206 - seq_printf(m, "FEC_Sink_Support: %s\n", yesno(is_fec_supported)); 1207 - seq_printf(m, "DSC_Sink_Support: %s\n", yesno(is_dsc_supported)); 1210 + seq_printf(m, "FEC_Sink_Support: %s\n", str_yes_no(is_fec_supported)); 1211 + seq_printf(m, "DSC_Sink_Support: %s\n", str_yes_no(is_dsc_supported)); 1208 1212 1209 1213 return ret; 1210 1214 }