[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dbx8a53t7kva.fsf@ynaffit-alt.c.googlers.com>
Date: Wed, 20 Aug 2025 14:18:17 -0700
From: Tiffany Yang <ynaffit@...gle.com>
To: "'Carlos Llamas' via kernel-team" <kernel-team@...roid.com>
Cc: Lucas De Marchi <lucas.demarchi@...el.com>,
"Thomas Hellström" <thomas.hellstrom@...ux.intel.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Matt Atwood <matthew.s.atwood@...el.com>, Carlos Llamas <cmllamas@...gle.com>,
linux-kernel@...r.kernel.org,
"open list:INTEL DRM XE DRIVER (Lunar Lake and newer)" <intel-xe@...ts.freedesktop.org>,
"open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/xe: replace basename() with portable strrchr()
"'Carlos Llamas' via kernel-team" <kernel-team@...roid.com> writes:
> 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 replace basename() with a strrchr() based implementation which
> provides the same functionality and avoid portability issues.
Nit: s/avoid/avoids. Other than that,
> Fixes: b0a2ee5567ab ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
> Signed-off-by: Carlos Llamas <cmllamas@...gle.com>
> ---
> drivers/gpu/drm/xe/xe_gen_wa_oob.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Tiffany Yang <ynaffit@...gle.com>
--
Tiffany Y. Yang
Powered by blists - more mailing lists