]> www.infradead.org Git - users/hch/block.git/commitdiff
cryptoloop: fix a sparse annotation
authorChristoph Hellwig <hch@lst.de>
Thu, 26 Aug 2021 09:41:52 +0000 (11:41 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 26 Aug 2021 09:43:35 +0000 (11:43 +0200)
iv is used as a little endian value, so use a __le32 type for it.  Also
move the initialization into the declaration to simplify it a bit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/block/cryptoloop.c

index 3cabc335ae7448fc671642df86caa4fe2c3d3bf9..1a65dec47b07f5d2a5b6b40299ac1239b96ad5c8 100644 (file)
@@ -130,8 +130,7 @@ cryptoloop_transfer(struct loop_device *lo, int cmd,
 
        while (size > 0) {
                const int sz = min(size, LOOP_IV_SECTOR_SIZE);
-               u32 iv[4] = { 0, };
-               iv[0] = cpu_to_le32(IV & 0xffffffff);
+               __le32 iv[4] = { cpu_to_le32(IV & 0xffffffff), };
 
                sg_set_page(&sg_in, in_page, sz, in_offs);
                sg_set_page(&sg_out, out_page, sz, out_offs);