[Patch v1 06/21] staging: gpib: Using struct gpib_eos_ioctl

Michael Rubin
2025-04-09T05:59:13Z

Using Linux code style for 'struct gpib_eos_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>
---
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 9f7becb09e60..bbf8a60978d1 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1508,7 +1508,7 @@ static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_pr

static int eos_ioctl(struct gpib_board *board, unsigned long arg)
{
- eos_ioctl_t eos_cmd;
+ struct gpib_eos_ioctl eos_cmd;
int retval;

retval = copy_from_user(&eos_cmd, (void __user *)arg, sizeof(eos_cmd));
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 9be3262271c5..3f32eceaca93 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -42,10 +42,10 @@ struct gpib_serial_poll_ioctl {
uint8_t status_byte;
};

-typedef struct {
+struct gpib_eos_ioctl {
int eos;
int eos_flags;
-} eos_ioctl_t;
+};

typedef struct {
int handle;
@@ -138,7 +138,7 @@ enum gpib_ioctl {
IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t),
IBTMO = _IOW(GPIB_CODE, 17, unsigned int),
IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl),
- IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t),
+ IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl),
IBRSV = _IOW(GPIB_CODE, 20, uint8_t),
CFCBASE = _IOW(GPIB_CODE, 21, uint64_t),
CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int),
--
2.43.0