staging: gpib: Using struct gpib_close_dev_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:46 +0000 (05:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:46:08 +0000 (16:46 +0200)
Using Linux code style for 'struct gpib_close_dev_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-5-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 8a17e8bb3bd22f25c3b5e347734ba60abaaa85de..1df833127846d45c82d5358f8d67476dc636ced6 100644 (file)
@@ -1262,7 +1262,7 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned
 
 static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg)
 {
-       close_dev_ioctl_t cmd;
+       struct gpib_close_dev_ioctl cmd;
        struct gpib_file_private *file_priv = filep->private_data;
        int retval;
 
index cfd1afb36e4fe4247d0a94d68ea7e78c9b678b38..6ea6114ae78aadc50515c2e97f7d2c6eb2e36947 100644 (file)
@@ -32,9 +32,9 @@ struct gpib_open_dev_ioctl {
        unsigned is_board : 1;
 };
 
-typedef struct {
+struct gpib_close_dev_ioctl {
        unsigned int handle;
-} close_dev_ioctl_t;
+};
 
 typedef struct {
        unsigned int pad;
@@ -125,7 +125,7 @@ enum gpib_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, struct gpib_open_dev_ioctl),
-       IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t),
+       IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl),
        IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t),
        IBRPP = _IOWR(GPIB_CODE, 6, uint8_t),