From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: bus: mhi: Expose DDR training data via controller sysfs Date: Mon, 09 Mar 2026 08:09:01 +1000 Message-ID: In-Reply-To: <20260307-sahara_protocol_new_v2-v2-8-29dc748b5e9c@oss.qualcomm.com> References: <20260307-sahara_protocol_new_v2-v2-0-29dc748b5e9c@oss.qualcomm.com> <20260307-sahara_protocol_new_v2-v2-8-29dc748b5e9c@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review - **`devres_alloc(..., 1, GFP_KERNEL)`** -- allocating 1 byte as a devres "cookie" is unusual. The size `1` is the minimum non-zero allocation, used as a tag. This works but is unconventional; typically you'd use `sizeof(void *)` or embed actual state. - **`device_create_bin_file` / `device_remove_bin_file` are deprecated** in favor of attribute groups attached at device registration time. For new code, using `sysfs_create_bin_file` or better yet, adding the attribute to the device's attribute group would be preferred. - **The `ddr_training_data_read` callback uses `.read` instead of `.read_new`** -- the `const struct bin_attribute` parameter type suggests this should use the newer callback signature, but the field name `.read` is the legacy one. Check if the kernel version requires `.read_new` for the const variant. - **No size set on `ddr_training_data_attr`** -- the `.size` field is 0, which means the sysfs file shows size 0 to userspace. While the read callback handles partial reads correctly, tools like `cp` or `cat` might behave unexpectedly with a 0-byte file. --- Generated by Claude Code Patch Reviewer