summaryrefslogtreecommitdiff
path: root/src/adb.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.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.c')
-rw-r--r--src/adb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/adb.c b/src/adb.c
index 277aba6..53a82cd 100644
--- a/src/adb.c
+++ b/src/adb.c
@@ -37,7 +37,7 @@ static struct adb_block *adb_block_next(struct adb_block *cur, apk_blob_t b)
}
#define adb_foreach_block(__blk, __adb) \
- for (__blk = adb_block_first(__adb); !IS_ERR_OR_NULL(__blk); __blk = adb_block_next(__blk, __adb))
+ for (__blk = adb_block_first(__adb); __blk && !IS_ERR(__blk); __blk = adb_block_next(__blk, __adb))
/* Init stuff */
int adb_free(struct adb *db)
@@ -1103,7 +1103,7 @@ int adb_trust_write_signatures(struct apk_trust *trust, struct adb *db, struct a
size_t siglen;
int r;
- if (IS_ERR_OR_NULL(trust)) return PTR_ERR(trust);
+ if (IS_ERR(trust)) return PTR_ERR(trust);
if (!vfy) {
vfy = alloca(sizeof *vfy);