From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:33 +0000 (+0000) Subject: staging: gpib: Removing typedef of status_byte X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=551a1041a2424f0a9f76325c0df8a8c3aaaaf0c2;p=users%2Fdwmw2%2Flinux.git staging: gpib: Removing typedef of status_byte 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 Link: https://lore.kernel.org/r/20250408232535.187528-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 1804faa6395f4..9c943cbea984c 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -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); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 3be51ee98ef17..e03f34ecb0278 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -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);