mbox series

[0/8] Cleanup unaligned access macros

Message ID 20230522122238.4191762-1-jens.wiklander@linaro.org (mailing list archive)
Headers show
Series Cleanup unaligned access macros | expand

Message

Jens Wiklander May 22, 2023, 12:22 p.m. UTC
Hi,

There are two versions of get/set_unaligned, get_unaligned_be64,
put_unaligned_le64 etc in U-Boot causing confusion (and bugs).

In this patch-set, I'm trying to fix that with a single unified version of
the access macros to be used across all archs. This work is inspired by
similar changes in this Linux kernel by Arnd Bergman,
https://lore.kernel.org/lkml/20210514100106.3404011-1-arnd@kernel.org/

Thanks,
Jens

Jens Wiklander (8):
  arm: use asm-generic/unaligned.h
  sh: use asm-generic/unaligned.h
  mips: use asm-generic/unaligned.h
  m68k: use asm-generic/unaligned.h
  powerpc: use asm-generic/unaligned.h
  fs/btrfs: use asm/unaligned.h
  linux/unaligned: remove unused access_ok.h
  asm-generic: simplify unaligned.h

 arch/arm/include/asm/unaligned.h     | 21 +------
 arch/m68k/include/asm/unaligned.h    | 17 +-----
 arch/mips/include/asm/unaligned.h    | 23 +------
 arch/powerpc/include/asm/unaligned.h | 18 +-----
 arch/sh/include/asm/unaligned.h      | 22 +------
 fs/btrfs/crypto/hash.c               |  2 +-
 include/asm-generic/unaligned.h      | 89 +++++++++++++++++++++++-----
 include/linux/unaligned/access_ok.h  | 66 ---------------------
 8 files changed, 83 insertions(+), 175 deletions(-)
 delete mode 100644 include/linux/unaligned/access_ok.h

Comments

Ilias Apalodimas May 22, 2023, 8:34 p.m. UTC | #1
Hi Jens

On Mon, May 22, 2023 at 02:22:30PM +0200, Jens Wiklander wrote:
> Hi,
>
> There are two versions of get/set_unaligned, get_unaligned_be64,
> put_unaligned_le64 etc in U-Boot causing confusion (and bugs).
>
> In this patch-set, I'm trying to fix that with a single unified version of
> the access macros to be used across all archs. This work is inspired by
> similar changes in this Linux kernel by Arnd Bergman,
> https://lore.kernel.org/lkml/20210514100106.3404011-1-arnd@kernel.org/
>
> Thanks,
> Jens

Thanks for the cleanup.

For the series
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Although I'd like to hear from arch maintainers as well.

Tom, This did pass all the CI successfully, but regardless I think it
should be pulled into -next.  If you want me to pick it up via the TPM tree
please let me know.

Thanks
/Ilias
>
> Jens Wiklander (8):
>   arm: use asm-generic/unaligned.h
>   sh: use asm-generic/unaligned.h
>   mips: use asm-generic/unaligned.h
>   m68k: use asm-generic/unaligned.h
>   powerpc: use asm-generic/unaligned.h
>   fs/btrfs: use asm/unaligned.h
>   linux/unaligned: remove unused access_ok.h
>   asm-generic: simplify unaligned.h
>
>  arch/arm/include/asm/unaligned.h     | 21 +------
>  arch/m68k/include/asm/unaligned.h    | 17 +-----
>  arch/mips/include/asm/unaligned.h    | 23 +------
>  arch/powerpc/include/asm/unaligned.h | 18 +-----
>  arch/sh/include/asm/unaligned.h      | 22 +------
>  fs/btrfs/crypto/hash.c               |  2 +-
>  include/asm-generic/unaligned.h      | 89 +++++++++++++++++++++++-----
>  include/linux/unaligned/access_ok.h  | 66 ---------------------
>  8 files changed, 83 insertions(+), 175 deletions(-)
>  delete mode 100644 include/linux/unaligned/access_ok.h
>
> --
> 2.34.1
>
Tom Rini May 23, 2023, 6:56 p.m. UTC | #2
On Mon, May 22, 2023 at 11:34:36PM +0300, Ilias Apalodimas wrote:
> Hi Jens
> 
> On Mon, May 22, 2023 at 02:22:30PM +0200, Jens Wiklander wrote:
> > Hi,
> >
> > There are two versions of get/set_unaligned, get_unaligned_be64,
> > put_unaligned_le64 etc in U-Boot causing confusion (and bugs).
> >
> > In this patch-set, I'm trying to fix that with a single unified version of
> > the access macros to be used across all archs. This work is inspired by
> > similar changes in this Linux kernel by Arnd Bergman,
> > https://lore.kernel.org/lkml/20210514100106.3404011-1-arnd@kernel.org/
> >
> > Thanks,
> > Jens
> 
> Thanks for the cleanup.
> 
> For the series
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Although I'd like to hear from arch maintainers as well.
> 
> Tom, This did pass all the CI successfully, but regardless I think it
> should be pulled into -next.  If you want me to pick it up via the TPM tree
> please let me know.

I'll pick this up for -next after it's been around a little bit longer,
to let people test / ack it, thanks.