drm/nouveau: Fix parsing of the temperature constant correction.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 23 Sep 2010 15:01:05 +0000 (17:01 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Sep 2010 06:29:19 +0000 (16:29 +1000)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_temp.c

index 54e3d9222f799fff51ee0ddd9416b186da4177c1..86b170a851be3d83b6592ec83ceafc7003d7c0db 100644 (file)
@@ -113,8 +113,8 @@ nouveau_temp_vbios_parse(struct drm_device *dev, u8 *temp)
 
                switch (temp[0]) {
                case 0x01:
-                       value = (value&0x8f) == 0 ? (value >> 9) & 0x7f : 0;
-                       sensor->offset_constant = value;
+                       if ((value & 0x8f) == 0)
+                               sensor->offset_constant = (value >> 9) & 0x7f;
                        break;
 
                case 0x04: