staging: gpib: Using struct gpib_read_write_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:44 +0000 (05:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:46:07 +0000 (16:46 +0200)
Using Linux code style for 'struct gpib_read_write_ioctl' to remove typedef.

Adhering to Linux code style.

Reported by checkpatch.pl

In general, a pointer, or a struct that has elements that can reasonably be
directly accessed should never be a typedef.

Signed-off-by: Michael Rubin <matchstick@neverthere.org>
Link: https://lore.kernel.org/r/20250409055903.321438-3-matchstick@neverthere.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/common/gpib_os.c
drivers/staging/gpib/uapi/gpib_ioctl.h

index 64500e150d70802e6df8e45926da8e5989a54a4f..dff0674cf31c93eba32efd036290f9ee8583b23f 100644 (file)
@@ -865,7 +865,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv,
 static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board,
                      unsigned long arg)
 {
-       read_write_ioctl_t read_cmd;
+       struct gpib_read_write_ioctl read_cmd;
        u8 __user *userbuf;
        unsigned long remain;
        int end_flag = 0;
@@ -940,7 +940,7 @@ static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *bo
 static int command_ioctl(struct gpib_file_private *file_priv,
                         struct gpib_board *board, unsigned long arg)
 {
-       read_write_ioctl_t cmd;
+       struct gpib_read_write_ioctl cmd;
        u8 __user *userbuf;
        unsigned long remain;
        int retval;
@@ -1024,7 +1024,7 @@ static int command_ioctl(struct gpib_file_private *file_priv,
 static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board,
                       unsigned long arg)
 {
-       read_write_ioctl_t write_cmd;
+       struct gpib_read_write_ioctl write_cmd;
        u8 __user *userbuf;
        unsigned long remain;
        int retval = 0;
index 4ddcbc2a81b0f1ae40bb0e1c84e242b28e29d6c6..15c924efe5bc64e79b51e2a1d8353b16ae34815b 100644 (file)
@@ -17,13 +17,13 @@ struct gpib_board_type_ioctl {
 };
 
 /* argument for read/write/command ioctls */
-typedef struct {
+struct gpib_read_write_ioctl {
        uint64_t buffer_ptr;
        unsigned int requested_transfer_count;
        unsigned int completed_transfer_count;
        int end; /* end flag return for reads, end io suppression request for cmd*/
        int handle;
-} read_write_ioctl_t;
+};
 
 typedef struct {
        unsigned int handle;
@@ -121,9 +121,9 @@ typedef struct {
 
 /* Standard functions. */
 enum gpib_ioctl {
-       IBRD = _IOWR(GPIB_CODE, 100, read_write_ioctl_t),
-       IBWRT = _IOWR(GPIB_CODE, 101, read_write_ioctl_t),
-       IBCMD = _IOWR(GPIB_CODE, 102, read_write_ioctl_t),
+       IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl),
+       IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl),
+       IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl),
        IBOPENDEV = _IOWR(GPIB_CODE, 3, open_dev_ioctl_t),
        IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t),
        IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t),