]> git.baikalelectronics.ru Git - kernel.git/commit
dm table: audit all dm_table_get_target() callers
authorMike Snitzer <snitzer@kernel.org>
Tue, 5 Jul 2022 20:12:27 +0000 (16:12 -0400)
committerMike Snitzer <snitzer@kernel.org>
Thu, 7 Jul 2022 15:49:34 +0000 (11:49 -0400)
commit2adba8de6137c9db7e47ac08d1fd8e1401f84e81
tree75ff585908371d35a6142b3c8b9612c1cb8ac3a4
parent6480e43364e9e6a20edd219d1d85f7bc879598b7
dm table: audit all dm_table_get_target() callers

All callers of dm_table_get_target() are expected to do proper bounds
checking on the index they pass.

Move dm_table_get_target() to dm-core.h to make it extra clear that only
DM core code should be using it. Switch it to be inlined while at it.

Standardize all DM core callers to use the same for loop pattern and
make associated variables as local as possible. Rename some variables
(e.g. s/table/t/ and s/tgt/ti/) along the way.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-core.h
drivers/md/dm-ima.c
drivers/md/dm-table.c
drivers/md/dm-zone.c
drivers/md/dm.c
drivers/md/dm.h