From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Tomas Winkler" <tomas.winkler@intel.com>,
"Alexander Usyskin" <alexander.usyskin@intel.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Christoph Hellwig <hch@lst.de>,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH v3 1/4] modpost: Mark uuid_le type only for MEI
Date: Fri, 1 Oct 2021 14:37:44 +0300 [thread overview]
Message-ID: <20211001113747.64040-1-andriy.shevchenko@linux.intel.com> (raw)
The uuid_le type is used only for MEI ABI, do not advertise it for others.
Due to above, bury add_uuid() in its only user.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: no change
scripts/mod/file2alias.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 49aba862073e..c9c9c2328e26 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -34,19 +34,22 @@ typedef Elf64_Addr kernel_ulong_t;
typedef uint32_t __u32;
typedef uint16_t __u16;
typedef unsigned char __u8;
+
typedef struct {
__u8 b[16];
} guid_t;
-/* backwards compatibility, don't use in new code */
-typedef struct {
- __u8 b[16];
-} uuid_le;
typedef struct {
__u8 b[16];
} uuid_t;
+
#define UUID_STRING_LEN 36
+/* MEI UUID type, don't use anywhere else */
+typedef struct {
+ __u8 b[16];
+} uuid_le;
+
/* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since
* we handle those differences explicitly below */
@@ -104,17 +107,6 @@ static inline void add_wildcard(char *str)
strcat(str + len, "*");
}
-static inline void add_uuid(char *str, uuid_le uuid)
-{
- int len = strlen(str);
-
- sprintf(str + len, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
- uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
- uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
- uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
-}
-
/**
* Check that sizeof(device_id type) are consistent with size of section
* in .o file. If in-consistent then userspace and kernel does not agree
@@ -1211,12 +1203,16 @@ static int do_mei_entry(const char *filename, void *symval,
char *alias)
{
DEF_FIELD_ADDR(symval, mei_cl_device_id, name);
- DEF_FIELD_ADDR(symval, mei_cl_device_id, uuid);
+ DEF_FIELD(symval, mei_cl_device_id, uuid);
DEF_FIELD(symval, mei_cl_device_id, version);
sprintf(alias, MEI_CL_MODULE_PREFIX);
sprintf(alias + strlen(alias), "%s:", (*name)[0] ? *name : "*");
- add_uuid(alias, *uuid);
+ sprintf(alias + strlen(alias), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
+ uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
+ uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
+ uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
ADD(alias, ":", version != MEI_CL_VERSION_ANY, version);
strcat(alias, ":*");
--
2.33.0
next reply other threads:[~2021-10-01 11:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 11:37 Andy Shevchenko [this message]
2021-10-01 11:37 ` [PATCH v3 2/4] uuid: Make guid_t completely internal type to the kernel Andy Shevchenko
2021-10-01 12:01 ` Greg Kroah-Hartman
2021-10-01 13:15 ` Andy Shevchenko
2021-10-01 13:20 ` Andy Shevchenko
2021-10-01 11:37 ` [PATCH v3 3/4] mei: Move uuid_le_cmp() to its only user Andy Shevchenko
2021-10-01 11:37 ` [PATCH v3 4/4] mei: Unite uuid.h and mei.h in uAPI Andy Shevchenko
2021-10-01 22:41 ` kernel test robot
2021-10-01 11:59 ` [PATCH v3 1/4] modpost: Mark uuid_le type only for MEI Greg Kroah-Hartman
2021-10-01 12:12 ` Andy Shevchenko
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=20211001113747.64040-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alexander.usyskin@intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=tomas.winkler@intel.com \
--cc=u.kleine-koenig@pengutronix.de \
/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