Merge tag 'fsnotify_for_v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / kernel / bpf / tnum.c
index d4f335a..ceac528 100644 (file)
@@ -194,3 +194,18 @@ int tnum_sbin(char *str, size_t size, struct tnum a)
        str[min(size - 1, (size_t)64)] = 0;
        return 64;
 }
+
+struct tnum tnum_subreg(struct tnum a)
+{
+       return tnum_cast(a, 4);
+}
+
+struct tnum tnum_clear_subreg(struct tnum a)
+{
+       return tnum_lshift(tnum_rshift(a, 32), 32);
+}
+
+struct tnum tnum_const_subreg(struct tnum a, u32 value)
+{
+       return tnum_or(tnum_clear_subreg(a), tnum_const(value));
+}