Commit fc0a4461 authored by viresh kumar's avatar viresh kumar Committed by Mike Snitzer

dm: remove unlikely() before IS_ERR()

IS_ERR() already contains an 'unlikely' compiler flag so there is no
need to do that again from IS_ERR() callers.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent e80d1c80
...@@ -533,7 +533,7 @@ static int read_exceptions(struct pstore *ps, ...@@ -533,7 +533,7 @@ static int read_exceptions(struct pstore *ps,
chunk = area_location(ps, ps->current_area); chunk = area_location(ps, ps->current_area);
area = dm_bufio_read(client, chunk, &bp); area = dm_bufio_read(client, chunk, &bp);
if (unlikely(IS_ERR(area))) { if (IS_ERR(area)) {
r = PTR_ERR(area); r = PTR_ERR(area);
goto ret_destroy_bufio; goto ret_destroy_bufio;
} }
......
...@@ -267,7 +267,7 @@ static int verity_verify_level(struct dm_verity_io *io, sector_t block, ...@@ -267,7 +267,7 @@ static int verity_verify_level(struct dm_verity_io *io, sector_t block,
verity_hash_at_level(v, block, level, &hash_block, &offset); verity_hash_at_level(v, block, level, &hash_block, &offset);
data = dm_bufio_read(v->bufio, hash_block, &buf); data = dm_bufio_read(v->bufio, hash_block, &buf);
if (unlikely(IS_ERR(data))) if (IS_ERR(data))
return PTR_ERR(data); return PTR_ERR(data);
aux = dm_bufio_get_aux_data(buf); aux = dm_bufio_get_aux_data(buf);
......
...@@ -454,7 +454,7 @@ int dm_bm_read_lock(struct dm_block_manager *bm, dm_block_t b, ...@@ -454,7 +454,7 @@ int dm_bm_read_lock(struct dm_block_manager *bm, dm_block_t b,
int r; int r;
p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result); p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result);
if (unlikely(IS_ERR(p))) if (IS_ERR(p))
return PTR_ERR(p); return PTR_ERR(p);
aux = dm_bufio_get_aux_data(to_buffer(*result)); aux = dm_bufio_get_aux_data(to_buffer(*result));
...@@ -490,7 +490,7 @@ int dm_bm_write_lock(struct dm_block_manager *bm, ...@@ -490,7 +490,7 @@ int dm_bm_write_lock(struct dm_block_manager *bm,
return -EPERM; return -EPERM;
p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result); p = dm_bufio_read(bm->bufio, b, (struct dm_buffer **) result);
if (unlikely(IS_ERR(p))) if (IS_ERR(p))
return PTR_ERR(p); return PTR_ERR(p);
aux = dm_bufio_get_aux_data(to_buffer(*result)); aux = dm_bufio_get_aux_data(to_buffer(*result));
...@@ -523,7 +523,7 @@ int dm_bm_read_try_lock(struct dm_block_manager *bm, ...@@ -523,7 +523,7 @@ int dm_bm_read_try_lock(struct dm_block_manager *bm,
int r; int r;
p = dm_bufio_get(bm->bufio, b, (struct dm_buffer **) result); p = dm_bufio_get(bm->bufio, b, (struct dm_buffer **) result);
if (unlikely(IS_ERR(p))) if (IS_ERR(p))
return PTR_ERR(p); return PTR_ERR(p);
if (unlikely(!p)) if (unlikely(!p))
return -EWOULDBLOCK; return -EWOULDBLOCK;
...@@ -559,7 +559,7 @@ int dm_bm_write_lock_zero(struct dm_block_manager *bm, ...@@ -559,7 +559,7 @@ int dm_bm_write_lock_zero(struct dm_block_manager *bm,
return -EPERM; return -EPERM;
p = dm_bufio_new(bm->bufio, b, (struct dm_buffer **) result); p = dm_bufio_new(bm->bufio, b, (struct dm_buffer **) result);
if (unlikely(IS_ERR(p))) if (IS_ERR(p))
return PTR_ERR(p); return PTR_ERR(p);
memset(p, 0, dm_bm_block_size(bm)); memset(p, 0, dm_bm_block_size(bm));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment