aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-11-27 12:09:10 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-11-28 02:40:03 -0500
commitc96521eebc24d49eb109013dcdae08c0c37e4f1e (patch)
tree305408ee8c71dcb8794bffaa7e595d4c8d4ad547
parenta2ec1c132a593ac4f05eb8d02834c4675a4aea07 (diff)
drm: Fix shift operations for drm_fb_helper::drm_target_preferred()
smatch correctly warns: drivers/gpu/drm/drm_fb_helper.c:1960 drm_target_preferred() warn: should '1 << i' be a 64 bit type? drivers/gpu/drm/drm_fb_helper.c:2001 drm_target_preferred() warn: should '1 << i' be a 64 bit type? Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 14547817566d..1f26634f53d8 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1959,19 +1959,20 @@ static bool drm_target_preferred(struct drm_fb_helper *fb_helper,
1959 bool *enabled, int width, int height) 1959 bool *enabled, int width, int height)
1960{ 1960{
1961 struct drm_fb_helper_connector *fb_helper_conn; 1961 struct drm_fb_helper_connector *fb_helper_conn;
1962 int i; 1962 const u64 mask = BIT_ULL(fb_helper->connector_count) - 1;
1963 uint64_t conn_configured = 0, mask; 1963 u64 conn_configured = 0;
1964 int tile_pass = 0; 1964 int tile_pass = 0;
1965 mask = (1 << fb_helper->connector_count) - 1; 1965 int i;
1966
1966retry: 1967retry:
1967 for (i = 0; i < fb_helper->connector_count; i++) { 1968 for (i = 0; i < fb_helper->connector_count; i++) {
1968 fb_helper_conn = fb_helper->connector_info[i]; 1969 fb_helper_conn = fb_helper->connector_info[i];
1969 1970
1970 if (conn_configured & (1 << i)) 1971 if (conn_configured & BIT_ULL(i))
1971 continue; 1972 continue;
1972 1973
1973 if (enabled[i] == false) { 1974 if (enabled[i] == false) {
1974 conn_configured |= (1 << i); 1975 conn_configured |= BIT_ULL(i);
1975 continue; 1976 continue;
1976 } 1977 }
1977 1978
@@ -2012,7 +2013,7 @@ retry:
2012 } 2013 }
2013 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name : 2014 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name :
2014 "none"); 2015 "none");
2015 conn_configured |= (1 << i); 2016 conn_configured |= BIT_ULL(i);
2016 } 2017 }
2017 2018
2018 if ((conn_configured & mask) != mask) { 2019 if ((conn_configured & mask) != mask) {