]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: gpib: Using struct gpib_request_service2
authorMichael Rubin <matchstick@neverthere.org>
Wed, 9 Apr 2025 05:58:58 +0000 (05:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:46:09 +0000 (16:46 +0200)
Using Linux code style for 'struct gpib_request_service2' 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-17-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 b47a5078c493c043cb38302f0348e933b1af213f..6cad9e1879faaadc3666bbc1226be72edbfc83ae 100644 (file)
@@ -1532,11 +1532,11 @@ static int request_service_ioctl(struct gpib_board *board, unsigned long arg)
 
 static int request_service2_ioctl(struct gpib_board *board, unsigned long arg)
 {
-       request_service2_t request_service2_cmd;
+       struct gpib_request_service2 request_service2_cmd;
        int retval;
 
        retval = copy_from_user(&request_service2_cmd, (void __user *)arg,
-                               sizeof(request_service2_t));
+                               sizeof(struct gpib_request_service2));
        if (retval)
                return -EFAULT;
 
index 473b09d4efaa7b5a4dce16353e895cdde0ee8861..eea169a0ba4071eea72912116a59c9c6f98d42d5 100644 (file)
@@ -114,10 +114,10 @@ typedef short autospoll_ioctl_t;
 typedef short local_ppoll_mode_ioctl_t;
 
 // update status byte and request service
-typedef struct {
+struct gpib_request_service2 {
        uint8_t status_byte;
        int new_reason_for_service;
-} request_service2_t;
+};
 
 /* Standard functions. */
 enum gpib_ioctl {
@@ -163,7 +163,7 @@ enum gpib_ioctl {
        IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t),
        IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl),
        // 44 was IBSELECT_SERIAL_NUMBER
-       IBRSV2 = _IOW(GPIB_CODE, 45, request_service2_t)
+       IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2)
 };
 
 #endif /* _GPIB_IOCTL_H */