staging: gpib: Using struct gpib_board_type_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:43 +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_board_type_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-2-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 549a752af9500bcc0aed5dceb5e26a30a96dc143..64500e150d70802e6df8e45926da8e5989a54a4f 100644 (file)
@@ -813,7 +813,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv,
                            struct gpib_board *board, unsigned long arg)
 {
        struct list_head *list_ptr;
-       board_type_ioctl_t cmd;
+       struct gpib_board_type_ioctl cmd;
        int retval;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -821,7 +821,8 @@ static int board_type_ioctl(struct gpib_file_private *file_priv,
        if (board->online)
                return -EBUSY;
 
-       retval = copy_from_user(&cmd, (void __user *)arg, sizeof(board_type_ioctl_t));
+       retval = copy_from_user(&cmd, (void __user *)arg,
+                               sizeof(struct gpib_board_type_ioctl));
        if (retval)
                return retval;
 
index 6202865278ea7c9bf858d79b2bf2d84e8a662499..4ddcbc2a81b0f1ae40bb0e1c84e242b28e29d6c6 100644 (file)
@@ -12,9 +12,9 @@
 
 #define GPIB_CODE 160
 
-typedef struct {
+struct gpib_board_type_ioctl {
        char name[100];
-} board_type_ioctl_t;
+};
 
 /* argument for read/write/command ioctls */
 typedef struct {
@@ -143,7 +143,7 @@ enum gpib_ioctl {
        CFCBASE = _IOW(GPIB_CODE, 21, uint64_t),
        CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int),
        CFCDMA = _IOW(GPIB_CODE, 23, unsigned int),
-       CFCBOARDTYPE = _IOW(GPIB_CODE, 24, board_type_ioctl_t),
+       CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl),
 
        IBMUTEX = _IOW(GPIB_CODE, 26, int),
        IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, spoll_bytes_ioctl_t),