From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/blend: Get a rotation name from it's bitfield Date: Thu, 23 Apr 2026 07:30:11 +1000 Message-ID: In-Reply-To: <20260422-vkms-all-config-v4-2-dbb52e9aadc3@bootlin.com> References: <20260422-vkms-all-config-v4-0-dbb52e9aadc3@bootlin.com> <20260422-vkms-all-config-v4-2-dbb52e9aadc3@bootlin.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Bug: misleading API contract.** The doc says `@rotation: The rotation mask (DRM_MODE_ROTATE_* | DRM_MODE_REFLECT_*)` but the implementation uses `rotation` as an **array index** (bit position 0-5): ```c const char *drm_get_rotation_name(unsigned int rotation) { if (rotation < ARRAY_SIZE(rotation_props)) return rotation_props[rotation].name; return "(unknown)"; } ``` If a caller passes `DRM_MODE_ROTATE_90` (= `BIT(1)` = 2), they get `rotation_props[2].name` = `"rotate-180"`, not `"rotate-90"`. This works only because the sole caller (`show_bitfield` in patch 15) passes bit positions, not bitmask values. Since this is exported with `EXPORT_SYMBOL`, the misleading documentation will trip up other callers. Either rename the parameter to `bit_position` and fix the doc, or make the function accept actual bitmask values (e.g. use `ffs(rotation) - 1`). --- Generated by Claude Code Patch Reviewer