From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Zhenyu Wang <zhenyuw.linux@gmail.com>,
Zhi Wang <zhi.wang.linux@gmail.com>,
"open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS"
<intel-gfx@lists.freedesktop.org>,
"open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS"
<intel-xe@lists.freedesktop.org>,
"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
open list <linux-kernel@vger.kernel.org>
Cc: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Subject: Re: [PATCH] drm/i915: use string choice helpers
Date: Fri, 18 Sep 2026 11:07:21 +0300 [thread overview]
Message-ID: <b5576d0e503315036500145888d712e75df42f7e@intel.com> (raw)
In-Reply-To: <20260918042325.17700-1-lalitshankarch@gmail.com>
On Fri, 18 Sep 2026, Lalit Shankar Chowdhury <lalitshankarch@gmail.com> wrote:
> Prefer the str_high_low() and str_read_write() helper functions
> over ternary operators with hardcoded strings.
>
> No functional changes.
>
> Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cx0_phy.c | 5 +++--
> drivers/gpu/drm/i915/gvt/aperture_gm.c | 4 +++-
> drivers/gpu/drm/i915/vlv_iosf_sb.c | 6 ++++--
> 3 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> index dbebd7210848..b83f0afaa9b5 100644
> --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> @@ -5,6 +5,7 @@
>
> #include <linux/log2.h>
> #include <linux/math64.h>
> +#include <linux/string_choices.h>
>
> #include <drm/drm_print.h>
>
> @@ -189,7 +190,7 @@ int intel_cx0_wait_for_ack(struct intel_encoder *encoder,
> drm_dbg_kms(display->drm,
> "PHY %c Error occurred during %s command. Status: 0x%x\n",
> phy_name(phy),
> - command == XELPDP_PORT_P2M_COMMAND_READ_ACK ? "read" : "write", *val);
> + str_read_write(command == XELPDP_PORT_P2M_COMMAND_READ_ACK), *val);
> intel_cx0_bus_reset(encoder, lane);
> return -EINVAL;
> }
> @@ -198,7 +199,7 @@ int intel_cx0_wait_for_ack(struct intel_encoder *encoder,
> drm_dbg_kms(display->drm,
> "PHY %c Not a %s response. MSGBUS Status: 0x%x.\n",
> phy_name(phy),
> - command == XELPDP_PORT_P2M_COMMAND_READ_ACK ? "read" : "write", *val);
> + str_read_write(command == XELPDP_PORT_P2M_COMMAND_READ_ACK), *val);
> intel_cx0_bus_reset(encoder, lane);
> return -EINVAL;
> }
> diff --git a/drivers/gpu/drm/i915/gvt/aperture_gm.c b/drivers/gpu/drm/i915/gvt/aperture_gm.c
> index 253b41789be9..794fb50e48dd 100644
> --- a/drivers/gpu/drm/i915/gvt/aperture_gm.c
> +++ b/drivers/gpu/drm/i915/gvt/aperture_gm.c
> @@ -34,6 +34,8 @@
> *
> */
>
> +#include <linux/string_choices.h>
> +
> #include <drm/drm_print.h>
>
> #include "gt/intel_ggtt_fencing.h"
> @@ -76,7 +78,7 @@ static int alloc_gm(struct intel_vgpu *vgpu, bool high_gm)
> mutex_unlock(>->ggtt->vm.mutex);
> if (ret)
> gvt_err("fail to alloc %s gm space from host\n",
> - high_gm ? "high" : "low");
> + str_high_low(high_gm));
>
> return ret;
> }
> diff --git a/drivers/gpu/drm/i915/vlv_iosf_sb.c b/drivers/gpu/drm/i915/vlv_iosf_sb.c
> index 1f0332b4ad0d..fede1735bc08 100644
> --- a/drivers/gpu/drm/i915/vlv_iosf_sb.c
> +++ b/drivers/gpu/drm/i915/vlv_iosf_sb.c
> @@ -3,6 +3,8 @@
> * Copyright © 2013-2021 Intel Corporation
> */
>
> +#include <linux/string_choices.h>
> +
> #include <drm/drm_print.h>
> #include <drm/intel/display_parent_interface.h>
>
> @@ -101,7 +103,7 @@ static int vlv_sideband_rw(struct drm_i915_private *i915,
> VLV_IOSF_DOORBELL_REQ, IOSF_SB_BUSY, 0,
> 5)) {
> drm_dbg(&i915->drm, "IOSF sideband idle wait (%s) timed out\n",
> - is_read ? "read" : "write");
> + str_read_write(is_read));
> return -EAGAIN;
> }
>
> @@ -125,7 +127,7 @@ static int vlv_sideband_rw(struct drm_i915_private *i915,
> err = 0;
> } else {
> drm_dbg(&i915->drm, "IOSF sideband finish wait (%s) timed out\n",
> - is_read ? "read" : "write");
> + str_read_write(is_read));
> err = -ETIMEDOUT;
> }
--
Jani Nikula, Intel
prev parent reply other threads:[~2026-09-18 8:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 4:23 Lalit Shankar Chowdhury
2026-09-18 8:07 ` Jani Nikula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5576d0e503315036500145888d712e75df42f7e@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=lalitshankarch@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=tursulin@ursulin.net \
--cc=zhenyuw.linux@gmail.com \
--cc=zhi.wang.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®