From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:57 +0000 (+0000) Subject: staging: gpib: Using gpib_select_device_path_ioctl X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1b462bf26c1e92e6abbe60ec26bc50368306642a;p=users%2Fdwmw2%2Flinux.git staging: gpib: Using gpib_select_device_path_ioctl Using Linux code style for 'struct gpib_select_device_path_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 Link: https://lore.kernel.org/r/20250409055903.321438-16-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index ceaf9cc93233a..b47a5078c493c 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1815,17 +1815,18 @@ static int select_pci_ioctl(struct gpib_board_config *config, unsigned long arg) static int select_device_path_ioctl(struct gpib_board_config *config, unsigned long arg) { - select_device_path_ioctl_t *selection; + struct gpib_select_device_path_ioctl *selection; int retval; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - selection = vmalloc(sizeof(select_device_path_ioctl_t)); + selection = vmalloc(sizeof(struct gpib_select_device_path_ioctl)); if (!selection) return -ENOMEM; - retval = copy_from_user(selection, (void __user *)arg, sizeof(select_device_path_ioctl_t)); + retval = copy_from_user(selection, (void __user *)arg, + sizeof(struct gpib_select_device_path_ioctl)); if (retval) { vfree(selection); return -EFAULT; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index a0fbc660ab996..473b09d4efaa7 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -103,9 +103,9 @@ struct gpib_sad_ioctl { }; // select a piece of hardware to attach by its sysfs device path -typedef struct { +struct gpib_select_device_path_ioctl { char device_path[0x1000]; -} select_device_path_ioctl_t; +}; typedef short event_ioctl_t; typedef int rsc_ioctl_t; @@ -161,7 +161,7 @@ enum gpib_ioctl { IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), IBPP2_SET = _IOW(GPIB_CODE, 40, local_ppoll_mode_ioctl_t), IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), - IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, select_device_path_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) };