mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Rubin <matchstick@neverthere.org>
To: gregkh@linuxfoundation.org, dpenkler@gmail.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Michael Rubin <matchstick@neverthere.org>
Subject: [PATCH v1 5/7] staging: gpib: Removing typedef of status_byte
Date: Tue,  8 Apr 2025 23:25:33 +0000	[thread overview]
Message-ID: <20250408232535.187528-6-matchstick@neverthere.org> (raw)
In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org>

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>
---
 drivers/staging/gpib/common/gpib_os.c     | 8 ++++----
 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 a2138c7f641c..b06cbd53c36f 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 f85091b1bdf0..6a34500af65c 100644
--- a/drivers/staging/gpib/include/gpib_types.h
+++ b/drivers/staging/gpib/include/gpib_types.h
@@ -324,10 +324,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);
 
-- 
2.43.0


  parent reply	other threads:[~2025-04-08 23:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 23:25 [PATCH v1 0/7] staging: gpib: Removing typedefs Michael Rubin
2025-04-08 23:25 ` [PATCH v1 1/7] staging: gpib: Removing typedef gpib_event_queue Michael Rubin
2025-04-08 23:25 ` [PATCH v1 2/7] staging: gpib: Removing gpib_interface_list_t Michael Rubin
2025-04-08 23:25 ` [PATCH v1 3/7] staging: gpib: Removing gpib_event_t typedef Michael Rubin
2025-04-08 23:25 ` [PATCH v1 4/7] staging: gpib: Removing typedef gpib_status_queue Michael Rubin
2025-04-08 23:25 ` Michael Rubin [this message]
2025-04-08 23:25 ` [PATCH v1 6/7] staging: gpib: Removing typedef gpib_descriptor_t Michael Rubin
2025-04-08 23:25 ` [PATCH v1 7/7] staging: gpib: Remove typedef gpib_file_private_t Michael Rubin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250408232535.187528-6-matchstick@neverthere.org \
    --to=matchstick@neverthere.org \
    --cc=dpenkler@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®