diff options
-rw-r--r-- | src/radeon_modes.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 535d0470..372b2edd 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -373,15 +373,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName, if (p == ddcModes) ddcModes = p->next; /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; + RADEONSortModes(&p, &first, &last); break; } @@ -402,15 +394,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName, if (p == ddcModes) ddcModes = p->next; /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; + RADEONSortModes(&p, &first, &last); } } @@ -558,12 +542,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) new->type |= M_T_USERDEF; - new->next = NULL; - new->prev = last; - - if (last) last->next = new; - last = new; - if (!first) first = new; + RADEONSortModes(&new, &first, &last); pScrn->display->virtualX = pScrn->virtualX = MAX(pScrn->virtualX, width); @@ -609,12 +588,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) new->type |= M_T_DEFAULT; - new->next = NULL; - new->prev = last; - - if (last) last->next = new; - last = new; - if (!first) first = new; + RADEONSortModes(&new, &first, &last); } } } |