diff options
author | Huang Rui <ray.huang@amd.com> | 2025-07-14 14:45:14 +0800 |
---|---|---|
committer | Huang Rui <ray.huang@amd.com> | 2025-07-14 14:45:14 +0800 |
commit | 9ea8a8e93d542fe61d82716d1a721e8d1d257405 (patch) | |
tree | 04f2eccf2ec7d9a69974d57d656565fb15b4ebbd | |
parent | e4bd1ba753641672fe4f108142b94fa2a1a7220c (diff) |
The inline function is_power_of_two should be set as static since it's
only called in pattern.c, otherwise it will encounter below build error.
[114/136] Linking target tests/modetest/modetest
FAILED: tests/modetest/modetest
cc -o tests/modetest/modetest tests/modetest/modetest.p/buffers.c.o tests/modetest/modetest.p/cursor.c.o tests/modetest/modetest.p/modetest.c.o -Wl,--as-needed -Wl,--no-undefined -fno-omit-frame-pointer '-Wl,-rpath,$ORIGIN/../..' -Wl,-rpath-link,/home/ray/repo/drm/build/ -Wl,--start-group libdrm.so.2.125.0 tests/util/libutil.a -lm -pthread /usr/lib/x86_64-linux-gnu/libcairo.so -Wl,--end-group
/usr/bin/ld: tests/util/libutil.a.p/pattern.c.o: in function `check_yuv':
/home/ray/repo/drm/build/../tests/util/pattern.c:1989: undefined reference to `is_power_of_two'
/usr/bin/ld: /home/ray/repo/drm/build/../tests/util/pattern.c:1990: undefined reference to `is_power_of_two'
/usr/bin/ld: /home/ray/repo/drm/build/../tests/util/pattern.c:1991: undefined reference to `is_power_of_two'
collect2: error: ld returned 1 exit status
Signed-off-by: Huang Rui <ray.huang@amd.com>
-rw-r--r-- | tests/util/pattern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/util/pattern.c b/tests/util/pattern.c index 30284dc3..358699a4 100644 --- a/tests/util/pattern.c +++ b/tests/util/pattern.c @@ -1978,7 +1978,7 @@ static void insert_value_yuv_planar(const struct util_format_info *info, v_mem[x/xsub*cs] = val.v; } -inline bool is_power_of_two(unsigned long val) +static inline bool is_power_of_two(unsigned long val) { return (val != 0) && ((val & (val - 1)) == 0); } |