mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
Cleanup: Use NULL when doing NULL pointer comparisons
The Linux 5.16.14 kernel's coccicheck caught this. The semantic patch that caught it was: ./scripts/coccinelle/null/badzero.cocci Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14372
This commit is contained in:
parent
64195fc89f
commit
4ef69de384
@ -263,7 +263,7 @@ callb_execute_class(int class, int code)
|
|||||||
mutex_enter(&ct->ct_lock);
|
mutex_enter(&ct->ct_lock);
|
||||||
|
|
||||||
for (cp = ct->ct_first_cb[class];
|
for (cp = ct->ct_first_cb[class];
|
||||||
cp != NULL && ret == 0; cp = cp->c_next) {
|
cp != NULL && ret == NULL; cp = cp->c_next) {
|
||||||
while (cp->c_flag & CALLB_EXECUTING)
|
while (cp->c_flag & CALLB_EXECUTING)
|
||||||
cv_wait(&cp->c_done_cv, &ct->ct_lock);
|
cv_wait(&cp->c_done_cv, &ct->ct_lock);
|
||||||
/*
|
/*
|
||||||
|
@ -4783,7 +4783,7 @@ arc_flush(spa_t *spa, boolean_t retry)
|
|||||||
* no good way to determine if all of a spa's buffers have been
|
* no good way to determine if all of a spa's buffers have been
|
||||||
* evicted from an arc state.
|
* evicted from an arc state.
|
||||||
*/
|
*/
|
||||||
ASSERT(!retry || spa == 0);
|
ASSERT(!retry || spa == NULL);
|
||||||
|
|
||||||
if (spa != NULL)
|
if (spa != NULL)
|
||||||
guid = spa_load_guid(spa);
|
guid = spa_load_guid(spa);
|
||||||
|
@ -47,7 +47,7 @@ void
|
|||||||
abd_checksum_blake3_native(abd_t *abd, uint64_t size, const void *ctx_template,
|
abd_checksum_blake3_native(abd_t *abd, uint64_t size, const void *ctx_template,
|
||||||
zio_cksum_t *zcp)
|
zio_cksum_t *zcp)
|
||||||
{
|
{
|
||||||
ASSERT(ctx_template != 0);
|
ASSERT(ctx_template != NULL);
|
||||||
|
|
||||||
#if defined(_KERNEL)
|
#if defined(_KERNEL)
|
||||||
BLAKE3_CTX *ctx = blake3_per_cpu_ctx[CPU_SEQID_UNSTABLE];
|
BLAKE3_CTX *ctx = blake3_per_cpu_ctx[CPU_SEQID_UNSTABLE];
|
||||||
@ -76,7 +76,7 @@ abd_checksum_blake3_byteswap(abd_t *abd, uint64_t size,
|
|||||||
{
|
{
|
||||||
zio_cksum_t tmp;
|
zio_cksum_t tmp;
|
||||||
|
|
||||||
ASSERT(ctx_template != 0);
|
ASSERT(ctx_template != NULL);
|
||||||
|
|
||||||
abd_checksum_blake3_native(abd, size, ctx_template, &tmp);
|
abd_checksum_blake3_native(abd, size, ctx_template, &tmp);
|
||||||
zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]);
|
zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]);
|
||||||
|
@ -946,9 +946,9 @@ fzap_length(zap_name_t *zn,
|
|||||||
if (err != 0)
|
if (err != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (integer_size != 0)
|
if (integer_size != NULL)
|
||||||
*integer_size = zeh.zeh_integer_size;
|
*integer_size = zeh.zeh_integer_size;
|
||||||
if (num_integers != 0)
|
if (num_integers != NULL)
|
||||||
*num_integers = zeh.zeh_num_integers;
|
*num_integers = zeh.zeh_num_integers;
|
||||||
out:
|
out:
|
||||||
zap_put_leaf(l);
|
zap_put_leaf(l);
|
||||||
|
Loading…
Reference in New Issue
Block a user