staging: gpib: Removing typedef of status_byte
authorMichael Rubin <matchstick@neverthere.org>
Tue, 8 Apr 2025 23:25:33 +0000 (23:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2025 14:42:40 +0000 (16:42 +0200)
Replacing typedef of status_byte_t with struct gpib_status_byte to adhere to
Linux coding 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-6-matchstick@neverthere.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/common/gpib_os.c
drivers/staging/gpib/include/gpib_types.h

index 1804faa6395f4ada04da51433419b4f300b1fe51..9c943cbea984c58dace4aed7ef564c10161d60b6 100644 (file)
@@ -183,7 +183,7 @@ unsigned int num_status_bytes(const struct gpib_status_queue *dev)
 int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, u8 poll_byte)
 {
        struct list_head *head = &device->status_bytes;
-       status_byte_t *status;
+       struct gpib_status_byte *status;
        static const unsigned int max_num_status_bytes = 1024;
        int retval;
 
@@ -196,7 +196,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device,
                        return retval;
        }
 
-       status = kmalloc(sizeof(status_byte_t), GFP_KERNEL);
+       status = kmalloc(sizeof(struct gpib_status_byte), GFP_KERNEL);
        if (!status)
                return -ENOMEM;
 
@@ -218,7 +218,7 @@ int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device,
 {
        struct list_head *head = &device->status_bytes;
        struct list_head *front = head->next;
-       status_byte_t *status;
+       struct gpib_status_byte *status;
 
        if (num_status_bytes(device) == 0)
                return -EIO;
@@ -231,7 +231,7 @@ int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device,
                return -EPIPE;
        }
 
-       status = list_entry(front, status_byte_t, list);
+       status = list_entry(front, struct gpib_status_byte, list);
        *poll_byte = status->poll_byte;
 
        list_del(front);
index 3be51ee98ef176d32adcdd6a8279f76572ac8eee..e03f34ecb027882544f685bdb4ddd24fa361dde7 100644 (file)
@@ -325,10 +325,10 @@ struct gpib_status_queue {
        unsigned dropped_byte : 1;
 };
 
-typedef struct {
+struct gpib_status_byte {
        struct list_head list;
        u8 poll_byte;
-} status_byte_t;
+};
 
 void init_gpib_status_queue(struct gpib_status_queue *device);