lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 06/17] Simplify sizeof(typeof_member()) to sizeof_field()
Date
There's no need to use typeof() on the input to sizeof().

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
drivers/platform/x86/wmi.c | 4 ++--
kernel/kallsyms.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 5daadcafd808..0b1c49aa6d5f 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -33,7 +33,7 @@
#include <linux/uuid.h>
#include <linux/wmi.h>
#include <linux/fs.h>
-#include <linux/typeof_member.h>
+#include <linux/stddef.h>
#include <uapi/linux/wmi.h>

MODULE_AUTHOR("Carlos Corbacho");
@@ -54,7 +54,7 @@ struct guid_block {
u8 instance_count;
u8 flags;
} __packed;
-static_assert(sizeof(typeof_member(struct guid_block, guid)) == 16);
+static_assert(sizeof_field(struct guid_block, guid) == 16);
static_assert(sizeof(struct guid_block) == 20);
static_assert(__alignof__(struct guid_block) == 1);

diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 3bf04d89d72c..9a1e986fac0d 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -29,7 +29,7 @@
#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/kernel.h>
-#include <linux/typeof_member.h>
+#include <linux/stddef.h>

/*
* These will be re-linked against their real values
@@ -467,7 +467,7 @@ static int __sprint_symbol(char *buffer, unsigned long address,
if (add_buildid && buildid) {
/* build ID should match length of sprintf */
#if IS_ENABLED(CONFIG_MODULES)
- static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
+ static_assert(sizeof_field(struct module, build_id) == 20);
#endif
len += sprintf(buffer + len, " %20phN", buildid);
}
--
2.33.1
\
 
 \ /
  Last update: 2021-11-19 12:39    [W:0.336 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site