Claude review: accel/qaic: fix incorrect counter check in RAS message decode

Claude Code Review Bot
2026-04-11T23:40:28Z

Patch Review

**Status: Looks good / Correct fix**

The bug is in `decode_ras_msg()` at `drivers/accel/qaic/qaic_ras.c:500,504`. The switch statement handles three RAS error types — `CE`, `UE`, and `UE_NF` — and each case should check its own counter against `UINT_MAX` before incrementing to prevent overflow. However, the `UE` and `UE_NF` cases both incorrectly check `ce_count`:

```c
case UE:
if (qdev->ce_count != UINT_MAX) // BUG: should be ue_count
qdev->ue_count++;
break;
case UE_NF:
if (qdev->ce_count != UINT_MAX) // BUG: should be ue_nf_count
qdev->ue_nf_count++;
break;
```

The fix correctly changes these to check the matching counter:

```c
case UE:
if (qdev->ue_count != UINT_MAX)
qdev->ue_count++;
break;
case UE_NF:
if (qdev->ue_nf_count != UINT_MAX)
qdev->ue_nf_count++;
break;
```

This is a textbook copy-paste error — the `CE` case was likely written first, and the guard condition was duplicated to `UE` and `UE_NF` without updating the variable name. The fix is minimal and obviously correct. The `Fixes:` tag is present and points to the commit that introduced the bug.

No concerns with this patch.

---
Generated by Claude Code Patch Reviewer