x86/resctrl: Tweak for_each_rdt_resource() to avoid undefined behaviour

for_each_rdt_resource() walks each entry. Now that it uses a member
of the struct for walking, the limit is beyond the end of the array.
(there is even a comment warning the casual reader) This doesn't stop
ubsan squaking.

Juggle the arithmetic to avoid this. The only reason it was done this
way was to keep the test similar to the previous version.

Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
1 file changed