[Patch v1 16/21] staging: gpib: Using struct gpib_request_service2

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

Using Linux code style for 'struct gpib_request_service2' 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 | 4 ++--
drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 71c379c22be0..446827701399 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1532,11 +1532,11 @@ static int request_service_ioctl(struct gpib_board *board, unsigned long arg)

static int request_service2_ioctl(struct gpib_board *board, unsigned long arg)
{
- request_service2_t request_service2_cmd;
+ struct gpib_request_service2 request_service2_cmd;
int retval;

retval = copy_from_user(&request_service2_cmd, (void __user *)arg,
- sizeof(request_service2_t));
+ sizeof(struct gpib_request_service2));
if (retval)
return -EFAULT;

diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 473b09d4efaa..eea169a0ba40 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -114,10 +114,10 @@ typedef short autospoll_ioctl_t;
typedef short local_ppoll_mode_ioctl_t;

// update status byte and request service
-typedef struct {
+struct gpib_request_service2 {
uint8_t status_byte;
int new_reason_for_service;
-} request_service2_t;
+};

/* Standard functions. */
enum gpib_ioctl {
@@ -163,7 +163,7 @@ enum gpib_ioctl {
IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t),
IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl),
// 44 was IBSELECT_SERIAL_NUMBER
- IBRSV2 = _IOW(GPIB_CODE, 45, request_service2_t)
+ IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2)
};

#endif /* _GPIB_IOCTL_H */
--
2.43.0