Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2016 02:58:22 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298331 - head/sys/dev/drm2/i915
Message-ID:  <201604200258.u3K2wM6d055531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Wed Apr 20 02:58:22 2016
New Revision: 298331
URL: https://svnweb.freebsd.org/changeset/base/298331

Log:
  i915kms intel_pm: Read from actual tsc_freq instead of uninitialized local
  
  The local of the same name would alias the global, but we didn't even include
  the header that defines tsc_freq.  Include it and rename the local.
  
  Reported by:	Coverity
  CID:		1331559
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/drm2/i915/intel_pm.c

Modified: head/sys/dev/drm2/i915/intel_pm.c
==============================================================================
--- head/sys/dev/drm2/i915/intel_pm.c	Wed Apr 20 02:09:38 2016	(r298330)
+++ head/sys/dev/drm2/i915/intel_pm.c	Wed Apr 20 02:58:22 2016	(r298331)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/drm2/i915/i915_drv.h>
 #include <dev/drm2/i915/intel_drv.h>
 #include <sys/kdb.h>
+#include <machine/clock.h>
 
 #define FORCEWAKE_ACK_TIMEOUT_MS 2
 
@@ -2686,9 +2687,9 @@ static void gen6_update_ring_freq(struct
 	if (!max_ia_freq)
 		max_ia_freq = tsc_khz;
 #else
-	uint64_t tsc_freq;
-	tsc_freq = atomic_load_acq_64(&tsc_freq);
-	max_ia_freq = tsc_freq / 1000;
+	uint64_t freq;
+	freq = atomic_load_acq_64(&tsc_freq);
+	max_ia_freq = freq / 1000;
 #endif /* FREEBSD_WIP */
 
 	/* Convert from kHz to MHz */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604200258.u3K2wM6d055531>