(1ULL << __bf_shf(_mask))); \
        })
 
+/**
+ * FIELD_MAX() - produce the maximum value representable by a field
+ * @_mask: shifted mask defining the field's length and position
+ *
+ * FIELD_MAX() returns the maximum value that can be held in the field
+ * specified by @_mask.
+ */
+#define FIELD_MAX(_mask)                                               \
+       ({                                                              \
+               __BF_FIELD_CHECK(_mask, 0ULL, 0ULL, "FIELD_MAX: ");     \
+               (typeof(_mask))((_mask) >> __bf_shf(_mask));            \
+       })
+
 /**
  * FIELD_FIT() - check if value fits in the field
  * @_mask: shifted mask defining the field's length and position
 {
        return field / field_multiplier(field);
 }
+#define field_max(field)       ((typeof(field))field_mask(field))
 #define ____MAKE_OP(type,base,to,from)                                 \
 static __always_inline __##type type##_encode_bits(base v, base field) \
 {                                                                      \