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
This commit is contained in:

committed by
Daniel Vetter

parent
5ba894064d
commit
2f8c19e771
@@ -1184,19 +1184,20 @@ EXPORT_SYMBOL(drm_mode_sort);
|
|||||||
void drm_mode_connector_list_update(struct drm_connector *connector,
|
void drm_mode_connector_list_update(struct drm_connector *connector,
|
||||||
bool merge_type_bits)
|
bool merge_type_bits)
|
||||||
{
|
{
|
||||||
struct drm_display_mode *mode;
|
|
||||||
struct drm_display_mode *pmode, *pt;
|
struct drm_display_mode *pmode, *pt;
|
||||||
int found_it;
|
|
||||||
|
|
||||||
WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex));
|
WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex));
|
||||||
|
|
||||||
list_for_each_entry_safe(pmode, pt, &connector->probed_modes,
|
list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) {
|
||||||
head) {
|
struct drm_display_mode *mode;
|
||||||
found_it = 0;
|
bool found_it = false;
|
||||||
|
|
||||||
/* go through current modes checking for the new probed mode */
|
/* go through current modes checking for the new probed mode */
|
||||||
list_for_each_entry(mode, &connector->modes, head) {
|
list_for_each_entry(mode, &connector->modes, head) {
|
||||||
if (drm_mode_equal(pmode, mode)) {
|
if (!drm_mode_equal(pmode, mode))
|
||||||
found_it = 1;
|
continue;
|
||||||
|
|
||||||
|
found_it = true;
|
||||||
/* if equal delete the probed mode */
|
/* if equal delete the probed mode */
|
||||||
mode->status = pmode->status;
|
mode->status = pmode->status;
|
||||||
/* Merge type bits together */
|
/* Merge type bits together */
|
||||||
@@ -1208,7 +1209,6 @@ void drm_mode_connector_list_update(struct drm_connector *connector,
|
|||||||
drm_mode_destroy(connector->dev, pmode);
|
drm_mode_destroy(connector->dev, pmode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!found_it) {
|
if (!found_it) {
|
||||||
list_move_tail(&pmode->head, &connector->modes);
|
list_move_tail(&pmode->head, &connector->modes);
|
||||||
|
Reference in New Issue
Block a user