]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: concat: replace alloc + calloc with 1 alloc
authorRosen Penev <rosenp@gmail.com>
Thu, 5 Mar 2026 22:44:10 +0000 (14:44 -0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 11 Mar 2026 15:23:57 +0000 (16:23 +0100)
commite19eaffc5213fdd6179e849d3032929fae0d8c2c
tree2ef7eb7081bbe661bf7528ee357166192ec0e75f
parentc685e6e8d88d544e8c4429b06c3e6795cbba32dd
mtd: concat: replace alloc + calloc with 1 alloc

A flex array can be used to reduce the allocation to 1.

And actually mtdconcat was using the pointer + 1 trick to point to the
overallocated area. Better alternatives exist.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/mtd_virt_concat.c
drivers/mtd/mtdconcat.c
include/linux/mtd/concat.h