[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250408232535.187528-3-matchstick@neverthere.org>
Date: Tue, 8 Apr 2025 23:25:30 +0000
From: Michael Rubin <matchstick@...erthere.org>
To: gregkh@...uxfoundation.org,
dpenkler@...il.com
Cc: linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Michael Rubin <matchstick@...erthere.org>
Subject: [PATCH v1 2/7] staging: gpib: Removing gpib_interface_list_t
Removing gpib_interface_list_t to adhere 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@...erthere.org>
---
drivers/staging/gpib/common/gpib_os.c | 10 +++++-----
drivers/staging/gpib/include/gpib_types.h | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 684faa0c4547..3fb369caf17e 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -826,9 +826,9 @@ static int board_type_ioctl(gpib_file_private_t *file_priv,
for (list_ptr = registered_drivers.next; list_ptr != ®istered_drivers;
list_ptr = list_ptr->next) {
- gpib_interface_list_t *entry;
+ struct gpib_interface_list *entry;
- entry = list_entry(list_ptr, gpib_interface_list_t, list);
+ entry = list_entry(list_ptr, struct gpib_interface_list, list);
if (strcmp(entry->interface->name, cmd.name) == 0) {
int i;
int had_module = file_priv->got_module;
@@ -2026,7 +2026,7 @@ void init_gpib_descriptor(gpib_descriptor_t *desc)
int gpib_register_driver(struct gpib_interface *interface, struct module *provider_module)
{
- struct gpib_interface_list_struct *entry;
+ struct gpib_interface_list *entry;
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
@@ -2057,9 +2057,9 @@ void gpib_unregister_driver(struct gpib_interface *interface)
}
}
for (list_ptr = registered_drivers.next; list_ptr != ®istered_drivers;) {
- gpib_interface_list_t *entry;
+ struct gpib_interface_list *entry;
- entry = list_entry(list_ptr, gpib_interface_list_t, list);
+ entry = list_entry(list_ptr, struct gpib_interface_list, list);
list_ptr = list_ptr->next;
if (entry->interface == interface) {
list_del(&entry->list);
diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h
index 66a1a1676f2b..4be7cfce539f 100644
--- a/drivers/staging/gpib/include/gpib_types.h
+++ b/drivers/staging/gpib/include/gpib_types.h
@@ -209,11 +209,11 @@ static inline void init_gpib_pseudo_irq(struct gpib_pseudo_irq *pseudo_irq)
}
/* list so we can make a linked list of drivers */
-typedef struct gpib_interface_list_struct {
+struct gpib_interface_list {
struct list_head list;
struct gpib_interface *interface;
struct module *module;
-} gpib_interface_list_t;
+};
/* One struct gpib_board is allocated for each physical board in the computer.
* It provides storage for variables local to each board, and interface
--
2.43.0
Powered by blists - more mailing lists