diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2020-05-27 16:39:42 +0300 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2020-07-13 12:39:13 +0300 |
commit | 5f5f2949c14d6fe5cfc51bd98a41fdf69652c7e3 (patch) | |
tree | 80a1840e40a83bc49465d76699572d53ffc92ffb /arch/m68k | |
parent | 40b13fd7fd6e1ec295230cc114c6c9309e15784a (diff) | |
download | linux-5f5f2949c14d6fe5cfc51bd98a41fdf69652c7e3.tar.xz |
m68k: Use sizeof_field() helper
Make use of the sizeof_field() helper instead of an open-coded version.
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200527133942.GA10408@embeddedor
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/kernel/signal.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index b3ff39588f36..fc034fd19798 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -61,25 +61,25 @@ #define FMT4SIZE 0 #else #define FORMAT 0 -#define FMT4SIZE sizeof(((struct frame *)0)->un.fmt4) +#define FMT4SIZE sizeof_field(struct frame, un.fmt4) #endif static const int frame_size_change[16] = { - [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */ - [2] = sizeof(((struct frame *)0)->un.fmt2), - [3] = sizeof(((struct frame *)0)->un.fmt3), + [1] = -1, /* sizeof_field(struct frame, un.fmt1), */ + [2] = sizeof_field(struct frame, un.fmt2), + [3] = sizeof_field(struct frame, un.fmt3), [4] = FMT4SIZE, - [5] = -1, /* sizeof(((struct frame *)0)->un.fmt5), */ - [6] = -1, /* sizeof(((struct frame *)0)->un.fmt6), */ - [7] = sizeof(((struct frame *)0)->un.fmt7), - [8] = -1, /* sizeof(((struct frame *)0)->un.fmt8), */ - [9] = sizeof(((struct frame *)0)->un.fmt9), - [10] = sizeof(((struct frame *)0)->un.fmta), - [11] = sizeof(((struct frame *)0)->un.fmtb), - [12] = -1, /* sizeof(((struct frame *)0)->un.fmtc), */ - [13] = -1, /* sizeof(((struct frame *)0)->un.fmtd), */ - [14] = -1, /* sizeof(((struct frame *)0)->un.fmte), */ - [15] = -1, /* sizeof(((struct frame *)0)->un.fmtf), */ + [5] = -1, /* sizeof_field(struct frame, un.fmt5), */ + [6] = -1, /* sizeof_field(struct frame, un.fmt6), */ + [7] = sizeof_field(struct frame, un.fmt7), + [8] = -1, /* sizeof_field(struct frame, un.fmt8), */ + [9] = sizeof_field(struct frame, un.fmt9), + [10] = sizeof_field(struct frame, un.fmta), + [11] = sizeof_field(struct frame, un.fmtb), + [12] = -1, /* sizeof_field(struct frame, un.fmtc), */ + [13] = -1, /* sizeof_field(struct frame, un.fmtd), */ + [14] = -1, /* sizeof_field(struct frame, un.fmte), */ + [15] = -1, /* sizeof_field(struct frame, un.fmtf), */ }; static inline int frame_extra_sizes(int f) @@ -651,7 +651,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec, } else { struct switch_stack *sw = (struct switch_stack *)regs - 1; /* yes, twice as much as max(sizeof(frame.un.fmt<x>)) */ - unsigned long buf[sizeof(((struct frame *)0)->un) / 2]; + unsigned long buf[sizeof_field(struct frame, un) / 2]; /* that'll make sure that expansion won't crap over data */ if (copy_from_user(buf + fsize / 4, fp, fsize)) |