[Patch v1 03/21] staging: gpib: Using struct gpib_open_dev_ioctl
From: Michael Rubin
Date: Wed Apr 09 2025 - 01:59:45 EST
Using Linux code style for 'struct gpib_open_dev_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 02ead46453a7..a0a9a07dab5d 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1212,7 +1212,7 @@ static int cleanup_open_devices(struct gpib_file_private *file_priv, struct gpib
static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg)
{
- open_dev_ioctl_t open_dev_cmd;
+ struct gpib_open_dev_ioctl open_dev_cmd;
int retval;
struct gpib_file_private *file_priv = filep->private_data;
int i;
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 15c924efe5bc..cfd1afb36e4f 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -25,12 +25,12 @@ struct gpib_read_write_ioctl {
int handle;
};
-typedef struct {
+struct gpib_open_dev_ioctl {
unsigned int handle;
unsigned int pad;
int sad;
unsigned is_board : 1;
-} open_dev_ioctl_t;
+};
typedef struct {
unsigned int handle;
@@ -124,7 +124,7 @@ enum gpib_ioctl {
IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl),
IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl),
IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl),
- IBOPENDEV = _IOWR(GPIB_CODE, 3, open_dev_ioctl_t),
+ IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl),
IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t),
IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t),
IBRPP = _IOWR(GPIB_CODE, 6, uint8_t),
--
2.43.0