[PATCH v2 3/3] samples: rust_misc_device: Bump IOCTL numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use 0x90 as the IOCTL number base instead of 0x80, thus avoiding using the
same IOCTL numbers as the Media Controller. The change is also in line
with current IOCTL number documentation.

Also use 0xaf, belonging to the samples IOCTL number range, as the
unimplemented IOCTL.

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
---
 samples/rust/rust_misc_device.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/samples/rust/rust_misc_device.rs b/samples/rust/rust_misc_device.rs
index c881fd6dbd08..2bd017d7c7c3 100644
--- a/samples/rust/rust_misc_device.rs
+++ b/samples/rust/rust_misc_device.rs
@@ -14,10 +14,10 @@
 //! #include <unistd.h>
 //! #include <sys/ioctl.h>
 //!
-//! #define RUST_MISC_DEV_FAIL _IO('|', 0)
-//! #define RUST_MISC_DEV_HELLO _IO('|', 0x80)
-//! #define RUST_MISC_DEV_GET_VALUE _IOR('|', 0x81, int)
-//! #define RUST_MISC_DEV_SET_VALUE _IOW('|', 0x82, int)
+//! #define RUST_MISC_DEV_FAIL _IO('|', 0xaf)
+//! #define RUST_MISC_DEV_HELLO _IO('|', 0x90)
+//! #define RUST_MISC_DEV_GET_VALUE _IOR('|', 0x91, int)
+//! #define RUST_MISC_DEV_SET_VALUE _IOW('|', 0x92, int)
 //!
 //! int main() {
 //!   int value, new_value;
@@ -110,9 +110,9 @@
     uaccess::{UserSlice, UserSliceReader, UserSliceWriter},
 };
 
-const RUST_MISC_DEV_HELLO: u32 = _IO('|' as u32, 0x80);
-const RUST_MISC_DEV_GET_VALUE: u32 = _IOR::<i32>('|' as u32, 0x81);
-const RUST_MISC_DEV_SET_VALUE: u32 = _IOW::<i32>('|' as u32, 0x82);
+const RUST_MISC_DEV_HELLO: u32 = _IO('|' as u32, 0x90);
+const RUST_MISC_DEV_GET_VALUE: u32 = _IOR::<i32>('|' as u32, 0x91);
+const RUST_MISC_DEV_SET_VALUE: u32 = _IOW::<i32>('|' as u32, 0x92);
 
 module! {
     type: RustMiscDeviceModule,
-- 
2.39.5





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux