[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKeQV4EeNgfIsX_k@google.com>
Date: Thu, 21 Aug 2025 21:32:07 +0000
From: Carlos Llamas <cmllamas@...gle.com>
To: Lucas De Marchi <lucas.demarchi@...el.com>
Cc: 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>, kernel-team@...roid.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()
On Thu, Aug 21, 2025 at 04:00:33PM -0500, Lucas De Marchi wrote:
>
> IMO the POSIX version is horrible. Let's add a xbasename() in this
> xe_gen_wa_oob.c and use it:
>
> /*
> * Avoid the libgen.h vs string.h differences or lack thereof, just use
> * our own.
> */
> static const char *xbasename(const char *s)
> {
> const char *p = strrchr(s, '/');
> return p ? p + 1 : s;
> }
>
> static int fn_to_prefix(const char *fn, char *prefix, size_t size)
> {
> ...
> fn = xbasename(fn);
> ...
> }
>
Sounds good. Would you mind if I use __basename()? I'll send the v2 in a
bit.
Powered by blists - more mailing lists