staging: gpib: Using struct gpib_serial_poll_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:47 +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_serial_poll_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-6-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 1df833127846d45c82d5358f8d67476dc636ced6..4e93d1c7e3d6d951ff837630403f7528316ef10f 100644 (file)
@@ -1289,7 +1289,7 @@ static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigne
 
 static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg)
 {
-       serial_poll_ioctl_t serial_cmd;
+       struct gpib_serial_poll_ioctl serial_cmd;
        int retval;
 
        retval = copy_from_user(&serial_cmd, (void __user *)arg, sizeof(serial_cmd));
index 6ea6114ae78aadc50515c2e97f7d2c6eb2e36947..9be3262271c501457b66070d6775901200c32a63 100644 (file)
@@ -36,11 +36,11 @@ struct gpib_close_dev_ioctl {
        unsigned int handle;
 };
 
-typedef struct {
+struct gpib_serial_poll_ioctl {
        unsigned int pad;
        int sad;
        uint8_t status_byte;
-} serial_poll_ioctl_t;
+};
 
 typedef struct {
        int eos;
@@ -137,7 +137,7 @@ enum gpib_ioctl {
        IBPAD = _IOW(GPIB_CODE, 15, pad_ioctl_t),
        IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t),
        IBTMO = _IOW(GPIB_CODE, 17, unsigned int),
-       IBRSP = _IOWR(GPIB_CODE, 18, serial_poll_ioctl_t),
+       IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
        IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t),
        IBRSV = _IOW(GPIB_CODE, 20, uint8_t),
        CFCBASE = _IOW(GPIB_CODE, 21, uint64_t),