Commit c71ecb42 authored by Carlos Llamas's avatar Carlos Llamas Committed by Treehugger Robot
Browse files

FROMLIST: drm/xe: replace basename() with portable strrchr()



Commit b0a2ee55 ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
introduced a call to basename(). The GNU version of this function is not
portable and fails to build with alternative libc implementations like
musl or bionic. This causes the following build error:

  drivers/gpu/drm/xe/xe_gen_wa_oob.c:130:12: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    130 |         fn = basename(fn);
        |            ^

While a POSIX version of basename() could be used, it would require a
separate header plus the behavior differs from GNU version in that it
might modify its argument. Not great.

Instead replace basename() with a strrchr() based implementation which
provides the same functionality and avoid portability issues.

Fixes: b0a2ee55 ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>

Link: https://lore.kernel.org/all/20250820201612.2549797-1-cmllamas@google.com/


Change-Id: Icb43fd8af1fe25dd8828d3c6d20ec96d8768932f
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
parent 40226d79
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment