From 8c545a6528a5d9a605ffeb88518715bd1dc8c123 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 24 Sep 2025 16:42:46 +0200 Subject: [PATCH] xkb: inline SProcXkbGetDeviceInfo() No need to have whole extra functions for just a few LoC. Signed-off-by: Enrico Weigelt, metux IT consult --- xkb/xkb.c | 13 ++++++++++--- xkb/xkbSwap.c | 14 +------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 29e8b4e425..d6838d408c 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -6198,15 +6198,22 @@ FillDeviceLedFBs(DeviceIntPtr dev, int class, int id, unsigned wantLength, int ProcXkbGetDeviceInfo(ClientPtr client) { + REQUEST(xkbGetDeviceInfoReq); + REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); + + if (client->swapped) { + swaps(&stuff->deviceSpec); + swaps(&stuff->wanted); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); + } + DeviceIntPtr dev; int status; unsigned length, nameLen; CARD16 ledClass, ledID; unsigned wanted; - REQUEST(xkbGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); - if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index b6962ccab7..a79b1aff3e 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -363,18 +363,6 @@ SProcXkbGetKbdByName(ClientPtr client) return ProcXkbGetKbdByName(client); } -static int _X_COLD -SProcXkbGetDeviceInfo(ClientPtr client) -{ - REQUEST(xkbGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); - swaps(&stuff->deviceSpec); - swaps(&stuff->wanted); - swaps(&stuff->ledClass); - swaps(&stuff->ledID); - return ProcXkbGetDeviceInfo(client); -} - static int _X_COLD SProcXkbSetDeviceInfo(ClientPtr client) { @@ -451,7 +439,7 @@ SProcXkbDispatch(ClientPtr client) case X_kbGetKbdByName: return SProcXkbGetKbdByName(client); case X_kbGetDeviceInfo: - return SProcXkbGetDeviceInfo(client); + return ProcXkbGetDeviceInfo(client); case X_kbSetDeviceInfo: return SProcXkbSetDeviceInfo(client); case X_kbSetDebuggingFlags: