staging: gpib: Using struct gpib_eos_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:48 +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_eos_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-7-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 4e93d1c7e3d6d951ff837630403f7528316ef10f..7c6f764a625374420480a45a268c0a45036fbaae 100644 (file)
@@ -1508,7 +1508,7 @@ static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_pr
 
 static int eos_ioctl(struct gpib_board *board, unsigned long arg)
 {
-       eos_ioctl_t eos_cmd;
+       struct gpib_eos_ioctl eos_cmd;
        int retval;
 
        retval = copy_from_user(&eos_cmd, (void __user *)arg, sizeof(eos_cmd));
index 9be3262271c501457b66070d6775901200c32a63..3f32eceaca932eb06aa8c18825ae80f13df1ef65 100644 (file)
@@ -42,10 +42,10 @@ struct gpib_serial_poll_ioctl {
        uint8_t status_byte;
 };
 
-typedef struct {
+struct gpib_eos_ioctl {
        int eos;
        int eos_flags;
-} eos_ioctl_t;
+};
 
 typedef struct {
        int handle;
@@ -138,7 +138,7 @@ enum gpib_ioctl {
        IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t),
        IBTMO = _IOW(GPIB_CODE, 17, unsigned int),
        IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
-       IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t),
+       IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl),
        IBRSV = _IOW(GPIB_CODE, 20, uint8_t),
        CFCBASE = _IOW(GPIB_CODE, 21, uint64_t),
        CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int),