gbm: Replace VER_MIN with common MIN2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41290>
This commit is contained in:
Karmjit Mahil 2026-04-30 13:00:11 +01:00 committed by Marge Bot
parent dab24c34dd
commit ee5daf590b

View file

@ -36,12 +36,11 @@
#include <dlfcn.h>
#include <xf86drm.h>
#include "util/os_misc.h"
#include "util/macros.h"
#include "loader.h"
#include "backend.h"
#define VER_MIN(a, b) ((a) < (b) ? (a) : (b))
struct gbm_backend_desc {
const char *name;
const struct gbm_backend *backend;
@ -90,8 +89,8 @@ create_backend_desc(const char *name,
static struct gbm_device *
backend_create_device(const struct gbm_backend_desc *bd, int fd)
{
const uint32_t abi_ver = VER_MIN(GBM_BACKEND_ABI_VERSION,
bd->backend->v0.backend_version);
const uint32_t abi_ver = MIN2(GBM_BACKEND_ABI_VERSION,
bd->backend->v0.backend_version);
struct gbm_device *dev = bd->backend->v0.create_device(fd, abi_ver);
if (dev) {