[Patch v1 09/21] staging: gpib: Using struct gpib_spoll_bytes_ioctl

From: Michael Rubin
Date: Wed Apr 09 2025 - 02:01:07 EST


Using Linux code style for 'struct gpib_spoll_bytes_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 b215521d0ee5..79806cc51749 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1095,7 +1095,7 @@ static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *b
static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg)
{
struct gpib_status_queue *device;
- spoll_bytes_ioctl_t cmd;
+ struct gpib_spoll_bytes_ioctl cmd;
int retval;

retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd));
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index dab170b09764..e3d167edfd69 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -64,11 +64,11 @@ struct gpib_online_ioctl {
int online;
};

-typedef struct {
+struct gpib_spoll_bytes_ioctl {
unsigned int num_bytes;
unsigned int pad;
int sad;
-} spoll_bytes_ioctl_t;
+};

typedef struct {
unsigned int pad;
@@ -146,7 +146,7 @@ enum gpib_ioctl {
CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl),

IBMUTEX = _IOW(GPIB_CODE, 26, int),
- IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, spoll_bytes_ioctl_t),
+ IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl),
IBPPC = _IOW(GPIB_CODE, 28, ppoll_config_ioctl_t),
IBBOARD_INFO = _IOR(GPIB_CODE, 29, board_info_ioctl_t),

--
2.43.0