diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2023-02-07 22:16:53 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-02-14 14:23:07 -0500 |
commit | 8d1058fb2ac29644d8a427eb3d3eeff2fd88f0a7 (patch) | |
tree | 7443ec12f23f1e0aeac6af04a45761b1fc42962a /drivers/md | |
parent | 6cc435fa76cc1786ef460c08c31b1d27c13e9cff (diff) |
dm: fix use of sizeof() macro
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-bufio.c | 6 | ||||
-rw-r--r-- | drivers/md/dm-integrity.c | 16 | ||||
-rw-r--r-- | drivers/md/dm-kcopyd.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-writecache.c | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 64b972f7d60e..cf077f9b30c3 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1815,7 +1815,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign (block_size < PAGE_SIZE || !is_power_of_2(block_size))) { unsigned int align = min(1U << __ffs(block_size), (unsigned int)PAGE_SIZE); - snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", block_size); + snprintf(slab_name, sizeof(slab_name), "dm_bufio_cache-%u", block_size); c->slab_cache = kmem_cache_create(slab_name, block_size, align, SLAB_RECLAIM_ACCOUNT, NULL); if (!c->slab_cache) { @@ -1824,9 +1824,9 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign } } if (aux_size) - snprintf(slab_name, sizeof slab_name, "dm_bufio_buffer-%u", aux_size); + snprintf(slab_name, sizeof(slab_name), "dm_bufio_buffer-%u", aux_size); else - snprintf(slab_name, sizeof slab_name, "dm_bufio_buffer"); + snprintf(slab_name, sizeof(slab_name), "dm_bufio_buffer"); c->slab_buffer = kmem_cache_create(slab_name, sizeof(struct dm_buffer) + aux_size, 0, SLAB_RECLAIM_ACCOUNT, NULL); if (!c->slab_buffer) { diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 868b158846dd..8426efaf1676 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -826,7 +826,7 @@ static void section_mac(struct dm_integrity_c *ic, unsigned int section, __u8 re } section_le = cpu_to_le64(section); - r = crypto_shash_update(desc, (__u8 *)§ion_le, sizeof section_le); + r = crypto_shash_update(desc, (__u8 *)§ion_le, sizeof(section_le)); if (unlikely(r < 0)) { dm_integrity_io_error(ic, "crypto_shash_update", r); goto err; @@ -836,7 +836,7 @@ static void section_mac(struct dm_integrity_c *ic, unsigned int section, __u8 re for (j = 0; j < ic->journal_section_entries; j++) { struct journal_entry *je = access_journal_entry(ic, section, j); - r = crypto_shash_update(desc, (__u8 *)&je->u.sector, sizeof je->u.sector); + r = crypto_shash_update(desc, (__u8 *)&je->u.sector, sizeof(je->u.sector)); if (unlikely(r < 0)) { dm_integrity_io_error(ic, "crypto_shash_update", r); goto err; @@ -1687,7 +1687,7 @@ static void integrity_sector_checksum(struct dm_integrity_c *ic, sector_t sector } } - r = crypto_shash_update(req, (const __u8 *)§or_le, sizeof sector_le); + r = crypto_shash_update(req, (const __u8 *)§or_le, sizeof(sector_le)); if (unlikely(r < 0)) { dm_integrity_io_error(ic, "crypto_shash_update", r); goto failed; @@ -2967,8 +2967,8 @@ static void replay_journal(struct dm_integrity_c *ic) goto clear_journal; journal_empty = true; - memset(used_commit_ids, 0, sizeof used_commit_ids); - memset(max_commit_id_sections, 0, sizeof max_commit_id_sections); + memset(used_commit_ids, 0, sizeof(used_commit_ids)); + memset(max_commit_id_sections, 0, sizeof(max_commit_id_sections)); for (i = 0; i < ic->journal_sections; i++) { for (j = 0; j < ic->journal_section_sectors; j++) { int k; @@ -3685,7 +3685,7 @@ static void free_alg(struct alg_spec *a) { kfree_sensitive(a->alg_string); kfree_sensitive(a->key); - memset(a, 0, sizeof *a); + memset(a, 0, sizeof(*a)); } static int get_alg_and_key(const char *arg, struct alg_spec *a, char **error, char *error_inval) @@ -3852,10 +3852,10 @@ static int create_journal(struct dm_integrity_c *ic, char **error) clear_page(va); sg_set_buf(&sg[i], va, PAGE_SIZE); } - sg_set_buf(&sg[i], &ic->commit_ids, sizeof ic->commit_ids); + sg_set_buf(&sg[i], &ic->commit_ids, sizeof(ic->commit_ids)); skcipher_request_set_crypt(req, sg, sg, - PAGE_SIZE * ic->journal_pages + sizeof ic->commit_ids, crypt_iv); + PAGE_SIZE * ic->journal_pages + sizeof(ic->commit_ids), crypt_iv); init_completion(&comp.comp); comp.in_flight = (atomic_t)ATOMIC_INIT(1); if (do_crypt(true, req, &comp)) diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index b8f8e34c1c09..a158c6e5fbd7 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -826,7 +826,7 @@ void dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from, job->pages = NULL; job->op = REQ_OP_READ; } else { - memset(&job->source, 0, sizeof job->source); + memset(&job->source, 0, sizeof(job->source)); job->source.count = job->dests[0].count; job->pages = &zero_page_list; diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 70a110a41c44..3aa5874f0aef 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -772,7 +772,7 @@ static void writecache_poison_lists(struct dm_writecache *wc) /* * Catch incorrect access to these values while the device is suspended. */ - memset(&wc->tree, -1, sizeof wc->tree); + memset(&wc->tree, -1, sizeof(wc->tree)); wc->lru.next = LIST_POISON1; wc->lru.prev = LIST_POISON2; wc->freelist.next = LIST_POISON1; @@ -1182,7 +1182,7 @@ static int process_clear_stats_mesg(unsigned int argc, char **argv, struct dm_wr return -EINVAL; wc_lock(wc); - memset(&wc->stats, 0, sizeof wc->stats); + memset(&wc->stats, 0, sizeof(wc->stats)); wc_unlock(wc); return 0; @@ -2174,7 +2174,7 @@ static int init_memory(struct dm_writecache *wc) writecache_flush_all_metadata(wc); writecache_commit_flushed(wc, false); pmem_assign(sb(wc)->magic, cpu_to_le32(MEMORY_SUPERBLOCK_MAGIC)); - writecache_flush_region(wc, &sb(wc)->magic, sizeof sb(wc)->magic); + writecache_flush_region(wc, &sb(wc)->magic, sizeof(sb(wc)->magic)); writecache_commit_flushed(wc, false); return 0; |