From: Michael Rubin <matchstick@neverthere.org>
To: gregkh@linuxfoundation.org, dpenkler@gmail.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Rubin <matchstick@neverthere.org>
Subject: [Patch v1 02/21] staging: gpib: Using struct gpib_read_write_ioctl
Date: Wed, 9 Apr 2025 05:58:44 +0000 [thread overview]
Message-ID: <20250409055903.321438-3-matchstick@neverthere.org> (raw)
In-Reply-To: <20250409055903.321438-1-matchstick@neverthere.org>
Using Linux code style for 'struct gpib_read_write_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 | 6 +++---
drivers/staging/gpib/uapi/gpib_ioctl.h | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index e12a9e56d808..02ead46453a7 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -865,7 +865,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv,
static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board,
unsigned long arg)
{
- read_write_ioctl_t read_cmd;
+ struct gpib_read_write_ioctl read_cmd;
u8 __user *userbuf;
unsigned long remain;
int end_flag = 0;
@@ -940,7 +940,7 @@ static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *bo
static int command_ioctl(struct gpib_file_private *file_priv,
struct gpib_board *board, unsigned long arg)
{
- read_write_ioctl_t cmd;
+ struct gpib_read_write_ioctl cmd;
u8 __user *userbuf;
unsigned long remain;
int retval;
@@ -1024,7 +1024,7 @@ static int command_ioctl(struct gpib_file_private *file_priv,
static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board,
unsigned long arg)
{
- read_write_ioctl_t write_cmd;
+ struct gpib_read_write_ioctl write_cmd;
u8 __user *userbuf;
unsigned long remain;
int retval = 0;
diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 4ddcbc2a81b0..15c924efe5bc 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -17,13 +17,13 @@ struct gpib_board_type_ioctl {
};
/* argument for read/write/command ioctls */
-typedef struct {
+struct gpib_read_write_ioctl {
uint64_t buffer_ptr;
unsigned int requested_transfer_count;
unsigned int completed_transfer_count;
int end; /* end flag return for reads, end io suppression request for cmd*/
int handle;
-} read_write_ioctl_t;
+};
typedef struct {
unsigned int handle;
@@ -121,9 +121,9 @@ typedef struct {
/* Standard functions. */
enum gpib_ioctl {
- IBRD = _IOWR(GPIB_CODE, 100, read_write_ioctl_t),
- IBWRT = _IOWR(GPIB_CODE, 101, read_write_ioctl_t),
- IBCMD = _IOWR(GPIB_CODE, 102, read_write_ioctl_t),
+ IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl),
+ IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl),
+ IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl),
IBOPENDEV = _IOWR(GPIB_CODE, 3, open_dev_ioctl_t),
IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t),
IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t),
--
2.43.0
next prev parent reply other threads:[~2025-04-09 5:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 5:58 [Patch v1 00/21] staging: gpib: Removing typedefs for ioctl API Michael Rubin
2025-04-09 5:58 ` [Patch v1 01/21] staging: gpib: Using struct gpib_board_type_ioctl Michael Rubin
2025-04-09 8:10 ` Dan Carpenter
2025-04-09 8:56 ` Dave Penkler
2025-04-09 9:42 ` Dan Carpenter
2025-04-09 5:58 ` Michael Rubin [this message]
2025-04-09 5:58 ` [Patch v1 03/21] staging: gpib: Using struct gpib_open_dev_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 04/21] staging: gpib: Using struct gpib_close_dev_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 05/21] staging: gpib: Using struct gpib_serial_poll_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 06/21] staging: gpib: Using struct gpib_eos_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 07/21] staging: gpib: Using struct gpib_wait_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 08/21] staging: gpib: Using struct gpib_online_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 09/21] staging: gpib: Using struct gpib_spoll_bytes_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 10/21] staging: gpib: Using struct gpib_board_info_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 11/21] staging: gpib: Using struct gpib_select_pci_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 12/21] staging: gpib: Using struct gpib_ppoll_config_ioctl` Michael Rubin
2025-04-09 5:58 ` [Patch v1 13/21] staging: gpib: Using struct gpib_pad_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 14/21] staging: gpib: Using struct gpib_sad_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 15/21] staging: gpib: Using gpib_select_device_path_ioctl Michael Rubin
2025-04-09 5:58 ` [Patch v1 16/21] staging: gpib: Using struct gpib_request_service2 Michael Rubin
2025-04-09 5:58 ` [Patch v1 17/21] staging: gpib: event_ioctl_t now short Michael Rubin
2025-04-09 5:59 ` [Patch v1 18/21] staging: gpib: rsc_ioctl_t now int Michael Rubin
2025-04-09 5:59 ` [Patch v1 19/21] staging: gpib: t1_delay_ioctl_t now unsigned int Michael Rubin
2025-04-09 5:59 ` [Patch v1 20/21] staging: gpib: autospoll_ioctl_t now short Michael Rubin
2025-04-09 5:59 ` [Patch v1 21/21] staging: gpib: local_ppoll_mode_ioctl_t " Michael Rubin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250409055903.321438-3-matchstick@neverthere.org \
--to=matchstick@neverthere.org \
--cc=dpenkler@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox