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/ast: Use constants for MCR registers Date: Wed, 25 Mar 2026 07:46:40 +1000 Message-ID: In-Reply-To: <20260323160407.245773-5-tzimmermann@suse.de> References: <20260323160407.245773-1-tzimmermann@suse.de> <20260323160407.245773-5-tzimmermann@suse.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the largest mechanical patch (~300 line changes in ast_2300.c alone). The conversion was done via grep+sed plus manual fixes, which is appropriate for this kind of bulk replacement. The register constant definitions in `ast_reg.h` are well-organized. Minor nit: In `set_mpll_2500()` there's a loop that still uses raw addresses: ```c for (addr = 0x1e6e0004; addr < 0x1e6e0090;) { ast_moutdwm(ast, addr, 0x0); addr += 4; } ``` This loop wasn't converted to use constants (it iterates through a range), which is fine - converting a loop like this would be awkward. One concern: in `ast_dp501.c`, the P2A bridge setup at `ast_init_analog()` and `ast_init_dvo()` writes `AST_REG_MCR00` to register `0xf004`. This is the P2A base register being set to the MCR base, but using the MCR constant name for the *value* written is semantically correct (the MCR base address happens to equal `AST_REG_MCR00`). However, in `ast_drv.c:ast_detect_chip()`, the same pattern `__ast_write32(regs, 0xf004, AST_REG_MCR00)` is used - where the intent is to set the P2A window base to the MCR region. Using `AST_REG_MCR00` as the *value* is technically correct but conceptually it's the base address being set. The later patches fix this by using `__ast_mindwm` which handles the segment setup internally. --- Generated by Claude Code Patch Reviewer