From: Ben Dooks <ben.dooks@codethink.co.uk>
To: acpica-devel@lists.linuxfoundation.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
lenb@kernel.org, nvdimm@lists.linux.dev,
Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH] ACPICA: actbl2: change to be16/be32 types for big endian data
Date: Mon, 3 Jul 2023 14:01:25 +0100 [thread overview]
Message-ID: <20230703130125.997208-1-ben.dooks@codethink.co.uk> (raw)
Some of the fields in struct acpi_nfit_control_region are used in big
endian format, and thus are generatng warnings from spare where the
member is passed to one of the conversion functions.
Fix the following sparse warnings by changing the data types:
drivers/acpi/nfit/core.c:1403:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1403:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1403:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1403:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1412:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1412:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1412:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1412:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1421:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1421:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1421:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1421:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1430:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1430:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1430:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1430:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1440:25: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1440:25: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1440:25: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1440:25: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1449:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1449:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1449:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1449:41: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1468:41: warning: cast to restricted __le16
drivers/acpi/nfit/core.c:1502:41: warning: cast to restricted __le16
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1527:41: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1792:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1792:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1792:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1792:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1794:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1794:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1794:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1794:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1795:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1798:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1798:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1798:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1798:33: warning: cast to restricted __be16
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
drivers/acpi/nfit/core.c:1799:33: warning: cast to restricted __be32
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
drivers/acpi/nfit/core.c | 8 ++++----
include/acpi/actbl2.h | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 07204d482968..0fcc247fdfac 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2194,15 +2194,15 @@ static const struct attribute_group *acpi_nfit_region_attribute_groups[] = {
/* enough info to uniquely specify an interleave set */
struct nfit_set_info {
u64 region_offset;
- u32 serial_number;
+ __be32 serial_number;
u32 pad;
};
struct nfit_set_info2 {
u64 region_offset;
- u32 serial_number;
- u16 vendor_id;
- u16 manufacturing_date;
+ __be32 serial_number;
+ __be16 vendor_id;
+ __be16 manufacturing_date;
u8 manufacturing_location;
u8 reserved[31];
};
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 0029336775a9..c1df59aa8855 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -1716,18 +1716,18 @@ struct acpi_nfit_smbios {
struct acpi_nfit_control_region {
struct acpi_nfit_header header;
u16 region_index;
- u16 vendor_id;
- u16 device_id;
- u16 revision_id;
- u16 subsystem_vendor_id;
- u16 subsystem_device_id;
- u16 subsystem_revision_id;
+ __be16 vendor_id;
+ __be16 device_id;
+ __be16 revision_id;
+ __be16 subsystem_vendor_id;
+ __be16 subsystem_device_id;
+ __be16 subsystem_revision_id;
u8 valid_fields;
u8 manufacturing_location;
- u16 manufacturing_date;
+ __be16 manufacturing_date;
u8 reserved[2]; /* Reserved, must be zero */
- u32 serial_number;
- u16 code;
+ __be32 serial_number;
+ __le16 code;
u16 windows;
u64 window_size;
u64 command_offset;
--
2.40.1
next reply other threads:[~2023-07-03 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 13:01 Ben Dooks [this message]
2023-07-04 17:19 ` Rafael J. Wysocki
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=20230703130125.997208-1-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=acpica-devel@lists.linuxfoundation.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@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®