From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: zorro: Simplify storing pointers in device id struct Date: Wed, 27 May 2026 14:47:33 +1000 Message-ID: In-Reply-To: <49576a7501128c93ef318566ed7faefce163f1fd.1779803053.git.u.kleine-koenig@baylibre.com> References: <49576a7501128c93ef318566ed7faefce163f1fd.1779803053.git.u.kleine-koenig@baylibre.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Status: Looks good.** The core change in `include/linux/mod_devicetable.h`: ```c struct zorro_device_id { __u32 id; /* Device ID or ZORRO_WILDCARD */ - kernel_ulong_t driver_data; /* Data private to the driver */ + union { + /* Data private to the driver */ + kernel_ulong_t driver_data; + const void *driver_data_ptr; + }; }; ``` This is clean and backward compatible. Key observations: 1. **Union sizing:** `kernel_ulong_t` is `unsigned long long` on 32-bit arc= hes (for cross-compilation with file2alias), so the union is at least 8 byt= es. On all current architectures, `sizeof(void *)` <=3D `sizeof(kernel_ulon= g_t)`, so the union doesn't change struct size or layout. On CHERI, pointer= s would be larger, but that's exactly the scenario this enables. 2. **Anonymous union:** Correct choice =E2=80=94 it allows `ent->driver_dat= a` and `ent->driver_data_ptr` to be used interchangeably without changing a= ny syntax at call sites. 3. **Backward compatibility:** All existing users that set `.driver_data = =3D (unsigned long)&foo` continue to compile and work. The patches 7 and 8 = then convert them to `.driver_data_ptr` at their own pace. This is the righ= t incremental approach. 4. **const correctness:** Using `const void *` is appropriate =E2=80=94 it = preserves const-ness of the pointed-to data, which the `(unsigned long)` ca= st was losing. One minor note: the commit message says "no adaptions are needed" for exist= ing users =E2=80=94 this is correct because all current initializers use `.= driver_data =3D ...` named syntax or positional syntax that maps to `.id` (= the first field), and `driver_data` remains accessible at the same name. No concerns. --- Generated by Claude Code Patch Reviewer