lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Nov 2021 12:36:34 +0100
From:   Alejandro Colomar <alx.manpages@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Alejandro Colomar <alx.manpages@...il.com>
Subject: [PATCH 06/17] Simplify sizeof(typeof_member()) to sizeof_field()

There's no need to use typeof() on the input to sizeof().

Signed-off-by: Alejandro Colomar <alx.manpages@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ