]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: gpib: Using struct gpib_spoll_bytes_ioctl
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:51 +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_spoll_bytes_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-10-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 a8189f296cf9150cf56b2bd99e7a72a29d070cd3..25d9e885ec00304461e14abb9aec96826e880f55 100644 (file)
@@ -1095,7 +1095,7 @@ static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *b
 static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg)
 {
        struct gpib_status_queue *device;
-       spoll_bytes_ioctl_t cmd;
+       struct gpib_spoll_bytes_ioctl cmd;
        int retval;
 
        retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
index dab170b09764bf3661e34a53859a53e91a84654f..e3d167edfd694dbd9110353c1cc47ef620eb490e 100644 (file)
@@ -64,11 +64,11 @@ struct gpib_online_ioctl {
        int online;
 };
 
-typedef struct {
+struct gpib_spoll_bytes_ioctl {
        unsigned int num_bytes;
        unsigned int pad;
        int sad;
-} spoll_bytes_ioctl_t;
+};
 
 typedef struct {
        unsigned int pad;
@@ -146,7 +146,7 @@ enum gpib_ioctl {
        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),
+       IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl),
        IBPPC = _IOW(GPIB_CODE, 28, ppoll_config_ioctl_t),
        IBBOARD_INFO = _IOR(GPIB_CODE, 29, board_info_ioctl_t),