Skip to content

Commit

Permalink
selftests/mm: define types using typedef in pkey-helpers.h
Browse files Browse the repository at this point in the history
Using #define to define types should be avoided.  Use typedef instead. 
Also ensure that __u* types are actually defined by including
<linux/types.h>.

Link: https://lkml.kernel.org/r/20241209095019.1732120-8-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Keith Lucas <keith.lucas@oracle.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Kevin Brodsky authored and Andrew Morton committed Jan 14, 2025
1 parent 31fdc96 commit f7ed833
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/testing/selftests/mm/pkey-helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
#include <ucontext.h>
#include <sys/mman.h>

#include <linux/types.h>

#include "../kselftest.h"

/* Define some kernel-like types */
#define u8 __u8
#define u16 __u16
#define u32 __u32
#define u64 __u64
typedef __u8 u8;
typedef __u16 u16;
typedef __u32 u32;
typedef __u64 u64;

#define PTR_ERR_ENOTSUP ((void *)-ENOTSUP)

Expand Down

0 comments on commit f7ed833

Please sign in to comment.