Skip to content

Commit 3dd2efb

Browse files
evelikovlucasdemarchi
authored andcommitted
libkmod: rename/reuse xz_error()
Swap "belch" for a more common name and use the function in all possible error paths. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: #452 Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
1 parent 39ba142 commit 3dd2efb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

libkmod/libkmod-file-xz.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int dlopen_lzma(void)
4242
#endif
4343
}
4444

45-
static void xz_uncompress_belch(struct kmod_file *file, lzma_ret ret)
45+
static void xz_error(struct kmod_file *file, lzma_ret ret)
4646
{
4747
switch (ret) {
4848
case LZMA_MEM_ERROR:
@@ -107,7 +107,7 @@ static int xz_uncompress(lzma_stream *strm, struct kmod_file *file)
107107
if (ret == LZMA_STREAM_END)
108108
break;
109109
if (ret != LZMA_OK) {
110-
xz_uncompress_belch(file, ret);
110+
xz_error(file, ret);
111111
ret = -EINVAL;
112112
goto out;
113113
}
@@ -134,10 +134,10 @@ int kmod_file_load_xz(struct kmod_file *file)
134134

135135
lzret = sym_lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED);
136136
if (lzret == LZMA_MEM_ERROR) {
137-
ERR(file->ctx, "xz: %s\n", strerror(ENOMEM));
137+
xz_error(file, lzret);
138138
return -ENOMEM;
139139
} else if (lzret != LZMA_OK) {
140-
ERR(file->ctx, "xz: Internal error (bug)\n");
140+
xz_error(file, lzret);
141141
return -EINVAL;
142142
}
143143
ret = xz_uncompress(&strm, file);

0 commit comments

Comments
 (0)