diff options
| author | Michael Rubin <matchstick@neverthere.org> | 2025-04-09 02:25:31 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-15 17:42:40 +0300 |
| commit | 8901501d389830f7e79da8de2fa159f44802c235 (patch) | |
| tree | de06cd85df9628f8c0b2e54df93de6afafd82b42 | |
| parent | 0d01cafdb167f0c723419a05bb38b17c9804b2f1 (diff) | |
| download | linux-8901501d389830f7e79da8de2fa159f44802c235.tar.xz | |
staging: gpib: Removing gpib_event_t typedef
Removing gpib_event_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@neverthere.org>
Link: https://lore.kernel.org/r/20250408232535.187528-4-matchstick@neverthere.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/gpib/common/gpib_os.c | 8 | ||||
| -rw-r--r-- | drivers/staging/gpib/include/gpib_types.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index b1fd9261caca..f823c261b393 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1848,7 +1848,7 @@ static int push_gpib_event_nolock(struct gpib_board *board, short event_type) { struct gpib_event_queue *queue = &board->event_queue; struct list_head *head = &queue->event_head; - gpib_event_t *event; + struct gpib_event *event; static const unsigned int max_num_events = 1024; int retval; @@ -1861,7 +1861,7 @@ static int push_gpib_event_nolock(struct gpib_board *board, short event_type) return retval; } - event = kmalloc(sizeof(gpib_event_t), GFP_ATOMIC); + event = kmalloc(sizeof(struct gpib_event), GFP_ATOMIC); if (!event) { queue->dropped_event = 1; dev_err(board->gpib_dev, "failed to allocate memory for event\n"); @@ -1905,7 +1905,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, { struct list_head *head = &queue->event_head; struct list_head *front = head->next; - gpib_event_t *event; + struct gpib_event *event; if (num_gpib_events(queue) == 0) { *event_type = EVENT_NONE; @@ -1920,7 +1920,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, return -EPIPE; } - event = list_entry(front, gpib_event_t, list); + event = list_entry(front, struct gpib_event, list); *event_type = event->event_type; list_del(front); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 4c9a2a043003..e45e784ff8e9 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -303,10 +303,10 @@ struct gpib_board { }; /* element of event queue */ -typedef struct { +struct gpib_event { struct list_head list; short event_type; -} gpib_event_t; +}; /* Each board has a list of gpib_status_queue_t to keep track of all open devices * on the bus, so we know what address to poll when we get a service request |
