diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-08-23 15:05:16 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-08-23 17:02:50 +0300 |
commit | 72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61 (patch) | |
tree | f0a16e94666c01a1b87bbe1b4ddbf94c90fae291 /src/adb_walk_text.c | |
parent | 91085a48742611182f08b0c83621641261bca850 (diff) | |
download | apk-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_walk_text.c')
-rw-r--r-- | src/adb_walk_text.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/adb_walk_text.c b/src/adb_walk_text.c index 1b7f5cf..f1ec7ee 100644 --- a/src/adb_walk_text.c +++ b/src/adb_walk_text.c @@ -19,7 +19,7 @@ int adb_walk_text(struct adb_walk *d, struct apk_istream *is) int r = 0, i, multi_line = 0, nesting = 0, new_item = 0; uint8_t started[64] = {0}; - if (IS_ERR_OR_NULL(is)) return PTR_ERR(is); + if (IS_ERR(is)) return PTR_ERR(is); if (apk_istream_get_delim(is, token, &l) != 0) goto err; apk_blob_pull_blob_match(&l, APK_BLOB_STR("#%SCHEMA: ")); if ((r = d->ops->schema(d, apk_blob_pull_uint(&l, 16))) != 0) goto err; |