summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2012-08-01 21:23:47 -0700
committerChad Versace <[email protected]>2012-08-07 09:30:33 -0700
commita4bf68ca50da0ce291a464aec9b03a469ab2561a (patch)
tree48228cbcc200abb65e1aa8501142ae76183d802b /src/gallium
parentb2d428cb8d20e003b65769c7757a137406c671e6 (diff)
dri: Simplify use of driConcatConfigs
If either argument to driConcatConfigs(a, b) is null or the empty list, then simply return the other argument as the resultant list. All callers were accomplishing that same behavior anyway. And each caller accopmplished it with the same pattern. So this patch moves that external pattern into the function. Reviewed-by: <[email protected]> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 406e550e58e..e581a74685a 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -219,16 +219,12 @@ dri_fill_in_modes(struct dri_screen *screen,
if (pixel_bits == 16) {
configs = configs_r5g6b5;
- if (configs_a8r8g8b8)
- configs = configs ? driConcatConfigs(configs, configs_a8r8g8b8) : configs_a8r8g8b8;
- if (configs_x8r8g8b8)
- configs = configs ? driConcatConfigs(configs, configs_x8r8g8b8) : configs_x8r8g8b8;
+ configs = driConcatConfigs(configs, configs_a8r8g8b8);
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
} else {
configs = configs_a8r8g8b8;
- if (configs_x8r8g8b8)
- configs = configs ? driConcatConfigs(configs, configs_x8r8g8b8) : configs_x8r8g8b8;
- if (configs_r5g6b5)
- configs = configs ? driConcatConfigs(configs, configs_r5g6b5) : configs_r5g6b5;
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
+ configs = driConcatConfigs(configs, configs_r5g6b5);
}
if (configs == NULL) {