On 9/24/2025 5:54 PM, Andi Shyti wrote:
Hi Ankit,
+/**
+ * REG_FIELD_MAX() - produce the maximum value representable by a field
+ * @__mask: shifted mask defining the field's length and position
+ *
+ * Local wrapper for FIELD_MAX() to return the maximum bit value that can
+ * be held in the field specified by @_mask, cast to u32 for consistency
+ * with other macros.
+ */
+#define REG_FIELD_MAX(__mask) ((u32)FIELD_MAX(__mask))
I'm not a big fan of these generic definitions inside i915. These
should all go to bitfield.h. But this is how it's done here. For
now:
Reviewed-by: Andi Shyti <[email protected]>
Thanks Andi, I added REG_FIELD_MAX() for consistency with other
REG_FIELD_* macros already used in i915.
Since FIELD_MAX is already in bitfield.h, but perhaps it would be worth
considering typed variants like FIELD_MAX_U32() or FIELD_MAX_U64() for
broader use.
Thanks again for the review.
Regards,
Ankit
Thanks,
Andi