summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Rubin <matchstick@neverthere.org>2025-04-09 08:58:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-15 17:46:09 +0300
commit1b462bf26c1e92e6abbe60ec26bc50368306642a (patch)
tree5ff2e5fa0a4dd0d36806aefb7777bb13fbc1c872
parentd178bc14c9281f616ef98f76b4859928e81dcece (diff)
downloadlinux-1b462bf26c1e92e6abbe60ec26bc50368306642a.tar.xz
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 <matchstick@neverthere.org> Link: https://lore.kernel.org/r/20250409055903.321438-16-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/gpib/common/gpib_os.c7
-rw-r--r--drivers/staging/gpib/uapi/gpib_ioctl.h6
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index ceaf9cc93233..b47a5078c493 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 a0fbc660ab99..473b09d4efaa 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)
};