All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Robert Bragg <robert@sixbynine.org>,
	Matthew Auld <matthew.auld@intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/perf: remove user triggerable warn
Date: Tue, 28 Mar 2017 14:57:15 +0300	[thread overview]
Message-ID: <87fuhxwr50.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <CAMou1-0JD_wUu+-zoahqtk7B=q0+Qi-1xXpbcFqLUPFeWtw72g@mail.gmail.com>

Robert Bragg <robert@sixbynine.org> writes:

> On Mon, Mar 27, 2017 at 9:32 PM, Matthew Auld <matthew.auld@intel.com>
> wrote:
>
>> Don't throw a warning if we are given an invalid property id. While
>> here let's also bring back Robert' original idea of catching unhandled
>> enumeration values at compile time.
>>
>> Fixes: eec688e1420d ("drm/i915: Add i915 perf infrastructure")
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> Cc: Robert Bragg <robert@sixbynine.org>
>> ---
>>  drivers/gpu/drm/i915/i915_perf.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_
>> perf.c
>> index 8c121187ff39..e52bc6a581e6 100644
>> --- a/drivers/gpu/drm/i915/i915_perf.c
>> +++ b/drivers/gpu/drm/i915/i915_perf.c
>> @@ -1793,6 +1793,11 @@ static int read_properties_unlocked(struct
>> drm_i915_private *dev_priv,
>>                 if (ret)
>>                         return ret;
>>
>> +               if (id == 0 || id >= DRM_I915_PERF_PROP_MAX) {
>> +                       DRM_DEBUG("Unknown i915 perf property ID\n");
>> +                       return -EINVAL;
>> +               }
>> +
>>                 switch ((enum drm_i915_perf_property_id)id) {
>>                 case DRM_I915_PERF_PROP_CTX_HANDLE:
>>                         props->single_context = 1;
>> @@ -1862,9 +1867,8 @@ static int read_properties_unlocked(struct
>> drm_i915_private *dev_priv,
>>                         props->oa_periodic = true;
>>                         props->oa_period_exponent = value;
>>                         break;
>> -               default:
>> +               case DRM_I915_PERF_PROP_MAX:
>>                         MISSING_CASE(id);
>> -                       DRM_DEBUG("Unknown i915 perf property ID\n");
>>                         return -EINVAL;
>>                 }
>>
>> --
>> 2.9.3
>>
>>
> Looks good to me, thanks.
>
> Reviewed-by: Robert Bragg <robert@sixbynine.org>

Pushed. Thanks for patch and review.
-Mika
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-03-28 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 20:32 [PATCH] drm/i915/perf: remove user triggerable warn Matthew Auld
2017-03-27 21:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-28 11:20 ` [PATCH] " Robert Bragg
2017-03-28 11:57   ` Mika Kuoppala [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=87fuhxwr50.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=robert@sixbynine.org \
    /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.