]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: switch to local xbasename() helper
authorCarlos Llamas <cmllamas@google.com>
Mon, 25 Aug 2025 15:57:42 +0000 (15:57 +0000)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 26 Aug 2025 05:04:26 +0000 (22:04 -0700)
commit41be792f5baaf90d744a9a9e82994ce560ca9582
treed59e3ab9317eb4e8f5afebed076c1d40024b2ed0
parentffdf968762e4fb3cdae54e811ec3525e67440a60
drm/xe: switch to local xbasename() helper

Commit b0a2ee5567ab ("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, implement a local xbasename() helper based on strrchr() that
provides the same functionality and avoids portability issues.

Fixes: b0a2ee5567ab ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Tiffany Yang <ynaffit@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250825155743.1132433-1-cmllamas@google.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gen_wa_oob.c