From cdcd482fa4c65f44751a0508bd22621fb6297d30 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 25 May 2024 23:05:53 +0200 Subject: [PATCH] libdm: use 'unsigned' for major minor Although linux uses 'dev_t' as 'unsigned long int' on 64bit, it's easier to print with just '%u' instead of '%lu'. --- libdm/misc/kdev_t.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdm/misc/kdev_t.h b/libdm/misc/kdev_t.h index 12780d273..eb48700e7 100644 --- a/libdm/misc/kdev_t.h +++ b/libdm/misc/kdev_t.h @@ -15,8 +15,8 @@ #ifndef _LIBDM_KDEV_H #define _LIBDM_KDEV_H -#define MAJOR(dev) ((dev & 0xfff00) >> 8) -#define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00)) +#define MAJOR(dev) (((unsigned)dev & 0xfff00) >> 8) +#define MINOR(dev) (((unsigned)dev & 0xff) | (((unsigned)dev >> 12) & 0xfff00)) #define MKDEV(ma,mi) (((dev_t)mi & 0xff) | ((dev_t)ma << 8) | (((dev_t)mi & ~0xff) << 12)) #endif