staging: gpib: Removing typedef gpib_event_queue
authorMichael Rubin <matchstick@neverthere.org>
Tue, 8 Apr 2025 23:25:29 +0000 (23:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:41:56 +0000 (16:41 +0200)
Removing gpib_event_queue_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-2-matchstick@neverthere.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/common/gpib_os.c
drivers/staging/gpib/include/gpibP.h
drivers/staging/gpib/include/gpib_types.h

index e97e8f8a62f92f0efaacdd70b28f07f3260b5f21..d78db5dd015078e61257e353f008377bb3f6b631 100644 (file)
@@ -74,7 +74,7 @@ static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg);
 static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_board *board);
 
 static int pop_gpib_event_nolock(struct gpib_board *board,
-                                gpib_event_queue_t *queue, short *event_type);
+                                struct gpib_event_queue *queue, short *event_type);
 
 /*
  * Timer functions
@@ -1839,14 +1839,14 @@ static int select_device_path_ioctl(struct gpib_board_config *config, unsigned l
        return 0;
 }
 
-unsigned int num_gpib_events(const gpib_event_queue_t *queue)
+unsigned int num_gpib_events(const struct gpib_event_queue *queue)
 {
        return queue->num_events;
 }
 
 static int push_gpib_event_nolock(struct gpib_board *board, short event_type)
 {
-       gpib_event_queue_t *queue = &board->event_queue;
+       struct gpib_event_queue *queue = &board->event_queue;
        struct list_head *head = &queue->event_head;
        gpib_event_t *event;
        static const unsigned int max_num_events = 1024;
@@ -1901,7 +1901,7 @@ int push_gpib_event(struct gpib_board *board, short event_type)
 EXPORT_SYMBOL(push_gpib_event);
 
 static int pop_gpib_event_nolock(struct gpib_board *board,
-                                gpib_event_queue_t *queue, short *event_type)
+                                struct gpib_event_queue *queue, short *event_type)
 {
        struct list_head *head = &queue->event_head;
        struct list_head *front = head->next;
@@ -1935,7 +1935,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board,
 }
 
 // pop event from front of event queue
-int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type)
+int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type)
 {
        unsigned long flags;
        int retval;
index 0a854697e933eac8e1ede8b0f909106d51d6c871..3e21bb1a4297fac1cccc4e72edc4315d4a3e2080 100644 (file)
@@ -25,9 +25,9 @@ struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsi
 struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id,
                                    unsigned int device_id, unsigned int ss_vendor,
                                    unsigned int ss_device, struct pci_dev *from);
-unsigned int num_gpib_events(const gpib_event_queue_t *queue);
+unsigned int num_gpib_events(const struct gpib_event_queue *queue);
 int push_gpib_event(struct gpib_board *board, short event_type);
-int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type);
+int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type);
 int gpib_request_pseudo_irq(struct gpib_board *board, irqreturn_t (*handler)(int, void *));
 void gpib_free_pseudo_irq(struct gpib_board *board);
 int gpib_match_device_path(struct device *dev, const char *device_path_in);
index f4cb346b8a0284bfc500b5b203459872b64218c7..1d14c6a6e29edf1a4acfe6f7fbb20f9921f51be2 100644 (file)
@@ -179,14 +179,14 @@ struct gpib_interface_struct {
        unsigned skip_check_for_command_acceptors : 1;
 };
 
-typedef struct {
+struct gpib_event_queue {
        struct list_head event_head;
        spinlock_t lock; // for access to event list
        unsigned int num_events;
        unsigned dropped_event : 1;
-} gpib_event_queue_t;
+};
 
-static inline void init_event_queue(gpib_event_queue_t *queue)
+static inline void init_event_queue(struct gpib_event_queue *queue)
 {
        INIT_LIST_HEAD(&queue->event_head);
        queue->num_events = 0;
@@ -284,7 +284,7 @@ struct gpib_board {
        /* autospoll kernel thread */
        struct task_struct *autospoll_task;
        /* queue for recording received trigger/clear/ifc events */
-       gpib_event_queue_t event_queue;
+       struct gpib_event_queue event_queue;
        /* minor number for this board's device file */
        int minor;
        /* struct to deal with polling mode*/