Skip to content
Commit dd979d7a authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

apparmor: use get_unaligned() only for multi-byte words



Using get_unaligned() on a u8 pointer is pointless, and will
result in a compiler warning after a planned cleanup:

In file included from arch/x86/include/generated/asm/unaligned.h:1,
                 from security/apparmor/policy_unpack.c:16:
security/apparmor/policy_unpack.c: In function 'unpack_u8':
include/asm-generic/unaligned.h:13:15: error: 'packed' attribute ignored for field of type 'u8' {aka 'unsigned char'} [-Werror=attributes]
   13 |  const struct { type x __packed; } *__pptr = (typeof(__pptr))(ptr); \
      |               ^

Simply dereference this pointer directly.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 1b177499
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment