]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: use argconfig_parse_comma_sep_array_u16() in attach-ns
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 16 Jul 2024 21:34:57 +0000 (15:34 -0600)
committerDaniel Wagner <wagi@monom.org>
Wed, 17 Jul 2024 14:57:45 +0000 (16:57 +0200)
commit648114f39b7b474d6b4007546ff0aa5ac99279a9
tree03c1f5624f26891d7a6c14871b2e4d8f0edc401b
parent72f3ab65f141eb39fa5ea67dc051321d8820825e
nvme: use argconfig_parse_comma_sep_array_u16() in attach-ns

nvme_attach_ns() is using argconfig_parse_comma_sep_array()
to parse a list of ints and then copying them into a list of u16s.

Use argconfig_parse_comma_sep_array_u16() instead to save on memory
and avoid needing to copy the values to another list.
This also checks that the values fit in u16.

Also use NVME_ID_CTRL_LIST_MAX instead of hard-coding the max list size.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
nvme.c