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
This commit is contained in:
cem 2016-04-20 02:58:22 +00:00
parent 81f4ce8db7
commit 6401e51867

View File

@ -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 drm_device *dev)
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 */