From 624d6bbdcebd38eb4e92bb3f7973f05a33e7d53f Mon Sep 17 00:00:00 2001 From: Rakesh Roy <107236920+rorake@users.noreply.github.com> Date: Tue, 25 Oct 2022 21:38:18 +0530 Subject: [PATCH] SWDEV-361590 - Fix Palamida scan issue (#3020) - Don't use code from Wikipedia (prohibited sources) [ROCm/hip-tests commit: e7203b9706207635f0f6b5b058e2ad93289354e7] --- projects/hip-tests/catch/include/hip_test_rtc.hh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/projects/hip-tests/catch/include/hip_test_rtc.hh b/projects/hip-tests/catch/include/hip_test_rtc.hh index 0f862840bb..11ef6a1656 100644 --- a/projects/hip-tests/catch/include/hip_test_rtc.hh +++ b/projects/hip-tests/catch/include/hip_test_rtc.hh @@ -77,11 +77,7 @@ inline std::vector alignArguments(std::vector& args) { for (auto& arg : args) { const char* argPtr{reinterpret_cast(arg.ptr)}; - /* - * Details about the padding formula can be found at: - * https://en.wikipedia.org/wiki/Data_structure_alignment#Data_structure_padding - */ - int paddingNeeded = -count & (arg.alignmentRequirement - 1); + int paddingNeeded = (arg.alignmentRequirement - 1) & (~count + 1); alignedArguments.insert(std::end(alignedArguments), paddingNeeded, 0); count += paddingNeeded;