diff options
author | Sol Boucher <solb@chromium.org> | 2015-05-07 21:00:05 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-07-16 17:39:33 +0200 |
commit | ec42486055fa317e84232115c9b83c1414f48b20 (patch) | |
tree | 4d097643d9af4a851a270ed118799ff8ecad50b1 /util/cbfstool/cbfstool.c | |
parent | 6533671ce015227401cec441b1af51d2bd626ec4 (diff) | |
download | coreboot-ec42486055fa317e84232115c9b83c1414f48b20.tar.xz |
cbfstool: Factor out compression algorithm list
Parse compression algorithm arguments using a single list.
Change-Id: Idc5b14a53377b29964f24221e42db6e09a497d48
Signed-off-by: Sol Boucher <solb@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I1a117a9473e895feaf455bb30d0f945f57de51eb
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10931
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r-- | util/cbfstool/cbfstool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index cae1227200..b6a486fd37 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -973,15 +973,15 @@ int main(int argc, char **argv) WARN("Unknown type '%s' ignored\n", optarg); break; - case 'c': - if (!strncasecmp(optarg, "lzma", 5)) - param.compression = CBFS_COMPRESS_LZMA; - else if (!strncasecmp(optarg, "none", 5)) - param.compression = CBFS_COMPRESS_NONE; + case 'c': { + int algo = cbfs_parse_comp_algo(optarg); + if (algo >= 0) + param.compression = algo; else - WARN("Unknown compression '%s'" - " ignored.\n", optarg); + WARN("Unknown compression '%s' ignored.\n", + optarg); break; + } case 'M': param.fmap = optarg; break; |