Re: Fwd: [PATCH] drm/i915: Fix enable OA report logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 08 Jan 2020, Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:
> I forwarding this to a (sub)set of correct MLs/maintainers. Please,
> follow the instructions they give.

Thanks, already fixed by commit 9278bbb6e43c ("drm/i915/perf: Reverse a
ternary to make sparse happy") in our -next.

BR,
Jani.

>
> ---------- Forwarded message ---------
> From: Ebrahim Byagowi <ebrahim@xxxxxxx>
> Date: Mon, Dec 23, 2019 at 12:17 PM
> Subject: [PATCH] drm/i915: Fix enable OA report logic
> To: <platform-driver-x86@xxxxxxxxxxxxxxx>
>
>
>
> Clang raises
>
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: warning: operator '?:' has
> lower precedence than '|'; '|' will be evaluated first
> [-Wbitwise-conditional-parentheses]
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses
> around the '|' expression to silence this warning
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
>   drivers/gpu/drm/i915/i915_perf.c:2474:50: note: place parentheses
> around the '?:' expression to evaluate it first
>                              !(stream->sample_flags & SAMPLE_OA_REPORT) ?
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>
> with -Wbitwise-conditional-parentheses and apparently is right
> as '|' is evaluated before '?:' which doesn't seem to be the intention
> here so let's put parentheses in the right place to fix it.
>
> Signed-off-by: Ebrahim Byagowi <ebrahim@xxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_perf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 2ae14bc14931..db963f7c2e2e 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -2471,9 +2471,9 @@ static int gen12_enable_metric_set(struct
> i915_perf_stream *stream)
>                             * If the user didn't require OA reports,
> instruct the
>                             * hardware not to emit ctx switch reports.
>                             */
> -                          !(stream->sample_flags & SAMPLE_OA_REPORT) ?
> -
> _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
> -
> _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS));
> +                          (!(stream->sample_flags & SAMPLE_OA_REPORT) ?
> +
> _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
> +
> _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS)));
>
>         intel_uncore_write(uncore, GEN12_OAG_OAGLBCTXCTRL, periodic ?
>                            (GEN12_OAG_OAGLBCTXCTRL_COUNTER_RESUME |
> --
> 2.24.0

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux