1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

Kernel: Make makedev()/minor()/major() static

This was originally done in 7274037 and for some reason reverted in
740140a.

This avoids "multiple definitions" link errors and fixes the libuv port.
This commit is contained in:
Itamar 2021-08-16 23:06:49 +03:00 committed by Andreas Kling
parent 0fba71a655
commit f3aa87c436

View file

@ -92,9 +92,9 @@ typedef struct __pthread_condattr_t {
int clockid; // clockid_t
} pthread_condattr_t;
inline dev_t makedev(unsigned major, unsigned minor) { return (minor & 0xffu) | (major << 8u) | ((minor & ~0xffu) << 12u); }
inline unsigned int major(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
inline unsigned int minor(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
static inline dev_t makedev(unsigned major, unsigned minor) { return (minor & 0xffu) | (major << 8u) | ((minor & ~0xffu) << 12u); }
static inline unsigned int major(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
static inline unsigned int minor(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
#ifdef __cplusplus
}