From: Sam Edwards <cfsworks@gmail.com>
To: Gregory CLEMENT <gregory.clement@bootlin.com>,
Andi Shyti <andi.shyti@kernel.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RESEND v2 RFC 2/5] i2c: mv64xxx: Clean up the private data struct
Date: Tue, 19 Mar 2024 16:52:10 -0600 [thread overview]
Message-ID: <65fa759d.5d0a0220.fe5f7.1fa1@mx.google.com> (raw)
There are many fields in `struct mv64xxx_i2c_data` with `u32` type
despite this not being the correct type for those fields.
Change the types to accurately reflect what is being kept in each field.
Signed-off-by: Sam Edwards <sam@turingpi.com>
---
drivers/i2c/busses/i2c-mv64xxx.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index cfc16909fba3..bb048e655be7 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -83,7 +83,7 @@
#define MV64XXX_I2C_BRIDGE_STATUS_ERROR BIT(0)
/* Driver states */
-enum {
+enum mv64xxx_i2c_state {
MV64XXX_I2C_STATE_INVALID,
MV64XXX_I2C_STATE_IDLE,
MV64XXX_I2C_STATE_WAITING_FOR_START_COND,
@@ -95,7 +95,7 @@ enum {
};
/* Driver actions */
-enum {
+enum mv64xxx_i2c_action {
MV64XXX_I2C_ACTION_INVALID,
MV64XXX_I2C_ACTION_CONTINUE,
MV64XXX_I2C_ACTION_SEND_RESTART,
@@ -121,21 +121,21 @@ struct mv64xxx_i2c_data {
struct i2c_msg *msgs;
int num_msgs;
int irq;
- u32 state;
- u32 action;
- u32 aborting;
+ enum mv64xxx_i2c_state state;
+ enum mv64xxx_i2c_action action;
+ bool aborting;
u32 cntl_bits;
void __iomem *reg_base;
struct mv64xxx_i2c_regs reg_offsets;
- u32 addr1;
- u32 addr2;
- u32 bytes_left;
- u32 byte_posn;
- u32 send_stop;
- u32 block;
+ u8 addr1;
+ u8 addr2;
+ size_t bytes_left;
+ size_t byte_posn;
+ bool send_stop;
+ bool block;
int rc;
- u32 freq_m;
- u32 freq_n;
+ u8 freq_m;
+ u8 freq_n;
struct clk *clk;
struct clk *reg_clk;
wait_queue_head_t waitq;
--
2.43.2
reply other threads:[~2024-03-20 5:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=65fa759d.5d0a0220.fe5f7.1fa1@mx.google.com \
--to=cfsworks@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.