diff options
author | Jaswinder Singh Rajput <jaswinder@kernel.org> | 2009-09-12 13:45:07 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-17 17:43:34 -0400 |
commit | decbbcda2965fadb9fbaaf4f9e057ae554aa3cfe (patch) | |
tree | 2a16261bc9eb11cbab878e259dc4e03c4750a2fc /drivers/gpu | |
parent | b7e53aba2f0e6abf23e3f07b38b241145c33a005 (diff) |
drm/i915: intel_display.c handle latency variable efficiently
By handling latency variable efficiently we also get rid of this warning :
CC [M] drivers/gpu/drm/i915/intel_display.o
drivers/gpu/drm/i915/intel_display.c: In function ‘igd_enable_cxsr’:
drivers/gpu/drm/i915/intel_display.c:1918: warning: ‘latency’ may be used uninitialized in this function
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f9fe9894637a..b6743281a97b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2184,14 +2184,13 @@ static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb, | |||
2184 | for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) { | 2184 | for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) { |
2185 | latency = &cxsr_latency_table[i]; | 2185 | latency = &cxsr_latency_table[i]; |
2186 | if (is_desktop == latency->is_desktop && | 2186 | if (is_desktop == latency->is_desktop && |
2187 | fsb == latency->fsb_freq && mem == latency->mem_freq) | 2187 | fsb == latency->fsb_freq && mem == latency->mem_freq) |
2188 | break; | 2188 | return latency; |
2189 | } | ||
2190 | if (i >= ARRAY_SIZE(cxsr_latency_table)) { | ||
2191 | DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n"); | ||
2192 | return NULL; | ||
2193 | } | 2189 | } |
2194 | return latency; | 2190 | |
2191 | DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n"); | ||
2192 | |||
2193 | return NULL; | ||
2195 | } | 2194 | } |
2196 | 2195 | ||
2197 | static void igd_disable_cxsr(struct drm_device *dev) | 2196 | static void igd_disable_cxsr(struct drm_device *dev) |