summaryrefslogtreecommitdiff
path: root/src/adb_comp.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-08-23 15:05:16 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-08-23 17:02:50 +0300
commit72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61 (patch)
treef0a16e94666c01a1b87bbe1b4ddbf94c90fae291 /src/adb_comp.c
parent91085a48742611182f08b0c83621641261bca850 (diff)
downloadapk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.gz
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.bz2
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.xz
apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.zip
remove IS_ERR_OR_NULL
In most places where pointer can be an 'error' it cannot be null pointer. Further, in those cases just calling PTR_ERR() is not enough to handle the null case. Simplify code by removing this case. If NULL case needs to be handled, it's better to add separate check and return fixed error code in that case.
Diffstat (limited to 'src/adb_comp.c')
-rw-r--r--src/adb_comp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/adb_comp.c b/src/adb_comp.c
index 26fb50f..3baaac3 100644
--- a/src/adb_comp.c
+++ b/src/adb_comp.c
@@ -13,7 +13,7 @@ struct apk_istream *adb_decompress(struct apk_istream *is, adb_comp_t *compressi
{
adb_comp_t c = -1;
- if (IS_ERR_OR_NULL(is)) return is;
+ if (IS_ERR(is)) return is;
uint8_t *buf = apk_istream_peek(is, 4);
if (IS_ERR(buf)) return ERR_PTR(apk_istream_close_error(is, PTR_ERR(buf)));
@@ -35,7 +35,7 @@ struct apk_istream *adb_decompress(struct apk_istream *is, adb_comp_t *compressi
struct apk_ostream *adb_compress(struct apk_ostream *os, adb_comp_t compression)
{
- if (IS_ERR_OR_NULL(os)) return os;
+ if (IS_ERR(os)) return os;
switch (compression) {
case ADB_COMP_NONE:
return os;