From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Julian Vetter <julian@outer-limits.org>,
Arnd Bergmann <arnd@arndb.de>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove unaligned/packed_struct.h header
Date: Tue, 3 Jun 2025 17:40:24 +0200 [thread overview]
Message-ID: <f3602ce2-c5b4-4ed2-a4e9-c89534452ac8@csgroup.eu> (raw)
In-Reply-To: <20250603132414.3676142-1-julian@outer-limits.org>
Le 03/06/2025 à 15:24, Julian Vetter a écrit :
> The functions in this header are deprecated and are not used anymore.
> So, remove the header entirely.
Your patch seems uncomplete.
$ git grep get_unaligned_cpu linus/master
linus/master:include/linux/jhash.h: a +=
__get_unaligned_cpu32(k);
linus/master:include/linux/jhash.h: b +=
__get_unaligned_cpu32(k + 4);
linus/master:include/linux/jhash.h: c +=
__get_unaligned_cpu32(k + 8);
linus/master:include/linux/unaligned/packed_struct.h:static inline u16
__get_unaligned_cpu16(const void *p)
linus/master:include/linux/unaligned/packed_struct.h:static inline u32
__get_unaligned_cpu32(const void *p)
linus/master:include/linux/unaligned/packed_struct.h:static inline u64
__get_unaligned_cpu64(const void *p)
linus/master:tools/include/linux/jhash.h: a +=
__get_unaligned_cpu32(k);
linus/master:tools/include/linux/jhash.h: b +=
__get_unaligned_cpu32(k + 4);
linus/master:tools/include/linux/jhash.h: c +=
__get_unaligned_cpu32(k + 8);
linus/master:tools/include/linux/unaligned/packed_struct.h:static inline
u16 __get_unaligned_cpu16(const void *p)
linus/master:tools/include/linux/unaligned/packed_struct.h:static inline
u32 __get_unaligned_cpu32(const void *p)
linus/master:tools/include/linux/unaligned/packed_struct.h:static inline
u64 __get_unaligned_cpu64(const void *p)
Christophe
>
> Signed-off-by: Julian Vetter <julian@outer-limits.org>
> ---
> include/linux/unaligned.h | 1 -
> include/linux/unaligned/packed_struct.h | 46 -------------------------
> 2 files changed, 47 deletions(-)
> delete mode 100644 include/linux/unaligned/packed_struct.h
>
> diff --git a/include/linux/unaligned.h b/include/linux/unaligned.h
> index 4a9651017e3c..18c4b0c00e2a 100644
> --- a/include/linux/unaligned.h
> +++ b/include/linux/unaligned.h
> @@ -6,7 +6,6 @@
> * This is the most generic implementation of unaligned accesses
> * and should work almost anywhere.
> */
> -#include <linux/unaligned/packed_struct.h>
> #include <asm/byteorder.h>
> #include <vdso/unaligned.h>
>
> diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h
> deleted file mode 100644
> index f4c8eaf4d012..000000000000
> --- a/include/linux/unaligned/packed_struct.h
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -#ifndef _LINUX_UNALIGNED_PACKED_STRUCT_H
> -#define _LINUX_UNALIGNED_PACKED_STRUCT_H
> -
> -#include <linux/types.h>
> -
> -struct __una_u16 { u16 x; } __packed;
> -struct __una_u32 { u32 x; } __packed;
> -struct __una_u64 { u64 x; } __packed;
> -
> -static inline u16 __get_unaligned_cpu16(const void *p)
> -{
> - const struct __una_u16 *ptr = (const struct __una_u16 *)p;
> - return ptr->x;
> -}
> -
> -static inline u32 __get_unaligned_cpu32(const void *p)
> -{
> - const struct __una_u32 *ptr = (const struct __una_u32 *)p;
> - return ptr->x;
> -}
> -
> -static inline u64 __get_unaligned_cpu64(const void *p)
> -{
> - const struct __una_u64 *ptr = (const struct __una_u64 *)p;
> - return ptr->x;
> -}
> -
> -static inline void __put_unaligned_cpu16(u16 val, void *p)
> -{
> - struct __una_u16 *ptr = (struct __una_u16 *)p;
> - ptr->x = val;
> -}
> -
> -static inline void __put_unaligned_cpu32(u32 val, void *p)
> -{
> - struct __una_u32 *ptr = (struct __una_u32 *)p;
> - ptr->x = val;
> -}
> -
> -static inline void __put_unaligned_cpu64(u64 val, void *p)
> -{
> - struct __una_u64 *ptr = (struct __una_u64 *)p;
> - ptr->x = val;
> -}
> -
> -#endif /* _LINUX_UNALIGNED_PACKED_STRUCT_H */
prev parent reply other threads:[~2025-06-03 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 13:24 [PATCH] Remove unaligned/packed_struct.h header Julian Vetter
2025-06-03 14:29 ` Al Viro
2025-06-10 9:03 ` Julian Vetter
2025-06-03 15:40 ` Christophe Leroy [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=f3602ce2-c5b4-4ed2-a4e9-c89534452ac8@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=Jason@zx2c4.com \
--cc=arnd@arndb.de \
--cc=julian@outer-limits.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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