public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v1] dma-buf: Include ioctl.h in UAPI header
@ 2026-03-03  0:23 Isaac J. Manjarres
  2026-03-03  1:45 ` T.J. Mercier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Isaac J. Manjarres @ 2026-03-03  0:23 UTC (permalink / raw)
  To: christian.koenig, sumit.semwal
  Cc: linux-kernel, tjmercier, linux-media, dri-devel,
	Isaac J. Manjarres, kernel-team

include/uapi/linux/dma-buf.h uses several macros from ioctl.h to define
its ioctl commands. However, it does not include ioctl.h itself. So,
if userspace source code tries to include the dma-buf.h file without
including ioctl.h, it can result in build failures.

Therefore, include ioctl.h in the dma-buf UAPI header.

Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
---
 include/uapi/linux/dma-buf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h
index 5a6fda66d9ad..e827c9d20c5d 100644
--- a/include/uapi/linux/dma-buf.h
+++ b/include/uapi/linux/dma-buf.h
@@ -20,6 +20,7 @@
 #ifndef _DMA_BUF_UAPI_H_
 #define _DMA_BUF_UAPI_H_
 
+#include <linux/ioctl.h>
 #include <linux/types.h>
 
 /**
-- 
2.53.0.473.g4a7958ca14-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dma-buf: Include ioctl.h in UAPI header
  2026-03-03  0:23 [PATCH v1] dma-buf: Include ioctl.h in UAPI header Isaac J. Manjarres
@ 2026-03-03  1:45 ` T.J. Mercier
  2026-03-03  2:44 ` Claude review: " Claude Code Review Bot
  2026-03-03  2:44 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: T.J. Mercier @ 2026-03-03  1:45 UTC (permalink / raw)
  To: Isaac J. Manjarres
  Cc: christian.koenig, sumit.semwal, linux-kernel, linux-media,
	dri-devel, kernel-team

On Mon, Mar 2, 2026 at 4:23 PM Isaac J. Manjarres
<isaacmanjarres@google.com> wrote:
>
> include/uapi/linux/dma-buf.h uses several macros from ioctl.h to define
> its ioctl commands. However, it does not include ioctl.h itself. So,
> if userspace source code tries to include the dma-buf.h file without
> including ioctl.h, it can result in build failures.
>
> Therefore, include ioctl.h in the dma-buf UAPI header.
>
> Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>

Reviewed-by: T.J. Mercier <tjmercier@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: dma-buf: Include ioctl.h in UAPI header
  2026-03-03  0:23 [PATCH v1] dma-buf: Include ioctl.h in UAPI header Isaac J. Manjarres
  2026-03-03  1:45 ` T.J. Mercier
@ 2026-03-03  2:44 ` Claude Code Review Bot
  2026-03-03  2:44 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-03  2:44 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: dma-buf: Include ioctl.h in UAPI header
Author: "Isaac J. Manjarres" <isaacmanjarres@google.com>
Patches: 2
Reviewed: 2026-03-03T12:44:01.978349

---

This is a single, straightforward patch that adds a missing `#include <linux/ioctl.h>` to the `include/uapi/linux/dma-buf.h` UAPI header. The fix is correct and well-motivated. The header uses `_IOW()` and `_IOWR()` macros (lines 171, 176-180 in the current tree) which are defined through `<linux/ioctl.h>`, but never includes that header. This means userspace programs that include `<linux/dma-buf.h>` without separately including `<linux/ioctl.h>` will get build failures due to undefined macros.

UAPI headers should be self-contained so that userspace can include them independently. This is a well-established kernel convention. The fix is minimal, correct, and low-risk.

**Verdict: Looks good. No issues found.**

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: dma-buf: Include ioctl.h in UAPI header
  2026-03-03  0:23 [PATCH v1] dma-buf: Include ioctl.h in UAPI header Isaac J. Manjarres
  2026-03-03  1:45 ` T.J. Mercier
  2026-03-03  2:44 ` Claude review: " Claude Code Review Bot
@ 2026-03-03  2:44 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-03-03  2:44 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Correctness:** The patch is correct. The file uses `_IOW` and `_IOWR` macros:

```c
#define DMA_BUF_IOCTL_SYNC	_IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
#define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, __u32)
#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, __u64)
#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE	_IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file)
#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE	_IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file)
```

These macros are provided by `<linux/ioctl.h>`, which is not currently included.

**Placement:** The new include is added before the existing `#include <linux/types.h>`, maintaining alphabetical order. Good.

```c
+#include <linux/ioctl.h>
 #include <linux/types.h>
```

**Commit message:** Clear and concise. Accurately describes the problem and the fix.

**Risk:** Essentially zero. Adding a missing include to a UAPI header cannot break existing users (they must have been including `<linux/ioctl.h>` themselves, either directly or transitively). It only fixes the case where they weren't.

**Reviewed-by worthy:** Yes. No concerns.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-03  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03  0:23 [PATCH v1] dma-buf: Include ioctl.h in UAPI header Isaac J. Manjarres
2026-03-03  1:45 ` T.J. Mercier
2026-03-03  2:44 ` Claude review: " Claude Code Review Bot
2026-03-03  2:44 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox