diff mbox series

[linux-next] drm/i915/ddi: use string choice helpers

Message ID 20241007173300.83902-1-prosunofficial@gmail.com (mailing list archive)
State New, archived
Headers show
Series [linux-next] drm/i915/ddi: use string choice helpers | expand

Commit Message

R Sundar Oct. 7, 2024, 5:33 p.m. UTC
Use str_enabled_disabled string helpers for better readability and to
fix cocci warning.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202410071601.TFpXoqgW-lkp@intel.com/
Signed-off-by: R Sundar <prosunofficial@gmail.com>
---

Reported in linux repo:

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/display/intel_ddi.c:2225:7-13: opportunity for str_enabled_disabled(enable)

vim +2225 drivers/gpu/drm/i915/display/intel_ddi.c

compile tested only.

 drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula Oct. 22, 2024, 10:26 a.m. UTC | #1
On Mon, 07 Oct 2024, R Sundar <prosunofficial@gmail.com> wrote:
> Use str_enabled_disabled string helpers for better readability and to
> fix cocci warning.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Julia Lawall <julia.lawall@inria.fr>
> Closes: https://lore.kernel.org/r/202410071601.TFpXoqgW-lkp@intel.com/
> Signed-off-by: R Sundar <prosunofficial@gmail.com>

Pushed to drm-intel-next, thanks for the patch.

BR,
Jani.

> ---
>
> Reported in linux repo:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>
> cocci warnings: (new ones prefixed by >>)
>>> drivers/gpu/drm/i915/display/intel_ddi.c:2225:7-13: opportunity for str_enabled_disabled(enable)
>
> vim +2225 drivers/gpu/drm/i915/display/intel_ddi.c
>
> compile tested only.
>
>  drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index fe1ded6707f9..ff4c633c8546 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2236,7 +2236,7 @@ static void intel_dp_sink_set_fec_ready(struct intel_dp *intel_dp,
>  	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_FEC_CONFIGURATION,
>  			       enable ? DP_FEC_READY : 0) <= 0)
>  		drm_dbg_kms(display->drm, "Failed to set FEC_READY to %s in the sink\n",
> -			    enable ? "enabled" : "disabled");
> +			    str_enabled_disabled(enable));
>  
>  	if (enable &&
>  	    drm_dp_dpcd_writeb(&intel_dp->aux, DP_FEC_STATUS,
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index fe1ded6707f9..ff4c633c8546 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2236,7 +2236,7 @@  static void intel_dp_sink_set_fec_ready(struct intel_dp *intel_dp,
 	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_FEC_CONFIGURATION,
 			       enable ? DP_FEC_READY : 0) <= 0)
 		drm_dbg_kms(display->drm, "Failed to set FEC_READY to %s in the sink\n",
-			    enable ? "enabled" : "disabled");
+			    str_enabled_disabled(enable));
 
 	if (enable &&
 	    drm_dp_dpcd_writeb(&intel_dp->aux, DP_FEC_STATUS,