From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:43 +0000 (+0000) Subject: staging: gpib: Using struct gpib_board_type_ioctl X-Git-Tag: v6.16-rc1~31^2~119 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6215fb3d44998bde8c260931e2da6e77f5253772;p=linux.git staging: gpib: Using struct gpib_board_type_ioctl Using Linux code style for 'struct gpib_board_type_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 Link: https://lore.kernel.org/r/20250409055903.321438-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 549a752af950..64500e150d70 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -813,7 +813,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { struct list_head *list_ptr; - board_type_ioctl_t cmd; + struct gpib_board_type_ioctl cmd; int retval; if (!capable(CAP_SYS_ADMIN)) @@ -821,7 +821,8 @@ static int board_type_ioctl(struct gpib_file_private *file_priv, if (board->online) return -EBUSY; - retval = copy_from_user(&cmd, (void __user *)arg, sizeof(board_type_ioctl_t)); + retval = copy_from_user(&cmd, (void __user *)arg, + sizeof(struct gpib_board_type_ioctl)); if (retval) return retval; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 6202865278ea..4ddcbc2a81b0 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -12,9 +12,9 @@ #define GPIB_CODE 160 -typedef struct { +struct gpib_board_type_ioctl { char name[100]; -} board_type_ioctl_t; +}; /* argument for read/write/command ioctls */ typedef struct { @@ -143,7 +143,7 @@ enum gpib_ioctl { CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int), CFCDMA = _IOW(GPIB_CODE, 23, unsigned int), - CFCBOARDTYPE = _IOW(GPIB_CODE, 24, board_type_ioctl_t), + 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),