From: Mikhail Lukianchikov <avermoal@gmail.com>
To: lee@kernel.org
Cc: avermoal@gmail.com, linux-kernel@vger.kernel.org, mfd@lists.linux.dev
Subject: [PATCH v2] mfd: viperboard: fix native fields type in structures as little-endiand
Date: Fri, 17 Jul 2026 18:10:16 +0600 [thread overview]
Message-ID: <20260717121015.11666-2-avermoal@gmail.com> (raw)
In-Reply-To: <20260715145243.461827-2-avermoal@gmail.com>
Sparse reports several warnings about incorrect type in assignment
(different base types) when building the i2c-viperboard.c driver:
warning: incorrect type in assignment (different base types)
expected unsigned short [usertype] addr
got restricted __le16 [usertype]
Added missing change.
Signed-off-by: Mikhail Lukianchikov <avermoal@gmail.com>
---
Change in v2:
- Added missing change in vprbrd_i2c_write_hdr structure.
include/linux/mfd/viperboard.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux/mfd/viperboard.h b/include/linux/mfd/viperboard.h
index 0557667fe544..5761ebdc81b3 100644
--- a/include/linux/mfd/viperboard.h
+++ b/include/linux/mfd/viperboard.h
@@ -47,7 +47,7 @@
struct vprbrd_i2c_write_hdr {
u8 cmd;
- u16 addr;
+ __le16 addr;
u8 len1;
u8 len2;
u8 last;
@@ -57,15 +57,15 @@ struct vprbrd_i2c_write_hdr {
struct vprbrd_i2c_read_hdr {
u8 cmd;
- u16 addr;
+ __le16 addr;
u8 len0;
u8 len1;
u8 len2;
u8 len3;
u8 len4;
u8 len5;
- u16 tf1; /* transfer 1 length */
- u16 tf2; /* transfer 2 length */
+ __le16 tf1; /* transfer 1 length */
+ __le16 tf2; /* transfer 2 length */
} __packed;
struct vprbrd_i2c_status {
@@ -89,7 +89,7 @@ struct vprbrd_i2c_addr_msg {
u8 cmd;
u8 addr;
u8 unknown1;
- u16 len;
+ __le16 len;
u8 unknown2;
u8 unknown3;
} __packed;
--
2.55.0
prev parent reply other threads:[~2026-07-17 12:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 14:52 [PATCH v1] mfd: viperboard: fix native fields type in structures as little-endiand Mikhail Lukianchikov
2026-07-17 12:10 ` Mikhail Lukianchikov [this message]
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=20260717121015.11666-2-avermoal@gmail.com \
--to=avermoal@gmail.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@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 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.