@@ -3885,7 +3885,7 @@ static bool g4x_compute_srwm(struct drm_device *dev,
static inline bool single_plane_enabled(unsigned int mask)
{
- return mask && (mask & -mask) == 0;
+ return mask && (mask & (mask - 1)) == 0;
}
static void g4x_update_wm(struct drm_device *dev)
@@ -3910,7 +3910,7 @@ static void g4x_update_wm(struct drm_device *dev)
plane_sr = cursor_sr = 0;
if (single_plane_enabled(enabled) &&
- g4x_compute_srwm(dev, ffs(enabled) - 1,
+ g4x_compute_srwm(dev, fls(enabled) - 1,
sr_latency_ns,
&g4x_wm_info,
&g4x_cursor_wm_info,
@@ -4335,7 +4335,7 @@ static void ironlake_update_wm(struct drm_device *dev)
if (!single_plane_enabled(enabled))
return;
- enabled = ffs(enabled) - 1;
+ enabled = fls(enabled) - 1;
/* WM1 */
if (!ironlake_compute_srwm(dev, 1, enabled,
@@ -4421,7 +4421,7 @@ static void sandybridge_update_wm(struct drm_device *dev)
if (!single_plane_enabled(enabled))
return;
- enabled = ffs(enabled) - 1;
+ enabled = fls(enabled) - 1;
/* WM1 */
if (!ironlake_compute_srwm(dev, 1, enabled,