From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: staging: fbtft: replace -1 with proper error codes
Date: Tue, 03 Mar 2026 14:07:12 +1000 [thread overview]
Message-ID: <review-patch1-20260228202701.43337-1-officialsohamkute@gmail.com> (raw)
In-Reply-To: <20260228202701.43337-1-officialsohamkute@gmail.com>
Patch Review
**Positive aspects:**
- The commit message is clear and enumerates each error code choice with its rationale.
- The Signed-off-by is present.
- The diff is minimal and focused — no unrelated changes.
**Error code review:**
1. **`fb_ra8875.c:write_spi()` — `-1` → `-ENODEV`**: Correct. The SPI device being NULL means the device is not available.
2. **`fb_ra8875.c:init_display()` — `-1` → `-EINVAL`**: Correct. An unsupported display resolution is an invalid parameter/configuration.
3. **`fbtft-io.c:fbtft_write_spi()` — `-1` → `-ENODEV`**: Correct. Same SPI NULL case as above, consistent choice.
4. **`fbtft-io.c:fbtft_write_gpio16_wr_latched()` — `-1` → `-EOPNOTSUPP`**: Correct. Function is a stub, `-EOPNOTSUPP` is the right code.
5. **`fbtft-bus.c:fbtft_write_vmem8_bus8()` — `-1` → `-EOPNOTSUPP`**: Correct. Same unimplemented stub pattern.
6. **`fbtft-bus.c:fbtft_write_vmem16_bus9()` — `-1` → `-EINVAL`** for `txbuf.buf` being NULL: This is **debatable**. Looking at the code, `txbuf.buf` is allocated via `kzalloc()` during probe in `fbtft-core.c:670`. If it's NULL here at runtime, it's not because the caller passed an invalid argument — it's because the buffer was never allocated (either `txbuflen` was 0, or allocation failed and was silently handled). `-ENOMEM` might be slightly more accurate, but one could also argue this is an internal state error best expressed as `-EINVAL`. It's a minor point and not worth blocking over.
**Nit:** The commit subject could be slightly more specific (e.g., `staging: fbtft: replace bare -1 returns with standard error codes`), but the current subject is acceptable.
**Verdict:** The patch is clean and correct. The only point worth raising to the author is whether `-ENOMEM` would be more appropriate than `-EINVAL` for the `txbuf.buf` NULL case in `fbtft_write_vmem16_bus9()`, since the NULL condition results from a missing buffer allocation rather than an invalid argument from the caller.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-03 4:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 20:27 [PATCH] staging: fbtft: replace -1 with proper error codes Soham Kute
2026-03-03 4:07 ` Claude review: " Claude Code Review Bot
2026-03-03 4:07 ` Claude Code Review Bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-20260228202701.43337-1-officialsohamkute@gmail.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox