From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915/hdcp: fix intel_hdcp_get_repeater_ctl() error return value
Date: Tue, 19 Dec 2023 18:22:24 +0200 [thread overview]
Message-ID: <87cyv2tb5r.fsf@intel.com> (raw)
In-Reply-To: <ZYGSLNMf8y00wFOo@intel.com>
On Tue, 19 Dec 2023, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Tue, Dec 19, 2023 at 12:47:46PM +0200, Jani Nikula wrote:
>> intel_hdcp_get_repeater_ctl() is supposed to return unsigned register
>> contents. Returning negative error values is unexpected, and none of the
>> callers check for that.
>>
>> Sort of fix the error cases by returning 0. I don't think we should hit
>> these cases anyway, and using 0 for the registers is safer than
>> 0xffffffea (-EINVAL).
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_hdcp.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
>> index f9010094ff29..ee29fcb860e4 100644
>> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
>> @@ -347,7 +347,7 @@ u32 intel_hdcp_get_repeater_ctl(struct drm_i915_private *i915,
>> default:
>> drm_err(&i915->drm, "Unknown transcoder %d\n",
>> cpu_transcoder);
>
> These should probably be MISSING_CASE() as well.
Yeah, maybe. For another day...
>
> Anyways,
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks, both pushed.
BR,
Jani.
>
>> - return -EINVAL;
>> + return 0;
>> }
>> }
>>
>> @@ -364,7 +364,7 @@ u32 intel_hdcp_get_repeater_ctl(struct drm_i915_private *i915,
>> return HDCP_DDIE_REP_PRESENT | HDCP_DDIE_SHA1_M0;
>> default:
>> drm_err(&i915->drm, "Unknown port %d\n", port);
>> - return -EINVAL;
>> + return 0;
>> }
>> }
>>
>> --
>> 2.39.2
--
Jani Nikula, Intel
next prev parent reply other threads:[~2023-12-19 16:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 10:47 [PATCH 1/2] drm/i915/hdcp: unify connector logging format Jani Nikula
2023-12-19 10:47 ` [PATCH 2/2] drm/i915/hdcp: fix intel_hdcp_get_repeater_ctl() error return value Jani Nikula
2023-12-19 12:53 ` Ville Syrjälä
2023-12-19 16:22 ` Jani Nikula [this message]
2023-12-19 12:10 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/hdcp: unify connector logging format Patchwork
2023-12-19 12:50 ` [PATCH 1/2] " Ville Syrjälä
2023-12-19 14:28 ` ✗ Fi.CI.IGT: failure for series starting with [1/2] " Patchwork
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=87cyv2tb5r.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.