diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-12-03 16:14:12 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-11 03:26:59 -0500 |
commit | 2f8c19e771dcb3af974e46ffb512b592d70fb444 (patch) | |
tree | 78e9d7dcabb14672393d71609ef5bda55f3315e5 /drivers/gpu/drm/drm_modes.c | |
parent | 5ba894064d98547c82a1efd50eba40a92df777a1 (diff) |
drm: Flatten drm_mode_connector_list_update() a bit
Use 'continue' to eliminate one indent level from
drm_mode_connector_list_update(). And while at it,
make 'found_it' bool.
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-5-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 6cd582fdcc4b..59c97ae0c68a 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -1184,30 +1184,30 @@ EXPORT_SYMBOL(drm_mode_sort); | |||
1184 | void drm_mode_connector_list_update(struct drm_connector *connector, | 1184 | void drm_mode_connector_list_update(struct drm_connector *connector, |
1185 | bool merge_type_bits) | 1185 | bool merge_type_bits) |
1186 | { | 1186 | { |
1187 | struct drm_display_mode *mode; | ||
1188 | struct drm_display_mode *pmode, *pt; | 1187 | struct drm_display_mode *pmode, *pt; |
1189 | int found_it; | ||
1190 | 1188 | ||
1191 | WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); | 1189 | WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); |
1192 | 1190 | ||
1193 | list_for_each_entry_safe(pmode, pt, &connector->probed_modes, | 1191 | list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) { |
1194 | head) { | 1192 | struct drm_display_mode *mode; |
1195 | found_it = 0; | 1193 | bool found_it = false; |
1194 | |||
1196 | /* go through current modes checking for the new probed mode */ | 1195 | /* go through current modes checking for the new probed mode */ |
1197 | list_for_each_entry(mode, &connector->modes, head) { | 1196 | list_for_each_entry(mode, &connector->modes, head) { |
1198 | if (drm_mode_equal(pmode, mode)) { | 1197 | if (!drm_mode_equal(pmode, mode)) |
1199 | found_it = 1; | 1198 | continue; |
1200 | /* if equal delete the probed mode */ | 1199 | |
1201 | mode->status = pmode->status; | 1200 | found_it = true; |
1202 | /* Merge type bits together */ | 1201 | /* if equal delete the probed mode */ |
1203 | if (merge_type_bits) | 1202 | mode->status = pmode->status; |
1204 | mode->type |= pmode->type; | 1203 | /* Merge type bits together */ |
1205 | else | 1204 | if (merge_type_bits) |
1206 | mode->type = pmode->type; | 1205 | mode->type |= pmode->type; |
1207 | list_del(&pmode->head); | 1206 | else |
1208 | drm_mode_destroy(connector->dev, pmode); | 1207 | mode->type = pmode->type; |
1209 | break; | 1208 | list_del(&pmode->head); |
1210 | } | 1209 | drm_mode_destroy(connector->dev, pmode); |
1210 | break; | ||
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | if (!found_it) { | 1213 | if (!found_it) { |