[RESEND,2/2] drm/i915: don't mix bitwise and logical operations for has_snoop

Submitted by Jani Nikula on May 13, 2016, 2:04 p.m.

Details

Message ID 1463148278-23193-2-git-send-email-jani.nikula@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula May 13, 2016, 2:04 p.m.
Also make the code more readable.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_dma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 547100fa3122..a8c79f6512a4 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -954,9 +954,11 @@  static void intel_device_info_runtime_init(struct drm_device *dev)
 	else if (INTEL_INFO(dev)->gen >= 9)
 		gen9_sseu_info_init(dev);
 
-	/* Snooping is broken on BXT A stepping. */
 	info->has_snoop = !info->has_llc;
-	info->has_snoop &= !IS_BXT_REVID(dev, 0, BXT_REVID_A1);
+
+	/* Snooping is broken on BXT A stepping. */
+	if (IS_BXT_REVID(dev, 0, BXT_REVID_A1))
+		info->has_snoop = false;
 
 	DRM_DEBUG_DRIVER("slice total: %u\n", info->slice_total);
 	DRM_DEBUG_DRIVER("subslice total: %u\n", info->subslice_total);

Comments

On 13/05/16 15:04, Jani Nikula wrote:
> Also make the code more readable.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_dma.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 547100fa3122..a8c79f6512a4 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -954,9 +954,11 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
>   	else if (INTEL_INFO(dev)->gen >= 9)
>   		gen9_sseu_info_init(dev);
>
> -	/* Snooping is broken on BXT A stepping. */
>   	info->has_snoop = !info->has_llc;
> -	info->has_snoop &= !IS_BXT_REVID(dev, 0, BXT_REVID_A1);
> +
> +	/* Snooping is broken on BXT A stepping. */
> +	if (IS_BXT_REVID(dev, 0, BXT_REVID_A1))
> +		info->has_snoop = false;
>
>   	DRM_DEBUG_DRIVER("slice total: %u\n", info->slice_total);
>   	DRM_DEBUG_DRIVER("subslice total: %u\n", info->subslice_total);
>

Yeah that is more readable.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko