binman: Tidy up pylint warnings in comp_util

Tweak some naming and comments to resolve these. Use WriteFile() to write
the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-01-09 20:14:04 -07:00
parent ad35ce5466
commit 0d1e95aa18
5 changed files with 19 additions and 20 deletions

View File

@@ -241,9 +241,9 @@ class CbfsFile(object):
"""Handle decompressing data if necessary"""
indata = self.data
if self.compress == COMPRESS_LZ4:
data = comp_util.Decompress(indata, 'lz4', with_header=False)
data = comp_util.decompress(indata, 'lz4', with_header=False)
elif self.compress == COMPRESS_LZMA:
data = comp_util.Decompress(indata, 'lzma', with_header=False)
data = comp_util.decompress(indata, 'lzma', with_header=False)
else:
data = indata
self.memlen = len(data)
@@ -362,9 +362,9 @@ class CbfsFile(object):
elif self.ftype == TYPE_RAW:
orig_data = data
if self.compress == COMPRESS_LZ4:
data = comp_util.Compress(orig_data, 'lz4', with_header=False)
data = comp_util.compress(orig_data, 'lz4', with_header=False)
elif self.compress == COMPRESS_LZMA:
data = comp_util.Compress(orig_data, 'lzma', with_header=False)
data = comp_util.compress(orig_data, 'lzma', with_header=False)
self.memlen = len(orig_data)
self.data_len = len(data)
attr = struct.pack(ATTR_COMPRESSION_FORMAT,