[Patch v1 05/21] staging: gpib: Using struct gpib_serial_poll_ioctl
From: Michael Rubin
Date: Wed Apr 09 2025 - 02:00:45 EST
Using Linux code style for 'struct gpib_serial_poll_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 4d105db18447..9f7becb09e60 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1289,7 +1289,7 @@ static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigne
static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg)
{
- serial_poll_ioctl_t serial_cmd;
+ struct gpib_serial_poll_ioctl serial_cmd;
int retval;
retval = copy_from_user(&serial_cmd, (void __user *)arg, sizeof(serial_cmd));
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 6ea6114ae78a..9be3262271c5 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -36,11 +36,11 @@ struct gpib_close_dev_ioctl {
unsigned int handle;
};
-typedef struct {
+struct gpib_serial_poll_ioctl {
unsigned int pad;
int sad;
uint8_t status_byte;
-} serial_poll_ioctl_t;
+};
typedef struct {
int eos;
@@ -137,7 +137,7 @@ enum gpib_ioctl {
IBPAD = _IOW(GPIB_CODE, 15, pad_ioctl_t),
IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t),
IBTMO = _IOW(GPIB_CODE, 17, unsigned int),
- IBRSP = _IOWR(GPIB_CODE, 18, serial_poll_ioctl_t),
+ IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t),
IBRSV = _IOW(GPIB_CODE, 20, uint8_t),
CFCBASE = _IOW(GPIB_CODE, 21, uint64_t),
--
2.43.0