]> git.baikalelectronics.ru Git - kernel.git/commit
dm stripe: get rid of a Variable Length Array (VLA)
authorTycho Andersen <tycho@tycho.ws>
Fri, 9 Mar 2018 03:35:44 +0000 (20:35 -0700)
committerMike Snitzer <snitzer@redhat.com>
Tue, 3 Apr 2018 19:04:18 +0000 (15:04 -0400)
commit4471c348dc324129e831afa53ca60e0e8eadb5d6
tree1b2f42f7982a983e77becc1461efbae77defe302
parent484b311c1bff1ad80f1c3d3d7ce6e14e6cc4caec
dm stripe: get rid of a Variable Length Array (VLA)

Ideally, we'd like to get rid of all VLAs in the kernel and add -Wvla to
the build args: https://lkml.org/lkml/2018/3/7/621

This one is a simple case, since we don't actually need the VLA at all: we
can just iterate over the stripes twice, once to emit their names, and the
second time to emit status (i.e. trade memory for time). Since the number
of stripes is probably low, this is hopefully not that expensive.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-stripe.c