[Patch v1 08/21] staging: gpib: Using struct gpib_online_ioctl
From: Michael Rubin
Date: Wed Apr 09 2025 - 02:00:53 EST
Using Linux code style for 'struct gpib_online_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@xxxxxxxxxxxxxx>
---
drivers/staging/gpib/common/gpib_os.c | 2 +-
drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 6d0191c9f730..b215521d0ee5 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1353,7 +1353,7 @@ static int parallel_poll_ioctl(struct gpib_board *board, unsigned long arg)
static int online_ioctl(struct gpib_board *board, unsigned long arg)
{
- online_ioctl_t online_cmd;
+ struct gpib_online_ioctl online_cmd;
int retval;
void __user *init_data = NULL;
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 71c5e3d020bb..dab170b09764 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -58,11 +58,11 @@ struct gpib_wait_ioctl {
unsigned int usec_timeout;
};
-typedef struct {
+struct gpib_online_ioctl {
uint64_t init_data_ptr;
int init_data_length;
int online;
-} online_ioctl_t;
+};
typedef struct {
unsigned int num_bytes;
@@ -158,7 +158,7 @@ enum gpib_ioctl {
IBLOC = _IO(GPIB_CODE, 36),
IBAUTOSPOLL = _IOW(GPIB_CODE, 38, autospoll_ioctl_t),
- IBONL = _IOW(GPIB_CODE, 39, online_ioctl_t),
+ 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),
--
2.43.0