Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] rust: uapi: replace direct asm-generic/ioctl.h include with linux/ioctl.h
@ 2026-08-08  3:21 Mukesh Kumar Chaurasiya (IBM)
  2026-08-10 15:29 ` Miguel Ojeda
  0 siblings, 1 reply; 2+ messages in thread
From: Mukesh Kumar Chaurasiya (IBM) @ 2026-08-08  3:21 UTC (permalink / raw)
  To: ojeda, boqun, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, daniel.almeida, tamird, acourbot, work, nathan,
	ndesaulniers, morbo, justinstitt, wedsonaf, mattgilbride,
	boris.brezillon, robh, rust-for-linux, linux-kernel, llvm
  Cc: Mukesh Kumar Chaurasiya (IBM), kernel test robot

rust/uapi/uapi_helper.h was directly including <uapi/asm-generic/ioctl.h>
instead of the proper <uapi/linux/ioctl.h>.

On powerpc, <uapi/linux/ioctl.h> pulls in <uapi/asm/ioctl.h> first, which
defines _IOC_SIZEBITS, _IOC_DIRBITS, _IOC_NONE, and _IOC_WRITE with the
arch-specific values, before falling through to <asm-generic/ioctl.h>.
By bypassing that chain and including <asm-generic/ioctl.h> directly,
the arch-specific overrides never ran first, so when other headers in
the compilation later brought in the full arch-aware chain, Clang saw
those four macros being defined a second time and emitted:

  uapi/asm-generic/ioctl.h: warning: '_IOC_SIZEBITS' macro redefined
  uapi/asm-generic/ioctl.h: warning: '_IOC_DIRBITS' macro redefined
  uapi/asm-generic/ioctl.h: warning: '_IOC_NONE' macro redefined
  uapi/asm-generic/ioctl.h: warning: '_IOC_WRITE' macro redefined

Fix this by replacing the direct include of <uapi/asm-generic/ioctl.h>
with <uapi/linux/ioctl.h>, which is the correct arch-aware entry point
and already maintains the intended include order.

Applies on linux-next.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608050618.9dekfjtF-lkp@intel.com/
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
---
 rust/uapi/uapi_helper.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/uapi/uapi_helper.h b/rust/uapi/uapi_helper.h
index 86c7b6b284b0..489748ef642c 100644
--- a/rust/uapi/uapi_helper.h
+++ b/rust/uapi/uapi_helper.h
@@ -6,12 +6,12 @@
  * Sorted alphabetically.
  */
 
-#include <uapi/asm-generic/ioctl.h>
 #include <uapi/drm/drm.h>
 #include <uapi/drm/nova_drm.h>
 #include <uapi/drm/panthor_drm.h>
 #include <uapi/linux/android/binder.h>
 #include <uapi/linux/android/binder_netlink.h>
+#include <uapi/linux/ioctl.h>
 #include <uapi/linux/mdio.h>
 #include <uapi/linux/mii.h>
 #include <uapi/linux/ethtool.h>
-- 
2.55.0


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

* Re: [PATCH] rust: uapi: replace direct asm-generic/ioctl.h include with linux/ioctl.h
  2026-08-08  3:21 [PATCH] rust: uapi: replace direct asm-generic/ioctl.h include with linux/ioctl.h Mukesh Kumar Chaurasiya (IBM)
@ 2026-08-10 15:29 ` Miguel Ojeda
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda @ 2026-08-10 15:29 UTC (permalink / raw)
  To: Mukesh Kumar Chaurasiya (IBM)
  Cc: ojeda, boqun, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, daniel.almeida, tamird, acourbot, work, nathan,
	ndesaulniers, morbo, justinstitt, wedsonaf, mattgilbride,
	boris.brezillon, robh, rust-for-linux, linux-kernel, llvm,
	kernel test robot

On Sat, Aug 8, 2026 at 5:22 AM Mukesh Kumar Chaurasiya (IBM)
<mkchauras@gmail.com> wrote:
>
>   uapi/asm-generic/ioctl.h: warning: '_IOC_SIZEBITS' macro redefined
>   uapi/asm-generic/ioctl.h: warning: '_IOC_DIRBITS' macro redefined
>   uapi/asm-generic/ioctl.h: warning: '_IOC_NONE' macro redefined
>   uapi/asm-generic/ioctl.h: warning: '_IOC_WRITE' macro redefined

Thanks for the patch! I can pick this one up.

I am wondering: the quoted warnings were shortened intentionally,
right? i.e. I saw longer paths when I reproduced this.

If so, then we could put the full ones (at least personally I prefer
that, even if it goes over the line length, because I want that it is
easy to search for, to avoid edit mistakes etc.)

> Applies on linux-next.

This would normally go below the `---` line, i.e. outside the commit
message (and ideally use `git format-patch --base` to provide the base
commit too).

Thanks!

Cheers,
Miguel

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

end of thread, other threads:[~2026-08-10 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08  3:21 [PATCH] rust: uapi: replace direct asm-generic/ioctl.h include with linux/ioctl.h Mukesh Kumar Chaurasiya (IBM)
2026-08-10 15:29 ` Miguel Ojeda

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