diff options
| author | Petr Mladek <pmladek@suse.com> | 2020-06-01 10:15:16 +0200 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2020-06-01 10:15:16 +0200 |
| commit | d053cf0d771f6547cb0537759a9af63cf402908d (patch) | |
| tree | df61806e45c6cf7e9cdd0b271f959f0962f8623e /include/linux/tnum.h | |
| parent | 6a0af9fc8ccef5304ef88dc7e27362732e047076 (diff) | |
| parent | eb012d125a2419786f5bcaaf8a901babc7b6e3d7 (diff) | |
Merge branch 'for-5.8' into for-linus
Diffstat (limited to 'include/linux/tnum.h')
| -rw-r--r-- | include/linux/tnum.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/tnum.h b/include/linux/tnum.h index ea627d1ab7e3..498dbcedb451 100644 --- a/include/linux/tnum.h +++ b/include/linux/tnum.h @@ -86,4 +86,16 @@ int tnum_strn(char *str, size_t size, struct tnum a); /* Format a tnum as tristate binary expansion */ int tnum_sbin(char *str, size_t size, struct tnum a); +/* Returns the 32-bit subreg */ +struct tnum tnum_subreg(struct tnum a); +/* Returns the tnum with the lower 32-bit subreg cleared */ +struct tnum tnum_clear_subreg(struct tnum a); +/* Returns the tnum with the lower 32-bit subreg set to value */ +struct tnum tnum_const_subreg(struct tnum a, u32 value); +/* Returns true if 32-bit subreg @a is a known constant*/ +static inline bool tnum_subreg_is_const(struct tnum a) +{ + return !(tnum_subreg(a)).mask; +} + #endif /* _LINUX_TNUM_H */ |
